[m-rev.] diff: avoid gcc problem on Mac OS X

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Dec 20 13:20:31 AEDT 2011


Branches: main, 11.07

Avoid a dodgy GCC optimization on Mac OS X.

configure.in:
 	Disable GCC's -ftree-vrp optimization on Mac OS X with
 	GCC 4.2 since it causes code in the hlc.gc grade to be
 	miscompiled.

Julien.

Index: configure.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/configure.in,v
retrieving revision 1.606
diff -u -r1.606 configure.in
--- configure.in	14 Dec 2011 04:07:46 -0000	1.606
+++ configure.in	20 Dec 2011 02:13:08 -0000
@@ -4457,6 +4457,18 @@
              *)       CFLAGS_FOR_OPT="-O2 -fomit-frame-pointer" ;;
          esac

+        # Disable the GCC optimization -ftree-vrp with GCC 4.2. on Darwin
+        # since enabling it causes code in the hlc.gc grade to be miscompiled.
+        case "$host" in
+            *apple*darwin*)
+                case "$C_COMPILER_TYPE" in
+                    gcc_4_2_*)
+                        CFLAGS_FOR_OPT="$CFLAGS_FOR_OPT -fno-tree-vrp"
+                    ;;
+                esac
+            ;;
+        esac
+
          CFLAGS_FOR_DEBUG="-g"
          CFLAGS_FOR_NO_STRICT_ALIASING="-fno-strict-aliasing"
          MCFLAGS_FOR_CC=

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list