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]

Re: [RFC PATCH] Fix middle-end/6963


	My previous patch used X when the stack temp wasn't needed, so
that's identical.  I change assign_stack_temp() to gen_reg_rtx() without
changing any of the predicates, and the testcase worked.  I looked at
recog.c:memory_operand() as well and wasn't sure why it should work.

	I can change the memory_operand() and offsettable_mem_operand()
predicates to nonimmediate_operand().

	The last time we tried to optimize stack slot usage in the PowerPC
port for the FP conversion routine, it was a disaster, so I don't think
it's worth trying to reuse the slot.  I also thought that stack
temporaries were able to be re-used now.

	Anyway, appended is the patch I tried with gen_rtx_reg() and *NO*
predicate changes, if you can see any reason it should have worked.  I
didn't think that constraints were suppose to affect whether predicates
were tested.  I'll change the predicates anyway and give it a full
bootstrap test overnight.

Thanks, David

Index: rs6000.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.190
diff -c -p -r1.190 rs6000.md
*** rs6000.md	9 Jun 2002 15:05:09 -0000	1.190
--- rs6000.md	29 Jun 2002 01:32:56 -0000
***************
*** 13333,13341 ****
  		   (plus:DI (match_dup 0)
  			    (const_int -1)))
  	      (clobber (match_scratch:CC 2 ""))
! 	      (clobber (match_scratch:DI 3 ""))])]
    "TARGET_POWERPC64"
!   "")
  
  ;; We need to be able to do this for any operand, including MEM, or we
  ;; will cause reload to blow up since we don't allow output reloads on
--- 12874,12884 ----
  		   (plus:DI (match_dup 0)
  			    (const_int -1)))
  	      (clobber (match_scratch:CC 2 ""))
! 	      (clobber (match_scratch:DI 3 ""))
! 	      (clobber (match_dup 4))])]
    "TARGET_POWERPC64"
!   "
! { operands[4] = gen_reg_rtx (DImode); }")
  
  ;; We need to be able to do this for any operand, including MEM, or we
  ;; will cause reload to blow up since we don't allow output reloads on
***************
*** 13401,13407 ****
  	(plus:DI (match_dup 1)
  		 (const_int -1)))
     (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
!    (clobber (match_scratch:DI 4 "=X,X,r,r"))]
    "TARGET_POWERPC64"
    "*
  {
--- 12944,12951 ----
  	(plus:DI (match_dup 1)
  		 (const_int -1)))
     (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
!    (clobber (match_scratch:DI 4 "=X,X,r,r"))
!    (clobber (match_operand:DI 5 "memory_operand" "=X,X,X,o"))]
    "TARGET_POWERPC64"
    "*
  {
***************
*** 13425,13431 ****
  	(plus:DI (match_dup 1)
  		 (const_int -1)))
     (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
!    (clobber (match_scratch:DI 4 "=X,X,r,r"))]
    "TARGET_POWERPC64"
    "*
  {
--- 12969,12976 ----
  	(plus:DI (match_dup 1)
  		 (const_int -1)))
     (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
!    (clobber (match_scratch:DI 4 "=X,X,r,r"))
!    (clobber (match_operand:DI 5 "memory_operand" "=X,X,X,o"))]
    "TARGET_POWERPC64"
    "*
  {
***************
*** 13499,13505 ****
  	(plus:DI (match_dup 1)
  		 (const_int -1)))
     (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
!    (clobber (match_scratch:DI 4 "=X,X,r,r"))]
    "TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
    "*
  {
--- 13044,13051 ----
  	(plus:DI (match_dup 1)
  		 (const_int -1)))
     (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
!    (clobber (match_scratch:DI 4 "=X,X,r,r"))
!    (clobber (match_operand:DI 5 "memory_operand" "=X,X,X,o"))]
    "TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
    "*
  {
***************
*** 13523,13529 ****
  	(plus:DI (match_dup 1)
  		 (const_int -1)))
     (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
!    (clobber (match_scratch:DI 4 "=X,X,r,r"))]
    "TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
    "*
  {
--- 13069,13076 ----
  	(plus:DI (match_dup 1)
  		 (const_int -1)))
     (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
!    (clobber (match_scratch:DI 4 "=X,X,r,r"))
!    (clobber (match_operand:DI 5 "memory_operand" "=X,X,X,o"))]
    "TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
    "*
  {
***************
*** 13597,13603 ****
  	(plus:DI (match_dup 1)
  		 (const_int -1)))
     (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
!    (clobber (match_scratch:DI 4 "=X,X,r,r"))]
    "TARGET_POWERPC64"
    "*
  {
--- 13144,13151 ----
  	(plus:DI (match_dup 1)
  		 (const_int -1)))
     (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
!    (clobber (match_scratch:DI 4 "=X,X,r,r"))
!    (clobber (match_operand:DI 5 "memory_operand" "=X,X,X,o"))]
    "TARGET_POWERPC64"
    "*
  {
***************
*** 13621,13627 ****
  	(plus:DI (match_dup 1)
  		 (const_int -1)))
     (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
!    (clobber (match_scratch:DI 4 "=X,X,r,r"))]
    "TARGET_POWERPC64"
    "*
  {
--- 13169,13176 ----
  	(plus:DI (match_dup 1)
  		 (const_int -1)))
     (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
!    (clobber (match_scratch:DI 4 "=X,X,r,r"))
!    (clobber (match_operand:DI 5 "memory_operand" "=X,X,X,o"))]
    "TARGET_POWERPC64"
    "*
  {
***************
*** 13697,13709 ****
  	(if_then_else (match_operator 2 "comparison_operator"
  				      [(match_operand:DI 1 "gpc_reg_operand" "")
  				       (const_int 1)])
! 		      (match_operand 5 "" "")
! 		      (match_operand 6 "" "")))
     (set (match_operand:DI 0 "gpc_reg_operand" "")
  	(plus:DI (match_dup 1)
  		 (const_int -1)))
     (clobber (match_scratch:CC 3 ""))
