[Bug middle-end/59538] Optimization of -O2 or higher creates incorrect code in loop

2013-12-17 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59538 --- Comment #7 from Andrew Pinski --- Try: // GCC Bug - bug.c // Created by Arsham Skrenes on 2013-12-17 #include #include // Find the NTH prime number SAMPLES times #define NTH 1 #define SAMPLES 5 int main(void) { struct timeva

[Bug middle-end/59538] Optimization of -O2 or higher creates incorrect code in loop

2013-12-17 Thread arsham at skrenes dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59538 --- Comment #6 from Arsham Skrenes --- (In reply to Dominique d'Humieres from comment #5) > > Also, is there a directive that I can use to explicitly tell GCC > > to not remove a loop (without having to resort to a compiler flag > > which is glo

[Bug middle-end/59538] Optimization of -O2 or higher creates incorrect code in loop

2013-12-17 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59538 --- Comment #5 from Dominique d'Humieres --- > Also, is there a directive that I can use to explicitly tell GCC > to not remove a loop (without having to resort to a compiler flag > which is global, printing a variable, or using the 'volatile' k

[Bug middle-end/59538] Optimization of -O2 or higher creates incorrect code in loop

2013-12-17 Thread arsham at skrenes dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59538 Arsham Skrenes changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID

[Bug middle-end/59538] Optimization of -O2 or higher creates incorrect code in loop

2013-12-17 Thread arsham at skrenes dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59538 --- Comment #4 from Arsham Skrenes --- Can I suggest then that GCC outputs a compiler warning when it removes a loop? It outputs warnings for unused variables as well as implicit casting, so why not have a warning for removing loops? Also, is the

[Bug middle-end/59538] Optimization of -O2 or higher creates incorrect code in loop

2013-12-17 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59538 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Component|c

[Bug middle-end/59538] Optimization of -O2 or higher creates incorrect code in loop

2013-12-17 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59538 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---