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 15:31 UTC (Sat) by proski (subscriber, #104)
In reply to: Regehr: GCC 4.8 Breaks Broken SPEC 2006 Benchmarks by Thue
Parent article: Regehr: GCC 4.8 Breaks Broken SPEC 2006 Benchmarks

It's actually a common programming mistake often found by Valgrind. I'm afraid the new gcc would generate the code that would behave in unexpected ways without triggering Valgrind warnings.


(Log in to post comments)

Regehr: GCC 4.8 Breaks Broken SPEC 2006 Benchmarks

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

It's not constraining the lookup, which would make valgrind miss it, but constraining its later assumptions about the variable.

int d[16];

d[k] = 10; /*A*/

if(/*B*/ k < 16) {
...
}

The idea is that when it hits A, if that expression would be false, behavior is already undefined because of what happened at B, so let's optimize for the case that didn't segfault (or corrupt data).

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