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]

Re: bug in combine_stack_adjustments


On Fri, Mar 17, 2000 at 10:45:31PM +0000, Joern Rennecke wrote:
> I think this is a problem of single_set, and it should be fixed be
> testing anything that is neither set nor clobber for side_effects_p.

I quite agree.  Here's my fix.

> Presumably this didn't come up before because ther were no patterns that
> paired void calls with sets.

No, call_pop has been there for some time.  Dunno why it
never triggered.


r~


        * rtlanal.c (single_set): Reject if the parallel has anything
        except SET or USE or CLOBBER.

Index: rtlanal.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/rtlanal.c,v
retrieving revision 1.54
diff -c -p -d -r1.54 rtlanal.c
*** rtlanal.c	2000/02/26 14:23:43	1.54
--- rtlanal.c	2000/03/17 23:20:21
*************** single_set (insn)
*** 703,718 ****
    else if (GET_CODE (PATTERN (insn)) == PARALLEL)
      {
        for (i = 0, set = 0; i < XVECLEN (PATTERN (insn), 0); i++)
! 	if (GET_CODE (XVECEXP (PATTERN (insn), 0, i)) == SET
! 	    && (! find_reg_note (insn, REG_UNUSED,
! 				 SET_DEST (XVECEXP (PATTERN (insn), 0, i)))
! 		|| side_effects_p (XVECEXP (PATTERN (insn), 0, i))))
! 	  {
! 	    if (set)
  	      return 0;
! 	    else
! 	      set = XVECEXP (PATTERN (insn), 0, i);
! 	  }
        return set;
      }
    
--- 703,732 ----
    else if (GET_CODE (PATTERN (insn)) == PARALLEL)
      {
        for (i = 0, set = 0; i < XVECLEN (PATTERN (insn), 0); i++)
! 	{
! 	  rtx sub = XVECEXP (PATTERN (insn), 0, i);
! 
! 	  switch (GET_CODE (sub))
! 	    {
! 	    case USE:
! 	    case CLOBBER:
! 	      break;
! 
! 	    case SET:
! 	      if (! find_reg_note (insn, REG_UNUSED, SET_DEST (sub))
! 		  || side_effects_p (sub))
! 		{
! 		  if (set)
! 		    return 0;
! 		  else
! 		    set = sub;
! 		}
! 	      break;
! 
! 	    default:
  	      return 0;
! 	    }
! 	}
        return set;
      }
    

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