[patch, fortran] Handling of .and. and .or. expressions
Thomas Koenig
tkoenig@netcologne.de
Fri Jun 15 17:06:00 GMT 2018
Hi Janne,
> What about more complicated expressions like, say, "func() .and. flag .and
> func2() .and. flag2" etc.? Can it move all the function calls to the end?
Not at the moment.
Like many of the front-end optimizations, this aims for the easy 80%
which are relatively easy to achieve.
> IMHO it's a mistake that the standard refuses to specify the evaluation
> strategy in the name of some rather minor hypothetical performance benefit.
Well, it is the way it is, and it is not going to change. We might
as well make the best of the situation as it is.
There are other standards, such as the C standard, whose type-based
aliasing rules can be used for optimization, but can also introduce
hard-to-find bugs. gcc's philosophy is to use the optimization
possibilities, and I see no reason for gfortran to deviate from that.
Regards
Thomas
More information about the Gcc-patches
mailing list