]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/49615 (internal compiler error: verify_stmts failed / LHS...
authorRichard Guenther <rguenther@suse.de>
Mon, 4 Jul 2011 12:18:22 +0000 (12:18 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 4 Jul 2011 12:18:22 +0000 (12:18 +0000)
2011-07-04  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/49615
* tree-cfgcleanup.c (split_bbs_on_noreturn_calls): Fix
basic-block index check.

* g++.dg/torture/pr49615.C: New testcase.

From-SVN: r175805

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr49615.C [new file with mode: 0644]
gcc/tree-cfgcleanup.c

index 87407c20e382afcf89479b95d519c24decb5f9ab..4bd7435ec8f61a21348c30fbd253b03ff6ca23d7 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-04  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/49615
+       * tree-cfgcleanup.c (split_bbs_on_noreturn_calls): Fix
+       basic-block index check.
+
 2011-06-30  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR tree-optimization/49572
index 31c6639fe58063cacff50d5f5dc068ed206e606d..a88b2f23b770f5ae484564c10d6979ce3b080133 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-04  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/49615
+       * g++.dg/torture/pr49615.C: New testcase.
+
 2011-06-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        PR ada/49511
diff --git a/gcc/testsuite/g++.dg/torture/pr49615.C b/gcc/testsuite/g++.dg/torture/pr49615.C
new file mode 100644 (file)
index 0000000..98a2f95
--- /dev/null
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-g" } */
+
+template <class T>
+static inline bool Dispatch (T* obj, void (T::*func) ())
+{
+  (obj->*func) ();
+}
+class C
+{
+  bool f (int);
+  void g ();
+};
+bool C::f (int n)
+{
+  bool b;
+  switch (n)
+    {
+      case 0:
+         b = Dispatch (this, &C::g);
+      case 1:
+         b = Dispatch (this, &C::g);
+    }
+}
+void C::g ()
+{
+  for (;;) { }
+}
+
index db7fb000af8d6d56aad257db7961c9c7a67cfba6..da360e17443990d6f7fc2f5a4d42be369b59b9ff 100644 (file)
@@ -560,7 +560,7 @@ split_bbs_on_noreturn_calls (void)
           BB is present in the cfg.  */
        if (bb == NULL
            || bb->index < NUM_FIXED_BLOCKS
-           || bb->index >= n_basic_blocks
+           || bb->index >= last_basic_block
            || BASIC_BLOCK (bb->index) != bb
            || last_stmt (bb) == stmt
            || !gimple_call_noreturn_p (stmt))