https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90811

--- Comment #19 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Kito Cheng from comment #17)
> Created attachment 47920 [details]
> update-local-align-pass.patch
> 
> Hi Jakub:
> 
> I got your point, and I agree with your point, estimate_stack_frame_size not
> the right place to update alignment.
> 
> I write a patch to add a new pass to update the data alignment, executed at
> begging of pass_all_early_optimizations, PoC patch attached, it's not fully
> tested yet, how do you think about this approach? 

The placement is definitely wrong.
For OpenMP/OpenACC offloading, it needs to be after
  /* These passes are run after IPA passes on every function that is being
     output to the assembler file.  */
  INSERT_PASSES_AFTER (all_passes)
because before that the IL is used for both host and offloading targets, and
both might have different local variable alignment preferences.

Reply via email to