This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: volatile semantics
- From: "Giovanni Bajo" <giovannibajo at libero dot it>
- To: "Mike Stump" <mrs at apple dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 3 May 2005 11:53:22 +0200
- Subject: Re: volatile semantics
- References: <851D2CB0-93DF-4C49-A6A8-8895DB1A08F9@apple.com>
Mike Stump <mrs@apple.com> wrote:
> 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 agree it should fetch. Did you try -fno-strict-aliasing? Open a bugreport,
I'd say.
Giovanni Bajo