Messages in this thread | | | Date | Wed, 5 May 2021 07:39:16 -0700 | From | Andi Kleen <> | Subject | Re: [PATCH] sched: Work around undefined behavior in sched class checking |
| |
> Context: > > <https://lore.kernel.org/lkml/20210505033945.1282851-1-ak@linux.intel.com/> > > Obviously, GCC doesn't do this in general.
We've seen it in other cases before, that's why RELOC_HIDE exists. A classic case was __pa_symbol()
That dates back nearly two decades at this point.
> Would you please provide a > minimal test case?
You can only reproduce it with a LTO build because it needs knowledge between different translation units for this specific case.
But gcc will totally do the optimization even without LTO if it can prove the same inside a single TU.
If you want to reproduce it you can use my tree here git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc lto-5.12-3 and revert the fix. The kernel will not boot.
-Andi
| |