This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch committed] Fix an ICE for 930523-1.c on sh64

On sh64, gcc.c-torture/compile/930523-1.c ICEs for -O3 -funroll-loops
with the error

930523-1.c:54: error: unrecognizable insn:
(insn 138 137 139 2 930523-1.c:20 (set (reg:DI 5 r5 [227])
        (mult:DI (sign_extend:DI (reg:SI 1 r1 [196]))
            (sign_extend:DI (const_int 0 [0x0])))) -1 (nil))
930523-1.c:54: internal compiler error: in extract_insn, at recog.c:1990

It doesn't fail with 4.2 compiler.  The splitter of divsi_inv_m3
calls gen_mulsidi3_media with (const_int 0) as the 3rd argument
in the failing case.  The attached patch is to handle that case
specially.  It's tested with bootstrap on sh4-unknown-linux-gnu
and regtested on sh64-unknown-linux-gnu with no new failures.
Committed on trunk.

2007-11-22  Kaz Kojima  <>

	* config/sh/ (divsi_inv_m3): Handle zero dividend

diff -uprN ORIG/trunk/gcc/config/sh/ LOCAL/trunk/gcc/config/sh/
--- ORIG/trunk/gcc/config/sh/	2007-11-22 08:26:27.000000000 +0900
+++ LOCAL/trunk/gcc/config/sh/	2007-11-22 08:43:58.000000000 +0900
@@ -2471,6 +2471,12 @@ norm32: r25
   rtx scratch1 = operands[8];
   rtx scratch2 = operands[9];
+  if (satisfies_constraint_N (dividend))
+    {
+      emit_move_insn (result, dividend);
+      DONE;
+    }
   emit_insn (gen_mulsidi3_media (scratch0, inv1, dividend));
   emit_insn (gen_mulsidi3_media (scratch1, inv2, dividend));
   emit_insn (gen_ashrdi3_media (scratch2, scratch0, GEN_INT (63)));

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]