From: Bruno Haible Date: Mon, 29 Aug 2005 13:13:06 +0000 (+0000) Subject: Work around g++ 4.0 "duplicated labels" problem. X-Git-Tag: cln_1-1-10~16 X-Git-Url: https://www.ginac.de/CLN/cln.git//cln.git?a=commitdiff_plain;h=134b80ebc1a7f4ea68048ee296193861069e18af;p=cln.git Work around g++ 4.0 "duplicated labels" problem. --- diff --git a/ChangeLog b/ChangeLog index c88c375..b99032e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-08-27 Bruno Haible + + * modules.h (CL_OUTPUT_LABEL): Work around redundant duplication + of basic blocks by g++ 4.0. + See . + 2005-08-27 Bruno Haible Make it possible to cross-compile CLN. diff --git a/include/cln/modules.h b/include/cln/modules.h index 3a9c17b..b1bf8ac 100644 --- a/include/cln/modules.h +++ b/include/cln/modules.h @@ -102,6 +102,17 @@ // boxen so decided to potentially ditch the support (no joke). Please // send an email if you can explain to me what's going on! (-rbk. 07/2001) #define CL_OUTPUT_LABEL(label) ASM_VOLATILE ("\n" label ":") + #elif defined(__ia64__) + // g++-4.0 on IA64 likes to duplicate parts of basic blocks for no good + // reason. To avoid an error when a label is defined twice, we can either + // append "-Os" to the CXXFLAGS (then g++ does not create redundant + // duplicates of basic blocks), or declare the label in a way that may + // be redefined. + // Why the "nop 0"? Apparently "." refers to the last instruction bundle. + // Just ".set label,." would cause the branch to executed unwanted code. + // And ".set label,.+16" might not work at the very beginning of a + // function. So we spend a nop; it becomes the target of the jump. + #define CL_OUTPUT_LABEL(label) ASM_VOLATILE ("nop 0" "\n" ".set " label ", .") #else #define CL_OUTPUT_LABEL(label) ASM_VOLATILE ("\n" label ":") #endif