This is the mail archive of the 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 PR middle-end/17813

> This is OK for mainline.

Thanks for the review.

> A slight improvement might be to add a new ignore_pending_stack_adjust
> function (like clear_pending_stack_adjust) that resets stack_pointer_delta
> and pending_stack_adjust to zero, and  call that in emit_stack_restore.  

I have 3 remarks/questions:
- what about discard_pending_stack_adjust instead?  I think that "ignore" 
could fool people into thinking that the stack adjustment is only temporarily 
- what about changing clear_pending_stack_adjust into 
maybe_discard_pending_stack_adjust?  The rationale is that the typical idiom 
is currently:

  clear_pending_stack_adjust ();
  do_pending_stack_adjust ();

which seems odd at best.

- I think that stack_pointer_delta should not be reset to zero for strict 
correctness, and instead the same adjustment should be made in the new 
function as in clear_pending_stack_adjust.

> Currently, we'll emit a "dead" stack  adjustment immediately prior to
> restoring the stack pointer, and then  leave it to the RTL optimizers to
> clean up.  All we really need to do is flush the "memory" of the pending 
> adjustment. 

This was the acknowledged strategy used in the patch.  Now, after Honza's 
remark, I think yours is better.

Eric Botcazou

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