re PR ipa/66793 (ICE at -Os and above on x86_64-linux-gnu (verify_flow_info failed))
authorRichard Biener <rguenther@suse.de>
Wed, 8 Jul 2015 11:54:28 +0000 (11:54 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 8 Jul 2015 11:54:28 +0000 (11:54 +0000)
2015-07-08  Richard Biener  <rguenther@suse.de>

PR tree-optimization/66793
* gimple-ssa-isolate-paths.c (insert_trap_and_remove_trailing_statemen):
Properly split the block after stmts ending it.

* gcc.dg/torture/pr66793.c: New testcase.

From-SVN: r225546

gcc/ChangeLog
gcc/gimple-ssa-isolate-paths.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr66793.c [new file with mode: 0644]

index d3858096dea4136a77326e4db83355c45c0885b6..421705dde5bdb3c6618a007953e48391a28258dc 100644 (file)
@@ -1,3 +1,9 @@
+2015-07-08  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/66793
+       * gimple-ssa-isolate-paths.c (insert_trap_and_remove_trailing_statemen):
+       Properly split the block after stmts ending it.
+
 2015-07-08  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/66794
index b437182be6dd7179138aada6a5a40aafa6904158..d43b5ac5abff2347f9c01deeb25ea54135f866d8 100644 (file)
@@ -103,7 +103,14 @@ insert_trap_and_remove_trailing_statements (gimple_stmt_iterator *si_p, tree op)
   if (walk_stmt_load_store_ops (stmt, (void *)op,
                                check_loadstore,
                                check_loadstore))
-    gsi_insert_after (si_p, seq, GSI_NEW_STMT);
+    {
+      gsi_insert_after (si_p, seq, GSI_NEW_STMT);
+      if (stmt_ends_bb_p (stmt))
+       {
+         split_block (gimple_bb (stmt), stmt);
+         return;
+       }
+    }
   else
     gsi_insert_before (si_p, seq, GSI_NEW_STMT);
 
index 7414562229f5a5a56ecb292351c3838d421d0bff..f389f54cb066ab7c0fb81a8625de4e3de64c6983 100644 (file)
@@ -1,3 +1,8 @@
+2015-07-08  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/66793
+       * gcc.dg/torture/pr66793.c: New testcase.
+
 2015-07-08  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/66794
diff --git a/gcc/testsuite/gcc.dg/torture/pr66793.c b/gcc/testsuite/gcc.dg/torture/pr66793.c
new file mode 100644 (file)
index 0000000..3c9d5a2
--- /dev/null
@@ -0,0 +1,26 @@
+/* { dg-do link } */
+
+int a, b, c; 
+
+struct S0
+{
+  int f1;
+} *d; 
+
+void
+fn1 (struct S0 p)
+{
+  for (p.f1 = 0; p.f1 < 1; p.f1++)
+    c = a && b ? a && b : 1; 
+  for (; c;)
+    ;
+}
+
+int
+main ()
+{
+  struct S0 **f = &d;
+  d = 0; 
+  fn1 (**f); 
+  return 0;
+}