[cfe-dev] selective/fine grained optimizations control

Halfdan Ingvarsson halfdan at sidefx.com
Wed Aug 28 12:21:46 PDT 2013


On 13-08-28 02:50 PM, Eli Friedman wrote:
> On Wed, Aug 28, 2013 at 11:08 AM, Halfdan Ingvarsson 
> <halfdan at sidefx.com <mailto:halfdan at sidefx.com>> wrote:
>
>
>     I beg to differ:http://llvm.org/pr14223 <http://llvm.org/pr14223>
>
>     We still have to compile the affected project with -O1 to ensure
>     that the destructors properly fire.
>
>
> I know the compiler has lots of bugs; I work on them every day. :) 
>  It's still not the first explanation to look for.
>
And for that I salute you. I wish I had more time to investigate that 
one particular issue. The trappings of modern life, and all that :)

That said, I do tend to look in the direction of the LLVM optimizer when 
gcc debug/optimized & clang debug all give the same answer, but clang 
optimized disagrees.

When faced with an optimizer bug, it would be great to be able to 
quickly narrow down a particular function (or set of) with an attribute, 
rather than extract potential culprits into their own source with its 
own optimization level. This is especially true in the presence of large 
code bases with hairy build systems, helper classes internal to 
compile-units, and myriad static helper functions. I do this sometimes 
with gcc, especially because we build our product for multiple gcc 
versions. That way we can just disable specific optimizations for a 
given gcc version with a known optimizer bug. It's not ideal but it gets 
the job done.

I know this feature is already being discussed, I'm just throwing my 
vote in that direction.

  - ½

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130828/1199d327/attachment.html>


More information about the cfe-dev mailing list