[committed] Fix overall constraint for several PA deposit patterns

John David Anglin dave@hiauly1.hia.nrc.ca
Tue Mar 13 23:53:00 GMT 2007


The enclosed change fixes the target related issues associated with
PR target/31123.  The PA-RISC deposit instructions don't allow zero
length deposits.  If a deposit instruction is output with a zero
length, an assembler error occurs.  This patch prevents output of
deposit instructions in three patterns where this might occur.

The patch has been tested with no regressions on hppa-unknown-linux-gnu,
hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.

Committed to trunk and 4.1.

Mark, I would like to commit to 4.2.  Is this ok?  I don't know the
history of this code but believe this to be a regression.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2007-03-13  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	PR target/31123
	* pa.md (vdepi_ior): Don't allow zero length deposit.  Likewise for
	two unamed patterns.
	
Index: config/pa/pa.md
===================================================================
--- config/pa/pa.md	(revision 122776)
+++ config/pa/pa.md	(working copy)
@@ -6974,7 +6974,7 @@
 				     (match_operand:SI 2 "register_operand" "q")))
 		(match_operand:SI 3 "register_operand" "0")))]
   ; accept ...0001...1, can this be generalized?
-  "exact_log2 (INTVAL (operands[1]) + 1) >= 0"
+  "exact_log2 (INTVAL (operands[1]) + 1) > 0"
   "*
 {
   int x = INTVAL (operands[1]);
@@ -7073,7 +7073,7 @@
 				     (match_operand:DI 2 "register_operand" "q")))
 		(match_operand:DI 3 "register_operand" "0")))]
   ; accept ...0001...1, can this be generalized?
-  "TARGET_64BIT && exact_log2 (INTVAL (operands[1]) + 1) >= 0"
+  "TARGET_64BIT && exact_log2 (INTVAL (operands[1]) + 1) > 0"
   "*
 {
   int x = INTVAL (operands[1]);
@@ -7269,7 +7269,7 @@
 	(and:SI (ashift:SI (match_operand:SI 1 "register_operand" "r")
 			   (match_operand:SI 2 "const_int_operand" ""))
 		(match_operand:SI 3 "const_int_operand" "")))]
-  "exact_log2 (1 + (INTVAL (operands[3]) >> (INTVAL (operands[2]) & 31))) >= 0"
+  "exact_log2 (1 + (INTVAL (operands[3]) >> (INTVAL (operands[2]) & 31))) > 0"
   "*
 {
   int cnt = INTVAL (operands[2]) & 31;



More information about the Gcc-patches mailing list