re PR lto/41521 ([LTO] ICE verify_cgraph_node only with "-g")
authorRichard Guenther <rguenther@suse.de>
Wed, 14 Oct 2009 13:08:44 +0000 (13:08 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 14 Oct 2009 13:08:44 +0000 (13:08 +0000)
2009-10-14  Richard Guenther  <rguenther@suse.de>

PR lto/41521
* lto-streamer-in.c (input_bb): Replace debug stmts with
nops instead of dropping them.

* gfortran.dg/lto/pr41521_0.f90: New testcase.
* gfortran.dg/lto/pr41521_1.f90: Likewise.

From-SVN: r152767

gcc/ChangeLog
gcc/lto-streamer-in.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/lto/pr41521_0.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/lto/pr41521_1.f90 [new file with mode: 0644]

index 08ce63e..4e29f5f 100644 (file)
@@ -1,3 +1,9 @@
+2009-10-14  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/41521
+       * lto-streamer-in.c (input_bb): Replace debug stmts with
+       nops instead of dropping them.
+
 2009-10-14  Nick Clifton  <nickc@redhat.com>
 
        * gcc/doc/extended.texi: Replace the dash character with
index d9c207d..a899f9d 100644 (file)
@@ -1014,15 +1014,15 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag,
     {
       gimple stmt = input_gimple_stmt (ib, data_in, fn, tag);
 
-      /* Drop debug stmts on-the-fly if we do not have VTA enabled.
+      /* Change debug stmts to nops on-the-fly if we do not have VTA enabled.
         This allows us to build for example static libs with debugging
         enabled and do the final link without.  */
-      if (MAY_HAVE_DEBUG_STMTS
-         || !is_gimple_debug (stmt))
-       {
-         find_referenced_vars_in (stmt);
-         gsi_insert_after (&bsi, stmt, GSI_NEW_STMT);
-       }
+      if (!MAY_HAVE_DEBUG_STMTS
+         && is_gimple_debug (stmt))
+       stmt = gimple_build_nop ();
+
+      find_referenced_vars_in (stmt);
+      gsi_insert_after (&bsi, stmt, GSI_NEW_STMT);
 
       /* After the statement, expect a 0 delimiter or the EH region
         that the previous statement belongs to.  */
@@ -1033,8 +1033,7 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag,
        {
          HOST_WIDE_INT region = lto_input_sleb128 (ib);
          gcc_assert (region == (int) region);
-         if (MAY_HAVE_DEBUG_STMTS || !is_gimple_debug (stmt))
-           add_stmt_to_eh_lp (stmt, region);
+         add_stmt_to_eh_lp (stmt, region);
        }
 
       tag = input_record_start (ib);
index 3e8b069..f2b2d45 100644 (file)
@@ -1,3 +1,9 @@
+2009-10-14  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/41521
+       * gfortran.dg/lto/pr41521_0.f90: New testcase.
+       * gfortran.dg/lto/pr41521_1.f90: Likewise.
+
 2009-10-14  Jakub Jelinek  <jakub@redhat.com>
 
        PR preprocessor/41543
diff --git a/gcc/testsuite/gfortran.dg/lto/pr41521_0.f90 b/gcc/testsuite/gfortran.dg/lto/pr41521_0.f90
new file mode 100644 (file)
index 0000000..d882779
--- /dev/null
@@ -0,0 +1,9 @@
+! { dg-lto-do link }
+! { dg-lto-options {{-g -flto} {-g -O -flto}} }
+program species
+integer spk(2)
+real eval(2)
+spk = 2
+call atom(1.1,spk,eval)
+end program
+
diff --git a/gcc/testsuite/gfortran.dg/lto/pr41521_1.f90 b/gcc/testsuite/gfortran.dg/lto/pr41521_1.f90
new file mode 100644 (file)
index 0000000..897e7ad
--- /dev/null
@@ -0,0 +1,9 @@
+subroutine atom(sol,k,eval)
+real, intent(in) :: sol
+integer, intent(in) :: k(2)
+real, intent(out) :: eval(2)
+real t1
+  t1=sqrt(dble(k(1)**2)-(sol)**2)
+  eval(1)=sol**2/sqrt(t1)-sol**2
+end subroutine
+