------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-23
14:42 -------
This looks like a latent bug on the mainline too, just harder to reproduce and
here is a testcase:
struct test {
struct tt
{
volatile int a;
volatile int b;
} t;
};
int main(int argc, char *argv[]){
struct test *p = (struct test *)0x10000000;
struct tt *ptr = &p->t;
ptr->b = 10;
(int)ptr->b;
return 1;
}
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.0 Regression] Read from |[4.0/4.1 Regression] Read
|volatile member of struct is|from volatile member of
|optimized away |struct is optimized away
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22000