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]

[3.1] PR c/6543 PowerPC ICE fix


	The following patch fixes the ICE in extract_insn on PowerPC
because of a mismatch between clobbers in splitters and define_insn
patterns.  There aren't any more "(plus:SI (eq:SI" patterns, so this
should be the last of it (:-).

	This patch has bootstrapped successfully without regressions for
both Franz and I and fixes the testcase.  I have applied the patch to
mainline.  Mark, is this okay for the 3.1 branch?

Thanks, David


        * config/rs6000/rs6000.md (sCC pattern and splitter): Remove
        clobber and use result as temporary value.

Index: rs6000.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.183
diff -c -p -r1.183 rs6000.md
*** rs6000.md	1 May 2002 15:33:23 -0000	1.183
--- rs6000.md	3 May 2002 17:26:59 -0000
***************
*** 10899,10921 ****
    "")
  
  (define_insn ""
!   [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
  	(compare:CC
  	 (plus:SI
  	  (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
  		 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I,r,O,K,L,I"))
  	  (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r,r,r,r,r,r"))
  	 (const_int 0)))
!    (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r")
! 	(plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
!    (clobber (match_scratch:SI 4 "=&r,&r,&r,&r,&r,&r,&r,&r,&r,&r"))]
    "! TARGET_POWERPC64"
    "@
!    xor %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
!    {sfi|subfic} %4,%1,0\;{aze.|addze.} %0,%3
!    {xoril|xori} %4,%1,%b2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
!    {xoriu|xoris} %4,%1,%u2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
!    {sfi|subfic} %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
     #
     #
     #
--- 11136,11157 ----
    "")
  
  (define_insn ""
!   [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
  	(compare:CC
  	 (plus:SI
  	  (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
  		 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I,r,O,K,L,I"))
  	  (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r,r,r,r,r,r"))
  	 (const_int 0)))
!    (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r,&r,&r,&r,&r,&r,&r,&r,&r")
! 	(plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
    "! TARGET_POWERPC64"
    "@
!    xor %0,%1,%2\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3
!    {sfi|subfic} %0,%1,0\;{aze.|addze.} %0,%3
!    {xoril|xori} %0,%1,%b2\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3
!    {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3
!    {sfi|subfic} %0,%1,%2\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3
     #
     #
     #
***************
*** 10925,10931 ****
     (set_attr "length" "12,8,12,12,12,16,12,16,16,16")])
  
  (define_split
!   [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
  	(compare:CC
  	 (plus:SI
  	  (eq:SI (match_operand:SI 1 "gpc_reg_operand" "")
--- 11161,11167 ----
     (set_attr "length" "12,8,12,12,12,16,12,16,16,16")])
  
  (define_split
!   [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
  	(compare:CC
  	 (plus:SI
  	  (eq:SI (match_operand:SI 1 "gpc_reg_operand" "")
***************
*** 10933,10945 ****
  	  (match_operand:SI 3 "gpc_reg_operand" ""))
  	 (const_int 0)))
     (set (match_operand:SI 0 "gpc_reg_operand" "")
! 	(plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
!    (clobber (match_scratch:SI 4 ""))]
    "! TARGET_POWERPC64 && reload_completed"
!   [(parallel [(set (match_dup 0)
  	(plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
!    (clobber (match_dup 4))])
!    (set (match_dup 5)
  	(compare:CC (match_dup 0)
  		    (const_int 0)))]
    "")
--- 11169,11179 ----
  	  (match_operand:SI 3 "gpc_reg_operand" ""))
  	 (const_int 0)))
     (set (match_operand:SI 0 "gpc_reg_operand" "")
! 	(plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
    "! TARGET_POWERPC64 && reload_completed"
!   [(set (match_dup 0)
  	(plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
!    (set (match_dup 4)
  	(compare:CC (match_dup 0)
  		    (const_int 0)))]
    "")


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