diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr37285.c | 15 | ||||
-rw-r--r-- | gcc/tree-vrp.c | 7 |
4 files changed, 34 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8dd8eb5..d20066c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2008-10-01 Richard Guenther <rguenther@suse.de> + + PR middle-end/37285 + * tree-vrp.c (execute_vrp): If we optimized away the default + case make sure to promote the label that got in place of it + to a default case label. + 2008-10-01 Richard Henderson <rth@redhat.com> PR tree-opt/35737 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 755a970..16a233a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-10-01 Richard Guenther <rguenther@suse.de> + + PR middle-end/37285 + * gcc.c-torture/compile/pr37285.c: New testcase. + 2008-10-01 Kai Tietz <kai.tietz@onevision.com> * g++.dg/abi/offsetof.C (main): Use __SIZE_TYPE__ instead of diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37285.c b/gcc/testsuite/gcc.c-torture/compile/pr37285.c new file mode 100644 index 0000000..972478b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr37285.c @@ -0,0 +1,15 @@ +_bfd_xcoff_canonicalize_dynamic_reloc (unsigned long long l_symndx) +{ + if (l_symndx < 3) + { + switch (l_symndx) + { + case 0: + case 1: + break; + case 2: + _bfd_abort ("HI"); + } + } +} + diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 4f1c328..949b73c 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -7149,9 +7149,16 @@ execute_vrp (void) { size_t j; size_t n = TREE_VEC_LENGTH (su->vec); + tree label; gimple_switch_set_num_labels (su->stmt, n); for (j = 0; j < n; j++) gimple_switch_set_label (su->stmt, j, TREE_VEC_ELT (su->vec, j)); + /* As we may have replaced the default label with a regular one + make sure to make it a real default label again. This ensures + optimal expansion. */ + label = gimple_switch_default_label (su->stmt); + CASE_LOW (label) = NULL_TREE; + CASE_HIGH (label) = NULL_TREE; } if (VEC_length (edge, to_remove_edges) > 0) |