diff options
author | Geoffrey Keating <geoffk@redhat.com> | 2001-11-09 23:04:01 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2001-11-09 23:04:01 +0000 |
commit | 4192f0d20d07cee7e68a5a6c7398f1044849855e (patch) | |
tree | dd025359a0252b395296620e265210b326009496 /gcc | |
parent | a4311dfe6d5ee5539793adb7bf12400b070ba9b1 (diff) | |
download | gcc-4192f0d20d07cee7e68a5a6c7398f1044849855e.zip gcc-4192f0d20d07cee7e68a5a6c7398f1044849855e.tar.gz gcc-4192f0d20d07cee7e68a5a6c7398f1044849855e.tar.bz2 |
stormy16.c (xstormy16_expand_casesi): Don't change INDEX.
* config/stormy16/stormy16.c (xstormy16_expand_casesi):
Don't change INDEX.
In testsuite/:
* gcc.c-torture/execute/20011109-1.c: New test.
From-SVN: r46899
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/stormy16/stormy16.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20011109-1.c | 58 |
4 files changed, 68 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c8c34d..1cd38c8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-11-09 Geoffrey Keating <geoffk@redhat.com> + + * config/stormy16/stormy16.c (xstormy16_expand_casesi): + Don't change INDEX. + Fri Nov 9 17:51:09 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * alias.c (nonoverlapping_memrefs_p): New function. diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c index 7883154..653ecaf 100644 --- a/gcc/config/stormy16/stormy16.c +++ b/gcc/config/stormy16/stormy16.c @@ -1621,7 +1621,7 @@ xstormy16_expand_casesi (index, lower_bound, range, table, default_label) sorry ("switch statement of size %lu entries too large", (unsigned long) range_i); - index = expand_binop (SImode, sub_optab, index, lower_bound, index, 0, + index = expand_binop (SImode, sub_optab, index, lower_bound, NULL_RTX, 0, OPTAB_LIB_WIDEN); emit_cmp_and_jump_insns (index, range, GTU, NULL_RTX, SImode, 1, 0, default_label); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6d9c0f0..1b598d7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-11-09 Geoffrey Keating <geoffk@redhat.com> + + * gcc.c-torture/execute/20011109-1.c: New test. + 2001-11-09 Jakub Jelinek <jakub@redhat.com> * gcc.c-torture/compile/20011109-1.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/20011109-1.c b/gcc/testsuite/gcc.c-torture/execute/20011109-1.c new file mode 100644 index 0000000..0f013d3 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20011109-1.c @@ -0,0 +1,58 @@ +void fail1(void) +{ + abort (); +} +void fail2(void) +{ + abort (); +} +void fail3(void) +{ + abort (); +} +void fail4(void) +{ + abort (); +} + + +void foo(long x) +{ + switch (x) + { + case -6: + fail1 (); break; + case 0: + fail2 (); break; + case 1: case 2: + break; + case 3: case 4: case 5: + fail3 (); + break; + default: + fail4 (); + break; + } + switch (x) + { + + case -3: + fail1 (); break; + case 0: case 4: + fail2 (); break; + case 1: case 3: + break; + case 2: case 8: + abort (); + break; + default: + fail4 (); + break; + } +} + +int main(void) +{ + foo (1); + exit (0); +} |