diff options
author | Richard Guenther <rguenther@suse.de> | 2011-07-04 12:06:17 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-07-04 12:06:17 +0000 |
commit | 30f1e6dea0609f34691ac032407347ed89df69c0 (patch) | |
tree | d8d848361db6b3296dd9c34a27afc087fb8ba008 | |
parent | 6dab9931f8f4b4366c3e1670902ace73e736ac4d (diff) | |
download | gcc-30f1e6dea0609f34691ac032407347ed89df69c0.zip gcc-30f1e6dea0609f34691ac032407347ed89df69c0.tar.gz gcc-30f1e6dea0609f34691ac032407347ed89df69c0.tar.bz2 |
re PR tree-optimization/49615 (internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member)
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
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/torture/pr49615.C | 29 | ||||
-rw-r--r-- | gcc/tree-cfgcleanup.c | 2 |
4 files changed, 41 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8c0dc9a..2ef91ce 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 326ba5f..70806e1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..98a2f95 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr49615.C @@ -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 (;;) { } +} + diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c index 1036e1e..0c8c085 100644 --- a/gcc/tree-cfgcleanup.c +++ b/gcc/tree-cfgcleanup.c @@ -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; |