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 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.


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