This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC PATCH] Fix middle-end/6963
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Richard Henderson <rth at redhat dot com>, Alan Modra <amodra at bigpond dot net dot au>
- Cc: Ulrich dot Weigand at de dot ibm dot com, Mark Mitchell <mark at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 28 Jun 2002 14:29:11 -0400
- Subject: Re: [RFC PATCH] Fix middle-end/6963
Would allocating the stack slot much earlier be correct? Even if
this is corect, it is troubling that we need to allocate a stack slot that
may never be used if the splitter is never invoked.
Thanks, David
* rs6000.md (ctrdi): Allocate stack slot in define_expand,
not splitter.
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 28 Jun 2002 18:24:46 -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,12886 ----
(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] = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
! }")
;; 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"
"*
{
--- 12946,12953 ----
(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"
"*
{
--- 12971,12978 ----
(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)"
"*
{
--- 13046,13053 ----
(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)"
"*
{
--- 13071,13078 ----
(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"
"*
{
--- 13146,13153 ----
(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"
"*
{
--- 13171,13178 ----
(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)
--- 13248,13261 ----
(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
--- 13264,13274 ----
(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)
--- 13276,13288 ----
(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
--- 13294,13304 ----
(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))
--- 13306,13324 ----
(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);
}")
--- 13326,13342 ----
(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);
}")