This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/37599] renamed volatile variables are not treated as volatile
- From: "sam at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Sep 2008 20:08:13 -0000
- Subject: [Bug ada/37599] renamed volatile variables are not treated as volatile
- References: <bug-37599-8123@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from sam at gcc dot gnu dot org 2008-09-20 20:08 -------
Rolf,
could you include the problematic assembler code? On i686-pc-linux-gnu, it
looks like it generates the expected code except for the bogus extra access
that I submitted as a separate bug in PR ada/37602:
_ada_b:
movl a__var, %edx
movzbl (%edx), %eax <=== extra access
movzbl (%edx), %eax <=== volatile read through renaming
orl $1, %eax
movb %al, (%edx) <=== volatile write through renaming
movl a__var, %edx <=== looks like a useless assignment
movzbl (%edx), %eax <=== volatile read
orl $1, %eax
movb %al, (%edx) <=== volatile write
ret
Adding an extra "renamed := renamed or 2;" shows that reads and writes are not
aggregated, as expected for a volatile variable.
I will file a separate report for the missed optimization.
--
sam at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sam at gcc dot gnu dot org
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37599