This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/70128] Linux kernel div patching optimized away


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70128

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think anyone patching functions need to be considered special and undefined. 
In most cases they did not mean to do it.  Just the kernel is special.

> just add an optimization barrier on fn_addr (like asm ("" : "+g" (fn_addr))).

I think that is the correct fix no matter what.  As patching functions is not
something which you can do normally because the .text section is read only.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]