[Bug c/33653] volatile memory access optimized away

matz at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Oct 4 09:53:00 GMT 2007



------- Comment #2 from matz at gcc dot gnu dot org  2007-10-04 09:53 -------
Smaller testcase:

void f (volatile char *p)
{
  char c = p[0];
}

This access to the volatile object p[0] must not be optimized away, but:

% ./gcc/cc1 -O1 x.c
% cat x.s
f:
        pushl   %ebp
        movl    %esp, %ebp
        popl    %ebp
        ret


-- 

matz at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-10-04 09:53:35
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33653



More information about the Gcc-bugs mailing list