]> gcc.gnu.org Git - gcc.git/commitdiff
[PR87013] check for .loc is_stmt support in the assembler
authorAlexandre Oliva <aoliva@redhat.com>
Thu, 20 Sep 2018 19:34:30 +0000 (19:34 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Thu, 20 Sep 2018 19:34:30 +0000 (19:34 +0000)
Back when we had the logic to output is_stmt but never exercised it,
it didn't matter that we didn't test for assembler support for it.
But there are still assemblers out there that do not support it, so
now that we enable the formerly latent is_stmt logic, we'd better make
sure the assembler can deal with it.

for  gcc/ChangeLog

PR bootstrap/87013
* configure.ac: Check for .loc is_stmt support.
* configure, config.in: Rebuilt.
* dwarf2out.c (dwarf2out_source_line): Skip is_stmt
if not supported.

From-SVN: r264449

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

index 80794e31b8f73a7bb0be1b2d0c1d3f450e5d7eae..641e3591040ffeaa3283aa0786a36434bd3b188a 100644 (file)
@@ -1,3 +1,11 @@
+2018-09-20  Alexandre Oliva <aoliva@redhat.com>
+
+       PR bootstrap/87013
+       * configure.ac: Check for .loc is_stmt support.
+       * configure, config.in: Rebuilt.
+       * dwarf2out.c (dwarf2out_source_line): Skip is_stmt
+       if not supported.
+
 2018-09-20  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * config/rs6000/rs6000.opt (misel=no, misel=yes): Delete.
index 2856e72d627df537a301a6c7ab6b5bbb75f6b43f..775536e68e98f2ccba64f4f9ffa848f1b62b173f 100644 (file)
 #endif
 
 
+/* Define if your assembler supports the .loc is_stmt sub-directive. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_GAS_LOC_STMT
+#endif
+
+
 /* Define if your assembler supports specifying the maximum number of bytes to
    skip when using the GAS .p2align command. */
 #ifndef USED_FOR_TARGET
index 5ae43ec891778aec955e36b67f5e4bb47f790cc4..b3205adc718884513305c9bc597156c14f173fd3 100755 (executable)
@@ -23942,6 +23942,44 @@ _ACEOF
   ;;
 esac
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for line table is_stmt support" >&5
+$as_echo_n "checking assembler for line table is_stmt support... " >&6; }
+if test "${gcc_cv_as_is_stmt+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_as_is_stmt=no
+    if test $in_tree_gas = yes; then
+    if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 16 \) \* 1000 + 92`
+  then gcc_cv_as_is_stmt=yes
+fi
+  elif test x$gcc_cv_as != x; then
+    $as_echo ' .text
+       .file 1 "conf.c"
+       .loc 1 1 0 is_stmt 1' > conftest.s
+    if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+    then
+       gcc_cv_as_is_stmt=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_is_stmt" >&5
+$as_echo "$gcc_cv_as_is_stmt" >&6; }
+if test $gcc_cv_as_is_stmt = yes; then
+
+$as_echo "#define HAVE_GAS_LOC_STMT 1" >>confdefs.h
+
+fi
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for line table discriminator support" >&5
 $as_echo_n "checking assembler for line table discriminator support... " >&6; }
 if test "${gcc_cv_as_discriminator+set}" = set; then :
index fceab2f59a98a221df7e846ee7626d8c44651ef1..92cecbd763699d15a666f4933afed4fb3317cd06 100644 (file)
@@ -3146,6 +3146,15 @@ case "${target}" in
   ;;
 esac
 
+gcc_GAS_CHECK_FEATURE([line table is_stmt support],
+ gcc_cv_as_is_stmt,
+ [2,16,92],,
+[      .text
+       .file 1 "conf.c"
+       .loc 1 1 0 is_stmt 1],,
+[AC_DEFINE(HAVE_GAS_LOC_STMT, 1,
+  [Define if your assembler supports the .loc is_stmt sub-directive.])])
+
 gcc_GAS_CHECK_FEATURE([line table discriminator support],
  gcc_cv_as_discriminator,
  [2,19,51],,
index 48c50378622543554f074daef708eba7318c0835..55fcb7be4afa7cc861789d38408d8c741175f822 100644 (file)
@@ -27931,8 +27931,10 @@ dwarf2out_source_line (unsigned int line, unsigned int column,
 
       if (is_stmt != table->is_stmt)
        {
+#if HAVE_GAS_LOC_STMT
          fputs (" is_stmt ", asm_out_file);
          putc (is_stmt ? '1' : '0', asm_out_file);
+#endif
        }
       if (SUPPORTS_DISCRIMINATOR && discriminator != 0)
        {
This page took 0.157996 seconds and 5 git commands to generate.