re PR target/31403 (wrong branch instructions generated with -m2a on sh-elf)
authorKaz Kojima <kkojima@gcc.gnu.org>
Thu, 26 Apr 2007 00:29:54 +0000 (00:29 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Thu, 26 Apr 2007 00:29:54 +0000 (00:29 +0000)
PR target/31403
* config/sh/sh.md (movsi_ie): Fix length for TARGET_SH2A.
(movsf_ie): Likewise.

From-SVN: r124171

gcc/ChangeLog
gcc/config/sh/sh.md

index d20eab519610ae9be4cf0f45de99802d64c84a77..6ccb3e3db318837d61d84d2f32affc526c859579 100644 (file)
@@ -1,3 +1,9 @@
+2007-04-25  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       PR target/31403
+       * config/sh/sh.md (movsi_ie): Fix length for TARGET_SH2A.
+       (movsf_ie): Likewise.
+
 2007-04-25  Paolo Carlini  <pcarlini@suse.de>
 
        * doc/extend.texi ([Type Traits]): Adjust per N2255.
index 455a23805df0eaa4a67d0d7147572733fe494d85..2c81792ee270ae860be9e07b038aa571d03d5210 100644 (file)
@@ -4970,7 +4970,36 @@ label:
        ! move optimized away"
   [(set_attr "type" "pcload_si,move,movi8,move,*,load_si,mac_gp,prget,arith,store,mac_mem,pstore,gp_mac,prset,mem_mac,pload,load,fstore,pcload_si,gp_fpul,fpul_gp,fmove,fmove,fmove,nil")
    (set_attr "late_fp_use" "*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,yes,*,*,yes,*,*,*,*")
-   (set_attr "length" "*,*,*,4,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,0")])
+   (set_attr_alternative "length"
+     [(const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 4)
+      (const_int 2)
+      (if_then_else
+       (ne (symbol_ref "TARGET_SH2A") (const_int 0))
+       (const_int 4) (const_int 2))
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (if_then_else
+       (ne (symbol_ref "TARGET_SH2A") (const_int 0))
+       (const_int 4) (const_int 2))
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 0)])])
 
 (define_insn "movsi_i_lowpart"
   [(set (strict_low_part (match_operand:SI 0 "general_movdst_operand" "+r,r,r,r,r,r,r,m,r"))
@@ -6573,6 +6602,30 @@ label:
   [(set_attr "type" "fmove,move,fmove,fmove,pcfload,fload,fstore,pcload,load,store,fmove,fmove,load,*,fpul_gp,gp_fpul,fstore,load,nil")
    (set_attr "late_fp_use" "*,*,*,*,*,*,yes,*,*,*,*,*,*,*,yes,*,yes,*,*")
    (set_attr "length" "*,*,*,*,4,2,2,*,*,*,2,2,2,4,2,2,2,2,0")
+   (set_attr_alternative "length"
+     [(const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 4)
+      (if_then_else
+       (ne (symbol_ref "TARGET_SH2A") (const_int 0))
+       (const_int 4) (const_int 2))
+      (if_then_else
+       (ne (symbol_ref "TARGET_SH2A") (const_int 0))
+       (const_int 4) (const_int 2))
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 4)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 2)
+      (const_int 0)])
    (set (attr "fp_mode") (if_then_else (eq_attr "fmovd" "yes")
                                           (const_string "single")
                                           (const_string "none")))])