[cfe-dev] Clang incorrectly optimizing out for conditional in Linux

Keane, Erich via cfe-dev cfe-dev at lists.llvm.org
Tue Apr 4 09:32:21 PDT 2017


I was not, I sent him an email, but he and I are in different hemispheres, so we likely are going to have a few days lag.

From: Derrick McKee [mailto:derrick.mckee at gmail.com]
Sent: Tuesday, April 4, 2017 9:14 AM
To: Keane, Erich <erich.keane at intel.com>; David Chisnall <David.Chisnall at cl.cam.ac.uk>
Cc: cfe-dev at lists.llvm.org; jonathan at codesourcery.com; csong at cs.ucr.edu
Subject: Re: [cfe-dev] Clang incorrectly optimizing out for conditional in Linux

In the meanwhile, were you able to talk with the implementer about your proposed change, Erich?  If you and the implementer agree on your fix, maybe I can add it to my source and get going on my work.

On Tue, Apr 4, 2017 at 11:25 AM Keane, Erich <erich.keane at intel.com<mailto:erich.keane at intel.com>> wrote:
Well Blarg, that is disappointing.  In THIS case, I at least have a hope, the original implementer and I share an organization, so hopefully he'll be willing to fix it out of internal good will :)

-----Original Message-----
From: Dr D. Chisnall [mailto:dc552 at hermes.cam.ac.uk<mailto:dc552 at hermes.cam.ac.uk>] On Behalf Of David Chisnall
Sent: Tuesday, April 4, 2017 1:01 AM
To: Keane, Erich <erich.keane at intel.com<mailto:erich.keane at intel.com>>
Cc: cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>; derrick.mckee at gmail.com<mailto:derrick.mckee at gmail.com>; jonathan at codesourcery.com<mailto:jonathan at codesourcery.com>; csong at cs.ucr.edu<mailto:csong at cs.ucr.edu>
Subject: Re: [cfe-dev] Clang incorrectly optimizing out for conditional in Linux

On 3 Apr 2017, at 20:24, Keane, Erich via cfe-dev <cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>> wrote:
>
> I filed an issue with the Kernel (here https://bugzilla.kernel.org/show_bug.cgi?id=195235) to capture this issue.  Hopefully this is something that they will fix!  I'll note that my suggested answer assumes they want the behavior to remain the same, though I'm not sure that is what they MEANT.

As I recall, this particular kernel idiom is one that caused GCC to add an extra flag to restrict their optimisations, because rewriting Linux in C was harder than hacking the compiler to support Linux-flavoured almost-C, so I wouldn’t hold out much hope for Linux fixing the code - this is far from the only place that this idiom occurs and has been the cause of at least one security vulnerability.

David
--
Derrick McKee
Ph.D. Student at Purdue University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170404/0fb34cb4/attachment.html>


More information about the cfe-dev mailing list