This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
volatile semantics
- From: Mike Stump <mrs at apple dot com>
- To: Gcc Mailing List <gcc at gcc dot gnu dot org>
- Date: Tue, 3 May 2005 01:41:35 -0700
- Subject: volatile semantics
int avail;
int main() {
while (*(volatile int *)&avail == 0)
continue;
return 0;
}
Ok, so, the question is, should gcc produce code that infinitely
loops, or should it be obligated to actually fetch from memory?
Hint, 3.3 fetched.
I get:
L6:
b L6
on mainline and 4.0.