re PR tree-optimization/49615 (internal compiler error: verify_stmts failed / LHS...
authorRichard Guenther <rguenther@suse.de>
Mon, 4 Jul 2011 12:06:17 +0000 (12:06 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 4 Jul 2011 12:06:17 +0000 (12:06 +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: r175803

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

index 8c0dc9ac79c9ae63a5b619b43b5fb0d2dea4c80f..2ef91ce3047ccedde5f8ae76e8c8df5fb661785f 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-07-04  Georg-Johann Lay  <avr@gjlay.de>
 
        * longlong.h (count_leading_zeros, count_trailing_zeros,
index 326ba5f8770a6b4a3da56712cb8d02155a118549..70806e1acfa13c15561044e47a21c98dac545985 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-07-03  Ira Rosen  <ira.rosen@linaro.org>
 
        PR tree-optimization/49610
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 1036e1e98f3a36aa3795f1efa2fdf45b30e20315..0c8c0852024bc63c53fb379bf7d548e4752677e0 100644 (file)
@@ -599,7 +599,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
            || !gimple_call_noreturn_p (stmt))
          continue;