Fortran preserves () in expressions - in many cases, it shouldn't need to do so
if
-fno-protect-parens is specified. The option currently affects only the middle
end, but there might be some cases where it is preserved without needing to be.
(Though, I might be wrong and everything is already properly simplified).
Note: The out most parenthesis can not always be removed without changing the
semantics, e.g.
call copy ( (a), a)
contains
subroutine copy (x, y)
intent(in) :: x
intent(out) :: y
is valid but only works if the "(a)" [-> temporary] is not optimized to "a".
In some cases, one might need to check for the unsave_math_optimization flag
before changing, e.g., "2+(a-2)" to "a" - or rather "(a)".
--
Summary: Do more parenthesis simplification with -fno-protect-
parens
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45318