http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45742
Thomas Koenig <tkoenig at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2010.11.12 20:03:13 CC| |burnus at gcc dot gnu.org Summary|VOLATI |VOLATILE has no effect Ever Confirmed|0 |1 --- Comment #1 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2010-11-12 20:03:13 UTC --- Apparently, VOLATILE has no effect at all. Another test case: i...@linux-fd1f:~/Krempel/Volatile> cat op2.f90 subroutine foo(j) integer, volatile :: j integer :: b b = j + j + j + j print *,b end i...@linux-fd1f:~/Krempel/Volatile> gfortran -S -O3 -fdump-tree-optimized op2.f90 i...@linux-fd1f:~/Krempel/Volatile> cat op2.f90.144t.optimized ;; Function foo (foo_) foo (integer(kind=4) & restrict j) { struct __st_parameter_dt dt_parm.0; integer(kind=4) b; integer(kind=4) b.1; integer(kind=4) D.1504; integer(kind=4) D.1503; integer(kind=4) D.1502; <bb 2>: D.1502_3 = *j_1(D); D.1503_4 = D.1502_3 + D.1502_3; D.1504_6 = D.1502_3 + D.1503_4; b.1_8 = D.1502_3 + D.1504_6; b = b.1_8; dt_parm.0.common.filename = &"op2.f90"[1]{lb: 1 sz: 1}; dt_parm.0.common.line = 5; dt_parm.0.common.flags = 128; dt_parm.0.common.unit = 6; _gfortran_st_write (&dt_parm.0); _gfortran_transfer_integer_write (&dt_parm.0, &b, 4); _gfortran_st_write_done (&dt_parm.0); return; } Tobias, any ideas? You implemented this a few years ago, if I remember correctly :-)