On Tue, Jul 01, 2025 at 03:47:53PM +0200, Stefan Schulze Frielinghaus wrote: > In the past years I have started to use more and more function body > checks whenever gcc emits optimal code for a function. With that I > wanted to make sure that we do not regress like introducing unnecessary > extends or whatever which might not have been caught by only testing the > "interesting"/actual part of a patch. Thus, as long as those function > body checks are stable enough, i.e., not subject to insn reordering or > the like, I would like to make use of them in the future, too. That > being said I'm wondering whether it would make sense to automatically > add option -fno-stack-protector for tests which make use function-body > checks? If the testsuite infrastructure doesn't provide this > functionality trivially, I will try to keep this in mind and always add > the option manually.
I think even better would be to make the check-function-body UNSUPPORTED if there is no explicit -f{,no-}stack-protector* among dg-options/dg-additional-options and the option is still used. Because the test can be also dg-do run and it might be useful to run the test. Or another way could be just add a new effective target whether any kind of -fstack-protector{,-strong,-all} is enabled and guard the check-function-body directives explicitly with negation of that effective target. Or perhaps have no_stack_protection effective target and use that to guard some directives manually. Jakub