From b72e46f0007c0fe09a47ffd8113b03636fa505fe Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 26 Aug 2004 13:03:02 +0000 Subject: [PATCH] re PR target/17119 ([m32r] ICE at switch case 0x8000) PR target/17119. config/m32r.c (gen_compare): Use reg_or_int16_operand when checking for a valid constant, regardless of sign. testsuite/gcc.c-torture/compile/pr17119.c: New test (for this failure) From-SVN: r86619 --- gcc/ChangeLog | 6 ++++++ gcc/config/m32r/m32r.c | 7 ++----- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.c-torture/compile/pr17119.c | 19 +++++++++++++++++++ 4 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr17119.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a91c1a8f116..e47b407a26b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-08-26 Kazuhiro Inaoka + + PR target/17119. + * config/m32r.c (gen_compare): Use reg_or_int16_operand when + checking for a valid constant, regardless of sign. + 2004-08-25 Richard Henderson PR target/16974 diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index ca4079f5ffa..9e3404a1891 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -1174,11 +1174,8 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare) y = force_reg (GET_MODE (x), y); else { - int ok_const = - (code == LTU || code == LEU || code == GTU || code == GEU) - ? uint16_operand (y, GET_MODE (y)) - : reg_or_cmp_int16_operand (y, GET_MODE (y)); - + int ok_const = reg_or_int16_operand (y, GET_MODE (y)); + if (! ok_const) y = force_reg (GET_MODE (x), y); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cfce6dada92..e6674bfe96c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-08-26 Nick Clifton + + * gcc.c-torture/compile/pr17119.c: New test. + 2004-08-26 Joseph S. Myers * gcc.dg/c90-typespec-1.c, gcc.dg/c99-typespec-1.c: New tests. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr17119.c b/gcc/testsuite/gcc.c-torture/compile/pr17119.c new file mode 100644 index 00000000000..28d6ccbe0b2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr17119.c @@ -0,0 +1,19 @@ +void +_mesa_DrawPixels (int width, int height, unsigned format, + unsigned type, const void * pixels) +{ + switch (format) + { + case 0x1900: + func1 (); + break; + case 0x1907: + case 0x80E0: + case 0x1908: + case 0x80E1: + case 0x8000: + func2 (); + break; + } +} + -- 2.30.2