Re: [PATCH] sched: Work around undefined behavior in sched class checking

From
Andi Kleen <hidden>
Date
2021-05-05 14:39:38
Also in
lkml
Reply to
Florian Weimer, 2021-05-05
Context:

  <https://lore.kernel.org/lkml/20210505033945.1282851-1-ak@linux.intel.com/ (local)>

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
Thread (7 messages) 7 messages, 4 authors, last reply 2021-05-05
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help