!    (clobber (match_scratch:DI 4 ""))]
    "TARGET_POWERPC64 && reload_completed && INT_REGNO_P (REGNO (operands[0]))"
    [(parallel [(set (match_dup 3)
  		   (compare:CC (plus:DI (match_dup 1)
--- 13246,13259 ----
  	(if_then_else (match_operator 2 "comparison_operator"
  				      [(match_operand:DI 1 "gpc_reg_operand" "")
  				       (const_int 1)])
! 		      (match_operand 6 "" "")
! 		      (match_operand 7 "" "")))
     (set (match_operand:DI 0 "gpc_reg_operand" "")
  	(plus:DI (match_dup 1)
  		 (const_int -1)))
     (clobber (match_scratch:CC 3 ""))
!    (clobber (match_scratch:DI 4 ""))
!    (clobber (match_operand:DI 5 "offsettable_mem_operand" ""))]
    "TARGET_POWERPC64 && reload_completed && INT_REGNO_P (REGNO (operands[0]))"
    [(parallel [(set (match_dup 3)
  		   (compare:CC (plus:DI (match_dup 1)
***************
*** 13712,13722 ****
  	      (set (match_dup 0)
  		   (plus:DI (match_dup 1)
  			    (const_int -1)))])
!    (set (pc) (if_then_else (match_dup 7)
! 			   (match_dup 5)
! 			   (match_dup 6)))]
    "
! { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
  			 const0_rtx); }")
  
  (define_split
--- 13262,13272 ----
  	      (set (match_dup 0)
  		   (plus:DI (match_dup 1)
  			    (const_int -1)))])
!    (set (pc) (if_then_else (match_dup 8)
! 			   (match_dup 6)
! 			   (match_dup 7)))]
    "
! { operands[8] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
  			 const0_rtx); }")
  
  (define_split
***************
*** 13724,13735 ****
  	(if_then_else (match_operator 2 "comparison_operator"
  				      [(match_operand:DI 1 "gpc_reg_operand" "")
  				       (const_int 1)])
! 		      (match_operand 5 "" "")
! 		      (match_operand 6 "" "")))
     (set (match_operand:DI 0 "nonimmediate_operand" "")
  	(plus:DI (match_dup 1) (const_int -1)))
     (clobber (match_scratch:CC 3 ""))
!    (clobber (match_scratch:DI 4 ""))]
    "TARGET_POWERPC64 && reload_completed
     && ! gpc_reg_operand (operands[0], DImode)"
    [(parallel [(set (match_dup 3)
--- 13274,13286 ----
  	(if_then_else (match_operator 2 "comparison_operator"
  				      [(match_operand:DI 1 "gpc_reg_operand" "")
  				       (const_int 1)])
! 		      (match_operand 6 "" "")
! 		      (match_operand 7 "" "")))
     (set (match_operand:DI 0 "nonimmediate_operand" "")
  	(plus:DI (match_dup 1) (const_int -1)))
     (clobber (match_scratch:CC 3 ""))
!    (clobber (match_scratch:DI 4 ""))
!    (clobber (match_operand:DI 5 "offsettable_mem_operand" ""))]
    "TARGET_POWERPC64 && reload_completed
     && ! gpc_reg_operand (operands[0], DImode)"
    [(parallel [(set (match_dup 3)
***************
*** 13741,13751 ****
  			    (const_int -1)))])
     (set (match_dup 0)
  	(match_dup 4))
!    (set (pc) (if_then_else (match_dup 7)
! 			   (match_dup 5)
! 			   (match_dup 6)))]
    "
! { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
  			 const0_rtx); }")
  
  (define_split
--- 13292,13302 ----
  			    (const_int -1)))])
     (set (match_dup 0)
  	(match_dup 4))
