This is the mail archive of the
mailing list for the GCC project.
Re: Patch: fix temp slot allocation bug
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: dalej at apple dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 16 Nov 04 14:24:54 EST
- Subject: Re: Patch: fix temp slot allocation bug
>> + push_temp_slots ();
>> target = assign_temp (nt, 0, 1, 1);
>> preserve_temp_slots (target);
>> + pop_temp_slots ();
> Probably a silly question, but since the only thing you do between
> the push and pop is a create a new temporary, why isn't this the
> same as removing the preserve_temp_slots() call?
I think you need that to prevent that temp slot from being reassigned
for some other use (see similar code in precompute_register_parameters
earlier in the file).
The difference there is that there's a call to expand_expr inside.
That can allocate additional temps beyond that used for the return and
*those* you don't need to keep. I agree that in the code above, the
push/preserve/pop is accomplishing nothing.