public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45318]  New: Do more parenthesis simplification with -fno-protect-parens
@ 2010-08-18 13:56 burnus at gcc dot gnu dot org
  2010-08-18 14:23 ` [Bug fortran/45318] " rguenth at gcc dot gnu dot org
  2010-08-18 17:44 ` burnus at gcc dot gnu dot org
  0 siblings, 2 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-08-18 13:56 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <bug-45318-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2013-07-20 19:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-18 13:56 [Bug fortran/45318] New: Do more parenthesis simplification with -fno-protect-parens burnus at gcc dot gnu dot org
2010-08-18 14:23 ` [Bug fortran/45318] " rguenth at gcc dot gnu dot org
2010-08-18 17:44 ` burnus at gcc dot gnu dot org
     [not found] <bug-45318-4@http.gcc.gnu.org/bugzilla/>
2010-12-28 23:38 ` dfranke at gcc dot gnu.org
2013-06-19 13:03 ` dominiq at lps dot ens.fr
2013-07-20  9:57 ` tkoenig at gcc dot gnu.org
2013-07-20 19:58 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).