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: [PATCH] Fix middle-end/15054 (overlapping stack temporaries)


On Thursday, April 29, 2004, at 06:36 AM, Ulrich Weigand wrote:
the following patch fixes PR middle-end/15054, a bug caused by
overlapping stack temporaries.

I see the problem. I don't like your patch, it gets the lifetime wrong. Please just do this:


  if (keep == 2)
    {
      p->level = target_temp_slot_level;
      p->keep = 1;
    }

instead of this:

  if (keep == 2)
    {
      p->level = target_temp_slot_level;
      p->keep = 0;
    }

This keeps like lifetime as intended, and ensures that the space isn't freed until popped. Obvious with that change to me.

                target = assign_temp (type, 2, 0, 1);
                /* All temp slots at this level must not conflict.  */
                preserve_temp_slots (target);


*************** expand_expr_real (tree exp, rtx target,
*** 8525,8532 ****
  	    else
  	      {
  		target = assign_temp (type, 2, 0, 1);
- 		/* All temp slots at this level must not conflict.  */
- 		preserve_temp_slots (target);

This part is ok.



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