http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45742
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-11-12
20:22:24 UTC ---
(In reply to comment #1)
> Apparently, VOLATILE has no effect at all. Another test case:
[...]
> Tobias, any ideas?
No idea:
$ LANG= gfortran -v 2>&1|grep -E 'experi|Targ'
Target: x86_64-unknown-linux-gnu
gcc version 4.6.0 20101111 (experimental) [trunk revision 166614] (GCC)
$ gfortran -fdump-tree-original -fdump-tree-optimized -O3 -c test.f90
$ cat test.f90.003t.original
...
integer(kind=4) b;
volatile integer(kind=4) j;
b = ((j + j) + j) + j;
...
$ cat test.f90.144t.optimized
...
j.1_1 ={v} j;
j.1_2 ={v} j;
D.1508_3 = j.1_2 + j.1_2;
j.1_4 ={v} j;
D.1509_5 = D.1508_3 + j.1_4;
j.1_6 ={v} j;
b.2_7 = D.1509_5 + j.1_6;
Looks good!