configure.ac: Test for assembler tolerance to # 0 "".
authorAlexandre Oliva <aoliva@redhat.com>
Tue, 13 Mar 2007 07:19:14 +0000 (07:19 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Tue, 13 Mar 2007 07:19:14 +0000 (07:19 +0000)
* configure.ac: Test for assembler tolerance to # 0 "".
* configure, config.in: Rebuilt.
* final.c (final_scan_insn): Emit it if HAVE_AS_LINE_ZERO.

From-SVN: r122879

gcc/ChangeLog
gcc/config.in
gcc/configure
gcc/configure.ac
gcc/final.c

index e11f80a2aa17b50839937a8f3f5a2ab89c055df3..2006f4819338ec72fdc62fe1af15fd0d03b6774d 100644 (file)
@@ -1,3 +1,9 @@
+2007-03-13  Alexandre Oliva  <aoliva@redhat.com>
+
+       * configure.ac: Test for assembler tolerance to # 0 "".
+       * configure, config.in: Rebuilt.
+       * final.c (final_scan_insn): Emit it if HAVE_AS_LINE_ZERO.
+
 2007-03-13  Geoffrey Keating  <geoffk@apple.com>
 
        * doc/invoke.texi (Spec Files): Update for '%{,' spec.
index 275327d46e7d4fb9d35ad39c7a97208030c562b3..9906ad71fdaa2b4c7e8c922b0d07f47bc4f4466f 100644 (file)
 #endif
 
 
+/* Define if the assembler won't complain about a line such as # 0 "" 2. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_LINE_ZERO
+#endif
+
+
 /* Define if your assembler supports ltoffx and ldxmov relocations. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_AS_LTOFFX_LDXMOV_RELOCS
index 15a4e05b31a27c3690aca62355bd4baa25c58d9c..488794bcd2508017150bd2e820897f59488be0f1 100755 (executable)
@@ -16005,6 +16005,46 @@ _ACEOF
 fi
 fi
 
+echo "$as_me:$LINENO: checking assembler for tolerance to line number 0" >&5
+echo $ECHO_N "checking assembler for tolerance to line number 0... $ECHO_C" >&6
+if test "${gcc_cv_as_line_zero+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  gcc_cv_as_line_zero=no
+  if test $in_tree_gas = yes; then
+    if test $gcc_cv_gas_vers -ge `expr \( \( elf,2,16,91 \* 1000 \) + gcc_cv_as_line_zero=yes \) \* 1000 + `
+  then :
+fi
+  elif test "x$gcc_cv_as" != x; then
+    { echo '# 1 "test.s" 1'; echo '# 0 "" 2'; } > conftest.s
+    if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5 2>conftest.out'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+       test "x`cat conftest.out`" = x
+    then
+      gcc_cv_as_line_zero=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+      echo "configure: error output was" >&5
+      cat conftest.out >&5
+    fi
+    rm -f conftest.o conftest.s conftest.out
+  fi
+fi
+echo "$as_me:$LINENO: result: $gcc_cv_as_line_zero" >&5
+echo "${ECHO_T}$gcc_cv_as_line_zero" >&6
+if test "x$gcc_cv_as_line_zero" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_AS_LINE_ZERO 1
+_ACEOF
+
+fi
+
 echo "$as_me:$LINENO: checking linker read-only and read-write section mixing" >&5
 echo $ECHO_N "checking linker read-only and read-write section mixing... $ECHO_C" >&6
 gcc_cv_ld_ro_rw_mix=unknown
index ed5fb203eef207cde9417dc32a5148df6dff6768..768cff05208f07eae492afb36c3e380367df740f 100644 (file)
@@ -3069,6 +3069,30 @@ if test x"$insn" != x; then
 [Define if your assembler supports the --gstabs option.])])
 fi
 
+AC_CACHE_CHECK([assembler for tolerance to line number 0],
+ [gcc_cv_as_line_zero],
+ [gcc_cv_as_line_zero=no
+  if test $in_tree_gas = yes; then
+    gcc_GAS_VERSION_GTE_IFELSE([elf,2,16,91], [gcc_cv_as_line_zero=yes])
+  elif test "x$gcc_cv_as" != x; then
+    { echo '# 1 "test.s" 1'; echo '# 0 "" 2'; } > conftest.s
+    if AC_TRY_COMMAND([$gcc_cv_as -o conftest.o conftest.s >&AS_MESSAGE_LOG_FD 2>conftest.out]) &&
+       test "x`cat conftest.out`" = x
+    then
+      gcc_cv_as_line_zero=yes
+    else
+      echo "configure: failed program was" >&AS_MESSAGE_LOG_FD
+      cat conftest.s >&AS_MESSAGE_LOG_FD
+      echo "configure: error output was" >&AS_MESSAGE_LOG_FD
+      cat conftest.out >&AS_MESSAGE_LOG_FD
+    fi
+    rm -f conftest.o conftest.s conftest.out
+  fi])
+if test "x$gcc_cv_as_line_zero" = xyes; then
+  AC_DEFINE([HAVE_AS_LINE_ZERO], 1,
+[Define if the assembler won't complain about a line such as # 0 "" 2.])
+fi
+
 AC_MSG_CHECKING(linker read-only and read-write section mixing)
 gcc_cv_ld_ro_rw_mix=unknown
 if test $in_tree_ld = yes ; then
index 5715a71a648970286539b7ff7593a6e651618ce5..93112ec808baec40bfaa5d3f1d633f096d3d12cd 100644 (file)
@@ -2085,8 +2085,10 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
                  fprintf (asm_out_file, "%s %i \"%s\" 1\n",
                           ASM_COMMENT_START, loc.line, loc.file);
                fprintf (asm_out_file, "\t%s\n", string);
-               if (loc.file && loc.line)
+#if HAVE_AS_LINE_ZERO
+               if (*loc.file && loc.line)
                  fprintf (asm_out_file, "%s 0 \"\" 2\n", ASM_COMMENT_START);
+#endif
              }
            break;
          }
@@ -2124,8 +2126,10 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
                  fprintf (asm_out_file, "%s %i \"%s\" 1\n",
                           ASM_COMMENT_START, loc.line, loc.file);
                output_asm_insn (string, ops);
+#if HAVE_AS_LINE_ZERO
                if (loc.file && loc.line)
                  fprintf (asm_out_file, "%s 0 \"\" 2\n", ASM_COMMENT_START);
+#endif
              }
 
            this_is_asm_operands = 0;