LWN.net Logo

Regehr: GCC 4.8 Breaks Broken SPEC 2006 Benchmarks

Regehr: GCC 4.8 Breaks Broken SPEC 2006 Benchmarks

Posted Mar 23, 2013 18:24 UTC (Sat) by smurf (subscriber, #17840)
In reply to: Regehr: GCC 4.8 Breaks Broken SPEC 2006 Benchmarks by HelloWorld
Parent article: Regehr: GCC 4.8 Breaks Broken SPEC 2006 Benchmarks

>> The point is that gcc should give a warning when one uses a very
>> unusual syntax like k < 16 to express 1, because chances are that
>> wasn't the original intent.

The problem is that this kind of thing comes up in macros all the time, esp. in hand-optimized libraries. "(Foo < 8) ? _handcoded_special_function() : _generic_function()" is a common-enough idiom. You cannot just warn about that.


(Log in to post comments)

Regehr: GCC 4.8 Breaks Broken SPEC 2006 Benchmarks

Posted Mar 23, 2013 18:52 UTC (Sat) by mansr (guest, #85328) [Link]

A common strategy is to not warn for integer constant expressions used in conditions while warning if a condition involving a non-constant expression is provably invariant.

Regehr: GCC 4.8 Breaks Broken SPEC 2006 Benchmarks

Posted Mar 25, 2013 13:37 UTC (Mon) by dlthomas (guest, #89935) [Link]

Fortunately, GCC 4.8 also keeps track of what code is the result of expansion of what macros...

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds