re PR target/17119 ([m32r] ICE at switch case 0x8000)
authorNick Clifton <nickc@gcc.gnu.org>
Thu, 26 Aug 2004 13:03:02 +0000 (13:03 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Thu, 26 Aug 2004 13:03:02 +0000 (13:03 +0000)
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
gcc/config/m32r/m32r.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr17119.c [new file with mode: 0644]

index a91c1a8f116d2d534da859721bd86c3bb1dc9696..e47b407a26b2a9440703f2c65d2529959dab67cd 100644 (file)
@@ -1,3 +1,9 @@
+2004-08-26  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
+
+       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  <rth@redhat.com>
 
         PR target/16974
index ca4079f5ffadb75864404463a5575ab3b8bcf297..9e3404a18916aeacc04c3ea050b0a229fd4701f4 100644 (file)
@@ -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);
        }
index cfce6dada92abd8e47a62676815981a631d35607..e6674bfe96cb2ccae0598cb7a752f78320a30e7b 100644 (file)
@@ -1,3 +1,7 @@
+2004-08-26  Nick Clifton  <nickc@redhat.com>
+
+       * gcc.c-torture/compile/pr17119.c: New test.
+
 2004-08-26  Joseph S. Myers  <jsm@polyomino.org.uk>
 
        * 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 (file)
index 0000000..28d6ccb
--- /dev/null
@@ -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;
+    }
+}
+