public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [SH] PR 56121 - fix libgcc build for SH2A
@ 2013-01-28 20:32 Oleg Endo
  2013-01-28 22:58 ` Kaz Kojima
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Endo @ 2013-01-28 20:32 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 637 bytes --]

Hi,

This is the same patch that I attached in the PR.
It fixes an ICE when building libgcc for the SH2A target.
Tested on rev. 195493 with
make -k check RUNTESTFLAGS="--target_board=sh-sim
\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"

... comparing the test results against rev 193342 shows a few new
failures, but they seem unrelated to this case.

OK for trunk?

Cheers,
Oleg

gcc/ChangeLog:

	PR target/56121
	* config/sh/sh.md (bclr_m2a, bset_m2a, bst_m2a, bld_m2a, 
	bldsign_m2a, bld_reg, *bld_regqi, band_m2a, bandreg_m2a, 
	bor_m2a, borreg_m2a, bxor_m2a, bxorreg_m2a): Add 
	satisfies_constraint_K03 condition.

[-- Attachment #2: sh_pr56121.patch --]
[-- Type: text/x-patch, Size: 4386 bytes --]

Index: gcc/config/sh/sh.md
===================================================================
--- gcc/config/sh/sh.md	(revision 195493)
+++ gcc/config/sh/sh.md	(working copy)
@@ -13140,6 +13140,8 @@
 })
 
 ;; SH2A instructions for bitwise operations.
+;; FIXME: Convert multiple instruction insns to insn_and_split.
+;; FIXME: Use iterators to fold at least and,xor,or insn variations.
 
 ;; Clear a bit in a memory location.
 (define_insn "bclr_m2a"
@@ -13148,7 +13150,7 @@
 	    (not:QI (ashift:QI (const_int 1)
 			(match_operand:QI 1 "const_int_operand" "K03,K03")))
 	    (match_dup 0)))]
-  "TARGET_SH2A && TARGET_BITOPS"
+  "TARGET_SH2A && TARGET_BITOPS && satisfies_constraint_K03 (operands[1])"
   "@
 	bclr.b	%1,%0
 	bclr.b	%1,@(0,%t0)"
@@ -13171,7 +13173,7 @@
 	    (ashift:QI (const_int 1)
 		       (match_operand:QI 1 "const_int_operand" "K03,K03"))
 	    (match_dup 0)))]
-  "TARGET_SH2A && TARGET_BITOPS"
+  "TARGET_SH2A && TARGET_BITOPS && satisfies_constraint_K03 (operands[1])"
   "@
 	bset.b	%1,%0
 	bset.b	%1,@(0,%t0)"
@@ -13198,7 +13200,7 @@
 	    (ior:QI
 		(ashift:QI (const_int 1) (match_dup 1))
 		(match_dup 0))))]
-  "TARGET_SH2A && TARGET_BITOPS"
+  "TARGET_SH2A && TARGET_BITOPS && satisfies_constraint_K03 (operands[1])"
   "@
 	bst.b	%1,%0
 	bst.b	%1,@(0,%t0)"
@@ -13211,7 +13213,7 @@
 	    (match_operand:QI 0 "bitwise_memory_operand" "Sbw,Sbv")
 	    (const_int 1)
 	    (match_operand 1 "const_int_operand" "K03,K03")))]
-  "TARGET_SH2A && TARGET_BITOPS"
+  "TARGET_SH2A && TARGET_BITOPS && satisfies_constraint_K03 (operands[1])"
   "@
 	bld.b	%1,%0
 	bld.b	%1,@(0,%t0)"
@@ -13224,7 +13226,7 @@
 	    (match_operand:QI 0 "bitwise_memory_operand" "Sbw,m")
 	    (const_int 1)
 	    (match_operand 1 "const_int_operand" "K03,K03")))]
-  "TARGET_SH2A && TARGET_BITOPS"
+  "TARGET_SH2A && TARGET_BITOPS && satisfies_constraint_K03 (operands[1])"
   "@
 	bld.b	%1,%0
 	bld.b	%1,@(0,%t0)"
@@ -13236,7 +13238,7 @@
 	(zero_extract:SI (match_operand:SI 0 "arith_reg_operand" "r")
 			 (const_int 1)
 			 (match_operand 1 "const_int_operand" "K03")))]
-  "TARGET_SH2A"
+  "TARGET_SH2A && satisfies_constraint_K03 (operands[1])"
   "bld	%1,%0")
 
 (define_insn "*bld_regqi"
@@ -13244,7 +13246,7 @@
 	(zero_extract:SI (match_operand:QI 0 "arith_reg_operand" "r")
 			 (const_int 1)
 			 (match_operand 1 "const_int_operand" "K03")))]
-  "TARGET_SH2A"
+  "TARGET_SH2A && satisfies_constraint_K03 (operands[1])"
   "bld	%1,%0")
 
 ;; Take logical and of a specified bit of memory with the T bit and
@@ -13256,7 +13258,7 @@
 		    (match_operand:QI 0 "bitwise_memory_operand" "Sbw,m")
 		    (const_int 1)
 		    (match_operand 1 "const_int_operand" "K03,K03"))))]
-  "TARGET_SH2A && TARGET_BITOPS"
+  "TARGET_SH2A && TARGET_BITOPS && satisfies_constraint_K03 (operands[1])"
   "@
 	band.b	%1,%0
 	band.b	%1,@(0,%t0)"
@@ -13269,7 +13271,7 @@
 		    (const_int 1)
 		    (match_operand 2 "const_int_operand" "K03,K03"))
         	(match_operand:SI 3 "register_operand" "r,r")))]
-  "TARGET_SH2A && TARGET_BITOPS"
+  "TARGET_SH2A && TARGET_BITOPS && satisfies_constraint_K03 (operands[2])"
 {
   static const char* alt[] =
   {
@@ -13292,7 +13294,7 @@
 		    (match_operand:QI 0 "bitwise_memory_operand" "Sbw,m")
 		    (const_int 1)
 		    (match_operand 1 "const_int_operand" "K03,K03"))))]
-  "TARGET_SH2A && TARGET_BITOPS"
+  "TARGET_SH2A && TARGET_BITOPS && satisfies_constraint_K03 (operands[1])"
   "@
 	bor.b	%1,%0
 	bor.b	%1,@(0,%t0)"
@@ -13305,7 +13307,7 @@
 		    (const_int 1)
 		    (match_operand 2 "const_int_operand" "K03,K03"))
 		(match_operand:SI 3 "register_operand" "=r,r")))]
-  "TARGET_SH2A && TARGET_BITOPS"
+  "TARGET_SH2A && TARGET_BITOPS && satisfies_constraint_K03 (operands[2])"
 {
   static const char* alt[] =
   {
@@ -13328,7 +13330,7 @@
 		    (match_operand:QI 0 "bitwise_memory_operand" "Sbw,m")
 		    (const_int 1)
 		    (match_operand 1 "const_int_operand" "K03,K03"))))]
-  "TARGET_SH2A && TARGET_BITOPS"
+  "TARGET_SH2A && TARGET_BITOPS && satisfies_constraint_K03 (operands[1])"
   "@
 	bxor.b	%1,%0
 	bxor.b	%1,@(0,%t0)"
@@ -13341,7 +13343,7 @@
 		    (const_int 1)
 		    (match_operand 2 "const_int_operand" "K03,K03"))
 		(match_operand:SI 3 "register_operand" "=r,r")))]
-  "TARGET_SH2A && TARGET_BITOPS"
+  "TARGET_SH2A && TARGET_BITOPS && satisfies_constraint_K03 (operands[2])"
 {
   static const char* alt[] =
   {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [SH] PR 56121 - fix libgcc build for SH2A
  2013-01-28 20:32 [SH] PR 56121 - fix libgcc build for SH2A Oleg Endo
@ 2013-01-28 22:58 ` Kaz Kojima
  0 siblings, 0 replies; 2+ messages in thread
From: Kaz Kojima @ 2013-01-28 22:58 UTC (permalink / raw)
  To: oleg.endo; +Cc: gcc-patches

Oleg Endo <oleg.endo@t-online.de> wrote:
> This is the same patch that I attached in the PR.
> It fixes an ICE when building libgcc for the SH2A target.
> Tested on rev. 195493 with
> make -k check RUNTESTFLAGS="--target_board=sh-sim
> \{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"
> 
> ... comparing the test results against rev 193342 shows a few new
> failures, but they seem unrelated to this case.
> 
> OK for trunk?

OK.

Regards,
	kaz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-28 22:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-28 20:32 [SH] PR 56121 - fix libgcc build for SH2A Oleg Endo
2013-01-28 22:58 ` Kaz Kojima

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).