This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/70128] Linux kernel div patching optimized away
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 07 Mar 2016 19:38:00 +0000
- Subject: [Bug tree-optimization/70128] Linux kernel div patching optimized away
- Auto-submitted: auto-generated
- References: <bug-70128-4 at http dot gcc dot gnu dot org/bugzilla/>
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.