Fix alignment for local variable [PR90811]
- The alignment for local variable was adjust during estimate_stack_frame_size,
however it seems wrong spot to adjust that, expand phase will adjust that
but it little too late to some gimple optimization, which rely on certain
target hooks need to check alignment, forwprop is an example for
that, result of simplify_builtin_call rely on the alignment on some
target like ARM or RISC-V.
- Exclude static local var and hard register var in the process of
alignment adjustment.
- This patch fix gfortran.dg/pr45636.f90 for arm and riscv.
- Regression test on riscv32/riscv64 and x86_64-linux-gnu, no new fail
introduced.
gcc/ChangeLog
PR target/90811
* Makefile.in (OBJS): Add adjust-alignment.o.
* adjust-alignment.c (pass_data_adjust_alignment): New.
(pass_adjust_alignment): New.
(pass_adjust_alignment::execute): New.
(make_pass_adjust_alignment): New.
* tree-pass.h (make_pass_adjust_alignment): New.
* passes.def: Add pass_adjust_alignment.