[PATCH] Mark -fstack-protect as optimization flag (PR middle-end/71585)

Richard Biener richard.guenther@gmail.com
Wed Jun 29 09:18:00 GMT 2016


On Wed, Jun 29, 2016 at 11:02 AM, Martin Liška <mliska@suse.cz> wrote:
> On 06/28/2016 03:54 PM, Richard Biener wrote:
>> I wonder about the inliner change.  If one marks a single function
>> with -fstack-protector
>> that implicitely marks callers with -fno-stack-protector.  So I'd
>> rather disable inlining
>> between different settings here?
>
> It works in the opposite way, if a caller has the flag disabled and a callee has,
> than the flag is also set to the caller. Honza asked me to propagate the flag in such manner.

If the intended use-case is to disable stack-protector on specific
functions then it is odd
if inlining a function with stack-protector on suddenly turns it on
for that function.

Not sure what the point is in the ability to do that per function
anyway (but yes, we can
control stack-protector behavior per function).

If the intended use-case is only for making it work better across TUs
for LTO and we want
to be conservative in _en_abling stack protection then your patch
accomplishes that.  OTOH
in that case merging the option in lto-wrapper works as well.

> If you prefer to not to inline, I can prepare a patch?

So what was your original reason to pursue this?

Richard.

>
> Martin



More information about the Gcc-patches mailing list