!    (set (pc) (if_then_else (match_dup 8)
! 			   (match_dup 6)
! 			   (match_dup 7)))]
    "
! { operands[8] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
  			 const0_rtx); }")
  
  (define_split
***************
*** 13753,13770 ****
         (if_then_else (match_operator 2 "comparison_operator"
  				     [(match_operand:DI 1 "gpc_reg_operand" "")
  				      (const_int 1)])
! 		     (match_operand 5 "" "")
! 		     (match_operand 6 "" "")))
     (set (match_operand:DI 0 "gpc_reg_operand" "")
         (plus:DI (match_dup 1)
  		(const_int -1)))
     (clobber (match_scratch:CC 3 ""))
!    (clobber (match_scratch:DI 4 ""))]
    "TARGET_POWERPC64 && reload_completed && FP_REGNO_P (REGNO (operands[0]))"
!   [(set (match_dup 8)
  	(match_dup 1))
     (set (match_dup 4)
! 	(match_dup 8))
     (parallel [(set (match_dup 3)
  		   (compare:CC (plus:DI (match_dup 4)
  					(const_int -1))
--- 13304,13322 ----
         (if_then_else (match_operator 2 "comparison_operator"
  				     [(match_operand:DI 1 "gpc_reg_operand" "")
  				      (const_int 1)])
! 		     (match_operand 6 "" "")
! 		     (match_operand 7 "" "")))
     (set (match_operand:DI 0 "gpc_reg_operand" "")
         (plus:DI (match_dup 1)
  		(const_int -1)))
     (clobber (match_scratch:CC 3 ""))
!    (clobber (match_scratch:DI 4 ""))
!    (clobber (match_operand:DI 5 "offsettable_mem_operand" ""))]
    "TARGET_POWERPC64 && reload_completed && FP_REGNO_P (REGNO (operands[0]))"
!   [(set (match_dup 5)
  	(match_dup 1))
     (set (match_dup 4)
! 	(match_dup 5))
     (parallel [(set (match_dup 3)
  		   (compare:CC (plus:DI (match_dup 4)
  					(const_int -1))
***************
*** 13772,13789 ****
  	      (set (match_dup 4)
  		   (plus:DI (match_dup 4)
  			    (const_int -1)))])
!    (set (match_dup 8)
  	(match_dup 4))
     (set (match_dup 0)
! 	(match_dup 8))
!    (set (pc) (if_then_else (match_dup 7)
! 			   (match_dup 5)
! 			   (match_dup 6)))]
    "
  {
!   operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
  			 const0_rtx);
-   operands[8] = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
  }")
  
  
--- 13324,13340 ----
  	      (set (match_dup 4)
  		   (plus:DI (match_dup 4)
  			    (const_int -1)))])
!    (set (match_dup 5)
  	(match_dup 4))
     (set (match_dup 0)
! 	(match_dup 5))
!    (set (pc) (if_then_else (match_dup 8)
! 			   (match_dup 6)
! 			   (match_dup 7)))]
    "
  {
!   operands[8] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
  			 const0_rtx);
  }")
  
  



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