[patch, Fortran] PR 55806 - Inefficient ANY with array constructors

Thomas Koenig tkoenig@netcologne.de
Tue Jan 1 20:18:00 GMT 2013


Hello world,

the attached patch replaces ANY(a, b, c) with a .or. b .or c,
leading to reduced execution time.  It also handles ALL, PRODUCT
and SUM.

This fixes a bug noted by Michael Metcalf.

Regression-tested.  OK for trunk?

	Thomas

2013-01-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/55806
         * frontend-passes.c (optimize_reduction):  New function,
         including prototype.
         (callback_reduction):  Likewise.
         (gfc_run_passes):  Also run optimize_reduction.
         (copy_walk_reduction_arg):  New function.
         (dummy_code_callback):  New function.

2013-01-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/55806
         * gfortran.dg/array_constructor_40.f90:  New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: array_constructor_40.f90
Type: text/x-fortran
Size: 1053 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130101/ce204e62/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p3.diff
Type: text/x-patch
Size: 5937 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130101/ce204e62/attachment-0001.bin>


More information about the Gcc-patches mailing list