(j3.2006) What do typical processors do?

Toon Moene toon
Wed Jul 19 17:17:59 EDT 2017


On 07/19/2017 07:53 PM, Toon Moene wrote:

> I think this answers the question for gfortran 6.4:
> 
> toon at moene:~/src$ cat complextranspose.f90
> complex a(20,10), b(20,10), c(20,20)
> a = 1.5
> b = 9.2
> c = matmul(a, conjg(transpose(b)))
> print*, c
> end
> toon at moene:~/src$ gfortran -S -Warray-temporaries complextranspose.f90
> complextranspose.f90:4:14:
> 
>   c = matmul(a, conjg(transpose(b)))
>                1
> Warning: Creating array temporary at (1) [-Warray-temporaries]
> toon at moene:~/src$
> toon at moene:~/src$ gfortran -S -O3 -Warray-temporaries complextranspose.f90
> toon at moene:~/src$

For other compiler writers, it might not be immediately clear why this 
warns at *no optimization* but not at optimization level -O3.

A decade ago I wrote this: http://moene.org/~toon/GCCSummit-2007.pdf, as 
the basis of a talk about "Front-end Optimization" at the 2007's GCC summit.

In it I described those optimizations that were already implemented (by 
other people than myself !) in the Fortran specific part of the GCC 
Compiler Collection and some that would be useful.

What you see in the messages above is simply what happened after that 
... again, implemented by other people than myself.

Kind regards,

-- 
Toon Moene - e-mail: toon at moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
Progress of GNU Fortran: http://gcc.gnu.org/wiki/GFortran#news



More information about the J3 mailing list