This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Fix PR 24620


Hello,

this patch fixes an ICE caused by the new insv patterns.  Using a
const_int_operand predicate together with a constrain that accepts
only a subset of integers doesn't work ...

Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux,
committed to mainline.

Bye,
Ulrich


ChangeLog:

	PR target/24620
	* config/s390/s390.md ("*insv<mode>_reg_imm"): Accept any CONST_INT
	as operand 2.
	("*insv<mode>_reg_extimm"): Likewise.

testsuite/ChangeLog:

	PR target/24620
	* gcc.dg/pr24620.c: New test.
	

Index: gcc/testsuite/gcc.dg/pr24620.c
===================================================================
*** gcc/testsuite/gcc.dg/pr24620.c	(revision 0)
--- gcc/testsuite/gcc.dg/pr24620.c	(revision 0)
***************
*** 0 ****
--- 1,27 ----
+ /* This used to ICE due to a backend problem on s390.  */
+ 
+ /* { dg-do compile } */
+ /* { dg-options "-O2" } */
+ 
+ struct rgba
+ {
+   unsigned char r;
+   unsigned char g;
+   unsigned char b;
+   unsigned char a;
+ };
+ 
+ void g (struct rgba);
+ 
+ void f (void) 
+ {
+   struct rgba x;
+ 
+   x.r = 0;
+   x.g = 128;
+   x.b = 128;
+   x.a = 26;
+ 
+   g (x);
+ }
+ 
Index: gcc/config/s390/s390.md
===================================================================
*** gcc/config/s390/s390.md	(revision 106419)
--- gcc/config/s390/s390.md	(working copy)
***************
*** 2598,2604 ****
    [(set (zero_extract:P (match_operand:P 0 "register_operand" "+d")
  			(const_int 16)
  			(match_operand 1 "const_int_operand" "n"))
! 	(match_operand:P 2 "const_int_operand" "K"))]
    "TARGET_ZARCH
     && INTVAL (operands[1]) >= 0
     && INTVAL (operands[1]) < BITS_PER_WORD
--- 2598,2604 ----
    [(set (zero_extract:P (match_operand:P 0 "register_operand" "+d")
  			(const_int 16)
  			(match_operand 1 "const_int_operand" "n"))
! 	(match_operand 2 "const_int_operand" "n"))]
    "TARGET_ZARCH
     && INTVAL (operands[1]) >= 0
     && INTVAL (operands[1]) < BITS_PER_WORD
***************
*** 2619,2625 ****
    [(set (zero_extract:P (match_operand:P 0 "register_operand" "+d")
  			(const_int 32)
  			(match_operand 1 "const_int_operand" "n"))
! 	(match_operand:P 2 "const_int_operand" "Os"))]
    "TARGET_EXTIMM
     && INTVAL (operands[1]) >= 0
     && INTVAL (operands[1]) < BITS_PER_WORD
--- 2619,2625 ----
    [(set (zero_extract:P (match_operand:P 0 "register_operand" "+d")
  			(const_int 32)
  			(match_operand 1 "const_int_operand" "n"))
! 	(match_operand 2 "const_int_operand" "n"))]
    "TARGET_EXTIMM
     && INTVAL (operands[1]) >= 0
     && INTVAL (operands[1]) < BITS_PER_WORD
-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]