This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Loop unrolling
- To: gavin at cygnus dot com (Gavin Romig-Koch)
- Subject: Re: Loop unrolling
- From: Joe Buck <jbuck at synopsys dot com>
- Date: Wed, 3 Jun 98 9:00:48 PDT
- Cc: amylaar at cygnus dot co dot uk, knobi at rocketmail dot com, leei at ai dot sri dot com, steve at icarus dot icarus dot com, pfeifer at dbai dot tuwien dot ac dot at, egcs at cygnus dot com
> No. The "volatile" requires the compiler to keep the implied
> loads and stores, dispite the as-if rule, and thus the loop is
> not empty, and thus not deleted.
I don't believe the standard ever makes an exception to the as-if rule.
'volatile' for a static or global variable matters because you can
write a program where the effect is visible (make it multithreaded,
use a signal handler, map the variable to a hardware register).
Thus 'volatile' is *not* an exception to as-if.