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