This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Loop unrolling



> 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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]