https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91528
--- Comment #9 from Uroš Bizjak <ubizjak at gmail dot com> --- (In reply to Richard Biener from comment #8) > (In reply to Uroš Bizjak from comment #5) > > Created attachment 46753 [details] > > Conditionally generate DRAP reg for realigned stack > > > > This should be the correct patch, we call targetm.calls.get_drap_rtx only > > when crtl->drap_reg is null (get_drap_rtx also emits DRAP initialization > > sequence). > > > > Richi, can you please put the patch through your testing with forced STV on > > -march=westmere? I'm bootstrapping with the patch, but this means little > > with generic bootstrap. > > The patch passed bootstrap with -march=westmere for all languages with > STV forced to convert all chains. Great! > Testing is a bit fragile since for example we build most > gcc.target/i386/avx512*.c tests with some -mavx512 flags and expect no > AVX512 insns to be > used before the CPUID verification - of course with all chains actually > converted some AVX512 insns creep in into the CPUID verification path and > the tests fail with an illegal instruction (so techincally the testcases > are invalid since the main driver with the CPUID check is compiled with > -mavx512*). Dynamic re-alignment and prologue/epilogue construction code is sprinkled with many (helpful!) asserts, so the compilation would break left and right if we got realignment functionality wrong. Based on your testing, I feel confident enough that my patch is OK, so let's proceed with this one and keep an eye on testers and fuzzers.