[patch, fortran] Some fewer temporaries

Thomas Koenig tkoenig@netcologne.de
Tue Nov 30 11:19:00 GMT 2010


Hello world,

this patch generates fewer temporaries for array assignments by further
improving dependency analysis.

This should be a safe change even for early stage 3. The patch passes a
rather large number of test cases, i.e. the Fortran program generated
with the Perl script below.  (You'll need 4 GB of RAM and a few minutes
to run that test even without any optimization, which is why I don't
propose adding the generated program to the testsuite).

OK for trunk?

	Thomas

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

	PR fortran/45159
	* dependency.c (check_section_vs_section):  Pre-calculate
	the relationship between the strides and the relationship
	between the start values.  Use an integer constant one for
	that purpose.
	Forward dependencies for positive strides apply for where
	the lhs start <= rhs start and lhs stride <= rhs stride
	and vice versa for negative stride.  No need to compare
	end expressions in either case (assume no bounds violation).

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

	PR fortran/45159
	* gfortran.dg/dependency_38.f90:  New test.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: p1.diff
Type: text/x-patch
Size: 4831 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20101130/b3501682/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dep-sub.pl
Type: application/x-perl
Size: 1075 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20101130/b3501682/attachment.pl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dependency_38.f90
Type: text/x-fortran
Size: 369 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20101130/b3501682/attachment-0001.bin>


More information about the Gcc-patches mailing list