------- Comment #2 from kkojima at gcc dot gnu dot org  2007-05-10 00:45 -------
I've confirmed that the testcase fails with 4.1 and doesn't fail
with 4.0, 4.2 and 4.3.  It looks similar to fr30's PR target/21283.
Does the patch below work for you?

--- ORIG/gcc-4_1-branch/gcc/config/sh/sh.md     2006-06-22 12:53:20.000000000
+0900
+++ LOCAL/gcc-4_1-branch/gcc/config/sh/sh.md    2007-05-10 08:28:35.000000000
+0900
@@ -3018,7 +3020,9 @@ label:
   "
 {
   if (TARGET_SH1
-      && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 255)
+      && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 255
+      && (GET_CODE (operands[1]) != SUBREG
+         || SCALAR_INT_MODE_P (GET_MODE (XEXP (operands[1], 0)))))
     {
       emit_insn (gen_zero_extendqisi2 (operands[0],
                                       gen_lowpart (QImode, operands[1])));


-- 

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
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |4.1.2
      Known to work|                            |4.0.4 4.2.0 4.3.0
   Last reconfirmed|0000-00-00 00:00:00         |2007-05-10 00:45:28
               date|                            |


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

Reply via email to