https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86386
--- Comment #8 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> --- Author: hjl Date: Tue Aug 7 15:06:01 2018 New Revision: 263359 URL: https://gcc.gnu.org/viewcvs?rev=263359&root=gcc&view=rev Log: i386: Set cfun->machine->max_used_stack_alignment if needed cfun->machine->max_used_stack_alignment is used to decide how stack frame should be aligned. This is independent of any psABIs nor 32-bit vs 64-bit. It is always safe to compute max_used_stack_alignment. We compute it only if 128-bit aligned load/store may be generated on misaligned stack slot which will lead to segfault. gcc/ Backport from mainline PR target/86386 * config/i386/i386.c (ix86_finalize_stack_frame_flags): Set cfun->machine->max_used_stack_alignment if needed. gcc/testsuite/ Backport from mainline PR target/86386 * gcc.target/i386/pr86386.c: New file. Added: branches/gcc-8-branch/gcc/testsuite/gcc.target/i386/pr86386.c Modified: branches/gcc-8-branch/gcc/ChangeLog branches/gcc-8-branch/gcc/config/i386/i386.c branches/gcc-8-branch/gcc/testsuite/ChangeLog