aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2007-03-13 07:19:14 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2007-03-13 07:19:14 +0000
commit03943c05c123b301f978f2c5f56fc692a03586cb (patch)
treea589b7305cf809c8177da753f9992003644b90a1
parent98312a9bed2a80aa30c3cc2abc70f50def92d595 (diff)
downloadgcc-03943c05c123b301f978f2c5f56fc692a03586cb.zip
gcc-03943c05c123b301f978f2c5f56fc692a03586cb.tar.gz
gcc-03943c05c123b301f978f2c5f56fc692a03586cb.tar.bz2
configure.ac: Test for assembler tolerance to # 0 "".
* 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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config.in6
-rwxr-xr-xgcc/configure40
-rw-r--r--gcc/configure.ac24
-rw-r--r--gcc/final.c6
5 files changed, 81 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e11f80a..2006f48 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config.in b/gcc/config.in
index 275327d..9906ad7 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -240,6 +240,12 @@
#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
diff --git a/gcc/configure b/gcc/configure
index 15a4e05..488794b 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -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
diff --git a/gcc/configure.ac b/gcc/configure.ac
index ed5fb20..768cff0 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -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
diff --git a/gcc/final.c b/gcc/final.c
index 5715a71..93112ec 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -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;