This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/45318] New: Do more parenthesis simplification with -fno-protect-parens


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]