On Thu, Aug 05, 2021 at 02:05:24PM +0200, Martin Liška wrote:
> On 7/23/21 7:57 PM, Segher Boessenkool wrote:
> >Hi!
> >
> >On Fri, Jul 23, 2021 at 07:47:54AM +0200, Martin Liška wrote:
> >>On 7/12/21 7:20 PM, Segher Boessenkool wrote:
> >>>>>>+static __attribute__ ((optimize ("-fno-stack-protector"))) __typeof
> >>>>>>(f) *
> >>>>>
> >>>>>-fno-stack-protector is default.
> >>>>
> >>>>Yes, but one needs an optimize attribute in order to trigger
> >>>>cl_target_option_save/restore
> >>>>mechanism.
> >>>
> >>>So it behaves differently if you select the default than if you do not
> >>>select anything? That is wrong, no?
> >>
> >>Sorry, I don't get your example, please explain it.
> >
> >If -mbork is the default, the coompiler whould behave the same if you
> >invoke it with -mbork as when you do not. And the optimize attribute
> >should work exactly the same as command line options.
>
> Ah, got your point. All right, let's use then 'optimize(1)'.
>
> Is it fine with the adjustment?
You are saying the compiler's behaviour is broken, but are changing the
testcase to avoid exhibiting that behaviour? No, this is not fine.
If a flag is the default the compiler should do the same thing with and
without any attribute setting that flag, directly or indirectly.
Segher