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
This commit is contained in:
Geoffrey Keating 2001-11-09 23:04:01 +00:00 committed by Geoffrey Keating
parent a4311dfe6d
commit 4192f0d20d
4 changed files with 68 additions and 1 deletions

View File

@ -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.

View File

@ -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);

View File

@ -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.

View File

@ -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);
}