This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Wierd bug with volatile pointer expressions
- To: Eric Doenges <doenges at lpr dot e-technik dot tu-muenchen dot de>
- Subject: Re: Wierd bug with volatile pointer expressions
- From: Graham Stott <grahams at redhat dot com>
- Date: Wed, 13 Sep 2000 10:25:44 +0100
- CC: gcc-bugs at gcc dot gnu dot org
- References: <200009130804.KAA10444@batian.lpr.e-technik.tu-muenchen.de>
Eric Doenges wrote:
>
>[snip]
>
Yes it's a known bug which hasn't been fixed yet. There is a work around cast
the expressions with volatile memory refs to void (note this only need to be
done within statement expressions)
#define WIERD ({\
(void)(*((volatile short *)1000) |= 5);\
while (*((volatile short *)1000) != 5);\
})
> Without the 'volatile' keyword, the superflous move is not emitted.
>
Yes it only occurs when volatile memory references appear within a statement
expression (i.e. ({...})).
> The error occurs on all Version of gcc-2.95.2 availible to me, i.e. native
> Compilers on i386-linux, alpha-dec-osf4.0f and sparc-sun-solaris2.8, as
> well as the m68k-coff cross compiler on i386-linux.
> --
Yes its target independent.
> ________________________________________________________________________
> Dipl.-Ing. Eric Doenges http://www.rcs.ei.tum.de
> Institute for Real-Time Computer Systems (RCS) fon +49-89-289-23590
> Technische Universitaet Muenchen, D-80290 Muenchen fax +49-89-289-23555