[m-rev.] for review: fix asm_fast grades with GCC 6

Julien Fischer jfischer at opturion.com
Thu Jul 7 16:00:05 AEST 2016


On Wed, 6 Jul 2016, Zoltan Somogyi wrote:

>
>
> On Wed, 6 Jul 2016 10:48:36 +1000 (AEST), Julien Fischer <jfischer at opturion.com> wrote:
>> They just bumped their major version number
>
> I think this is likely to happen again with gcc 7, gcc 8 etc.
>
> We can either add them to the case patterns as well right now,
> or change the configure script to simply test for the presence
> of the -fno-tree-dominator-opts option, and use it if it exists.
> If the tree dominator optimization ever starts working properly
> for us, we can worry about it then.

Done, diff follows.

Julien.

----------------------------------

Make configure test if -fno-tree-dominator-opts is supported.

configure.ac:
     Test whether -fno-tree-dominator-opts is supported by GCC instead
     of hardcoding a list of GCC versions that do support it.

diff --git a/configure.ac b/configure.ac
index 74f6e66..c6e6988 100644
--- a/configure.ac
+++ b/configure.ac
@@ -914,6 +914,7 @@ then
      CFLAGS_FOR_ERRMSG_FILTER=""
      CFLAGS_FOR_NO_MOVE_LOOP_INVARIANTS=
      CFLAGS_FOR_NO_REORDER_FUNCTIONS=""
+    CFLAGS_FOR_NO_TREE_DOMINATOR_OPTS=

  else

@@ -980,6 +981,17 @@ EOF
          CFLAGS_FOR_NO_REORDER_FUNCTIONS=""
      fi

+    AC_MSG_CHECKING(whether we can use -fno-tree-dominator-opts)
+    if $CC -fno-tree-dominator-opts -c conftest.c \
+        </dev/null >&AC_FD_CC 2>&1
+    then
+        AC_MSG_RESULT(yes)
+        CFLAGS_FOR_NO_TREE_DOMINATOR_OPTS="-fno-tree-dominator-opts"
+    else
+        AC_MSG_RESULT(no)
+        CFLAGS_FOR_NO_TREE_DOMINATOR_OPTS=
+    fi
+
      rm -f conftest*
  fi
  AC_SUBST(CFLAGS_FOR_ERRMSG_FILTER)
@@ -2571,15 +2583,9 @@ case "$ac_cv_prog_gcc" in yes)
              CFLAGS_FOR_GOTOS="$CFLAGS_FOR_GOTOS -fomit-frame-pointer"
              ;;
          i*86-*|x86_64*)
-            # On x86-64 with GCC 4.8 and 4.9, gcc labels do not work correctly
-            # with -ftree-dominator-opts -- we disable it for x86 in this case
-            # too.
-            #
-            case "$C_COMPILER_TYPE" in
-                gcc_4_8_*|gcc_4_9_*|gcc_5_*|gcc_6_*)
-                  CFLAGS_FOR_GOTOS="$CFLAGS_FOR_GOTOS -fno-tree-dominator-opts"
-                ;;
-            esac
+            # On x86-64 and x86, GCC labels do not work correctly with
+            # -ftree-dominator-opts.
+            CFLAGS_FOR_GOTOS="$CFLAGS_FOR_GOTOS $CFLAGS_FOR_NO_TREE_DOMINATOR_OPTS"
              CFLAGS_FOR_REGS="-fno-builtin -fno-omit-frame-pointer"
              ;;
          # We need a special-case hack here, because the auto-config


More information about the reviews mailing list