[Bug fortran/14771] New: gfortran frontend doesn't record parentheses
Tobias dot Schlueter at physik dot uni-muenchen dot de
gcc-bugzilla@gcc.gnu.org
Mon Mar 29 16:25:00 GMT 2004
gfortran parses
c = a + b + c
as
(assign c (+ (+ a b) c))
which is the same parse tree as for
c = (a + b) + c
Fortran allows a greater range of optimizations in the former case, but since it
is unable to distinguish between those two cases, the former case may be
unnecessarily pessimized by optimizers.
I have a patch to the parser and parse-tree dumper which makes gfortran record
the parentheses. It is covered by my copyright assignment to g95 as I prepared
the patch in Oct 2002. Since I have no copyright assignment for gcc I'm not sure
if I can update it for the current sources (mostly formatting and function name
changes) without running into copyright trouble. Therefore I point you to my old
patch, which I reposted to the gfortran list:
http://gcc.gnu.org/ml/fortran/2004-03/msg00048.html with the matchexp.c part
replaced by the patch from http://gcc.gnu.org/ml/fortran/2004-03/msg00046.html
The original postings on g95-develop@lists.sourceforge.net can be found in the
thread following this posting:
http://www.geocrawler.com/archives/3/3588/2002/10/50/9910846/
--
Summary: gfortran frontend doesn't record parentheses
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Tobias dot Schlueter at physik dot uni-muenchen dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: all
GCC host triplet: all
GCC target triplet: all
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14771
More information about the Gcc-bugs
mailing list