Re: [PATCH 0/7] ARM: hacks for link-time optimization

From: Andi Kleen
Date: Mon Dec 17 2018 - 19:08:03 EST


On Mon, Dec 17, 2018 at 11:50:20PM +0100, Peter Zijlstra wrote:
> On Tue, Feb 20, 2018 at 10:59:47PM +0100, Arnd Bergmann wrote:
> > Hi Nico, all,
> >
> > I was playing with ARM link-time optimization handling earlier this
> > month, and eventually got it to build cleanly with randconfig kernels,
> > but ended up with a lot of ugly hacks to actually pull it off.
>
> How are we dealing with the fact that LTO can break RCU in very subtle
> and scary ways?
>
> Do we have a compiler guy on board that has given us a compiler switch
> that kills that optimization (and thereby guarantees that behaviour for
> future compilers etc..) ?

Can you actually define what optimization you are worred about?

If there are optimizations that cause problems they likely happen
even without LTO inside files. The only difference with LTO is that it
does them between files too.

-Andi