------- Comment #2 from kkojima at gcc dot gnu dot org  2007-07-03 00:21 -------
> Related to #21220?

Ah, maybe.
A reduced testcase:

unsigned int
foo (unsigned int n, unsigned d)
{
  return n % d;
}

which fails on sh64-unknown-linux-gnu with -O -fpic -m5-64media-nofpu.
I've confirmed that the reduced testcase fails on all 4.[0123] and
doesn't fail on 3.4.6.
udivsi3_i1_media insn uses the predicate target_operand which permits
symbol_ref.  When reloading, it's reloaded with a target register and,
in PIC case, legitimize_pic_address tries to use this target register
to compute the address with GOTOFF.  This results the ICE.
I'm testing the attached patch.

--- ORIG/trunk/gcc/config/sh/sh.md      Thu Jun 28 08:15:35 2007
+++ LOCAL/trunk/gcc/config/sh/sh.md     Mon Jul  2 21:44:49 2007
@@ -1765,7 +1765,7 @@
    (clobber (reg:DI TR0_REG))
    (clobber (reg:DI TR1_REG))
    (clobber (reg:DI TR2_REG))
-   (use (match_operand 1 "target_operand" "b"))]
+   (use (match_operand 1 "target_reg_operand" "b"))]
   "TARGET_SHMEDIA && (! TARGET_SHMEDIA_FPU || ! TARGET_DIVIDE_FP)"
   "blink       %1, r18"
   [(set_attr "type" "sfunc")
@@ -1962,7 +1962,7 @@
    (clobber (reg:SI R20_REG))
    (clobber (reg:SI R21_REG))
    (clobber (reg:SI TR0_REG))
-   (use (match_operand 1 "target_operand" "b"))]
+   (use (match_operand 1 "target_reg_operand" "b"))]
   "TARGET_SHMEDIA && (! TARGET_SHMEDIA_FPU || ! TARGET_DIVIDE_FP)"
   "blink       %1, r18"
   [(set_attr "type" "sfunc")])
@@ -1976,7 +1976,7 @@
    (clobber (reg:SI R21_REG))
    (clobber (reg:SI TR0_REG))
    (use (reg:SI R20_REG))
-   (use (match_operand 1 "target_operand" "b"))]
+   (use (match_operand 1 "target_reg_operand" "b"))]
   "TARGET_SHMEDIA && (! TARGET_SHMEDIA_FPU || ! TARGET_DIVIDE_FP)"
   "blink       %1, r18"
   [(set_attr "type" "sfunc")])


-- 

kkojima at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kkojima at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
 GCC target triplet|sh64-superh-linux-gnu-ld    |sh64-superh-linux-gnu
           Keywords|                            |ice-on-valid-code
      Known to fail|4.0.4                       |4.0.4 4.1.2 4.2.0 4.3.0
      Known to work|                            |3.4.6
   Last reconfirmed|0000-00-00 00:00:00         |2007-07-03 00:21:57
               date|                            |
            Summary|cross compile sh64-superh-  |[4.1/4.2/4.3 Regression]
                   |linux-gnu internal compiler |cross compile sh64-superh-
                   |error: in change_address_1, |linux-gnu internal compiler
                   |at emit-rtl.c:1800          |error: in change_address_1,
                   |                            |at emit-rtl.c:1800


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32506

Reply via email to