]> www.ginac.de Git - cln.git/commitdiff
Work around g++ 4.0 "duplicated labels" problem.
authorBruno Haible <bruno@clisp.org>
Mon, 29 Aug 2005 13:13:06 +0000 (13:13 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 29 Aug 2005 13:13:06 +0000 (13:13 +0000)
ChangeLog
include/cln/modules.h

index c88c37544358cd3b7fb7deba51b072a8bee79e64..b99032ea6f7e68216c9e56d9601aea331b0352af 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-08-27  Bruno Haible  <bruno@clisp.org>
+
+       * modules.h (CL_OUTPUT_LABEL): Work around redundant duplication
+       of basic blocks by g++ 4.0.
+       See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23345>.
+
 2005-08-27  Bruno Haible  <bruno@clisp.org>
 
        Make it possible to cross-compile CLN.
index 3a9c17b69ee689c12d5f0ba26d4e5644859d8218..b1bf8ac540f9e60e04a52539e482557cec0bf974 100644 (file)
     // 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