This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/59538] Optimization of -O2 or higher creates incorrect code in loop
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 17 Dec 2013 22:28:09 +0000
- Subject: [Bug middle-end/59538] Optimization of -O2 or higher creates incorrect code in loop
- Auto-submitted: auto-generated
- References: <bug-59538-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59538
--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> 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' keyword
> which de-optimizes the caching of the target variable)? Thanks!
Try to print i instead of NTH! The basic way to avoid the removal of loops in a
benchmark is to consume in some way some of the computed data (in some cases
the optimizer may even be clever than you think).