This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [patch, fortran] PR 46065 - optimize trim


Hello Thomas,

Thomas Koenig wrote:
However, I worry that
the following program is mishandled, "sub" is the obvious case while
"two" is a special case, cf. PR 46896.
The attached version of the patch fixes your concern by never applying
this optimization within an argument list.  I have also added your test
case.

The patch is OK. One could relax that argument-list restriction and allow it for PURE procedures, which is the trivial case - but that can (like the ref part) be deferred.


Thanks!

Tobias

2010-12-29 Thomas Koenig<tkoenig@gcc.gnu.org>

	PR fortran/47065
	* frontend-passes.c (count_arglist):  Static variable to
	count the nesting of argument lists.
	(optimize_code):  Set count_arglist to 1 if within a call
	statement, to 0 otherwise.
	(optimize_trim):  New function.
	(optimize_expr):  Adjust count_arglist.  Call optimize_trim.

2010-12-29 Thomas Koenig<tkoenig@gcc.gnu.org>

	PR fortran/47065
	* gfortran.dg/optimize_trim_3.f90:  New test.
	* gfortran.dg/optimize_trim_4.f90:  New test.


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