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



Andrew Pinski <pinskia at gcc dot gnu.org> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

             Status|UNCONFIRMED                 |NEW

   Last reconfirmed|                            |2011.03.24 00:29:19

               Host|x86_64-unknown-linux-gnu    |

     Ever Confirmed|0                           |1



--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-03-24 
00:29:19 UTC ---

I don't know if this is a bug in optabs or a target issue.



But what is happening is that since ior is an commutative, it checks if it can

swap the operands to allow them.  But it is not swapping the operands in the

end.  



The following patch to cris.md works and makes it more like most other targets:

Index: cris.md

===================================================================

--- cris.md    (revision 171367)

+++ cris.md    (working copy)

@@ -3022,14 +3022,14 @@ (define_insn "*andqi_lowpart_v32"



 (define_expand "ior<mode>3"

   [(set (match_operand:BWD 0 "register_operand")

-    (ior:BWD (match_operand:BWD 1 "register_operand")

+    (ior:BWD (match_operand:BWD 1 "nonimmediate_operand")

          (match_operand:BWD 2 "general_operand")))]

   ""

   "")



 (define_insn "*iorsi3_non_v32"

   [(set (match_operand:SI 0 "register_operand"           "=r,r,r, r,r,r")

-    (ior:SI (match_operand:SI 1 "register_operand" "%0,0,0, 0,0,r")

+    (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0, 0,0,r")

         (match_operand:SI 2 "general_operand"  "I, r,Q>,n,g,!To")))]

   "!TARGET_V32"

   "@

@@ -3044,7 +3044,7 @@ (define_insn "*iorsi3_non_v32"



 (define_insn "*iorsi3_v32"

   [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r")

-    (ior:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0")

+    (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0,0")

         (match_operand:SI 2 "general_operand" "I,r,Q>,n,g")))]

   "TARGET_V32"

   "@

@@ -3058,7 +3058,7 @@ (define_insn "*iorsi3_v32"



 (define_insn "*iorhi3_non_v32"

   [(set (match_operand:HI 0 "register_operand"           "=r,r,r, r,r,r,r")

-    (ior:HI (match_operand:HI 1 "register_operand" "%0,0,0, 0,0,0,r")

+    (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0, 0,0,0,r")

         (match_operand:HI 2 "general_operand"   "I,r,Q>,L,O,g,!To")))]

   "!TARGET_V32"

   "@

@@ -3074,7 +3074,7 @@ (define_insn "*iorhi3_non_v32"



 (define_insn "*iorhi3_v32"

   [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r")

-    (ior:HI (match_operand:HI 1 "register_operand" "%0,0,0,0,0,0")

+    (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0,0,0,0")

         (match_operand:HI 2 "general_operand" "I,r,Q>,L,O,g")))]

   "TARGET_V32"

   "@

@@ -3089,7 +3089,7 @@ (define_insn "*iorhi3_v32"



 (define_insn "*iorqi3_non_v32"

   [(set (match_operand:QI 0 "register_operand"           "=r,r,r, r,r,r")

-    (ior:QI (match_operand:QI 1 "register_operand" "%0,0,0, 0,0,r")

+    (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0, 0,0,r")

         (match_operand:QI 2 "general_operand"   "I,r,Q>,O,g,!To")))]

   "!TARGET_V32"

   "@

@@ -3104,7 +3104,7 @@ (define_insn "*iorqi3_non_v32"



 (define_insn "*iorqi3_v32"

   [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r")

-    (ior:QI (match_operand:QI 1 "register_operand" "%0,0,0,0,0")

+    (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,0,0")

         (match_operand:QI 2 "general_operand" "I,r,Q>,O,g")))]

   "TARGET_V32"

   "@



---- CUT ----

Please note I am not recommending this patch as the final patch but rather a

starting point to figure out what is going wrong.



Confirmed.

Reply via email to