This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/45396] New: Apply front-end pass also for arrays
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Aug 2010 10:18:06 -0000
- Subject: [Bug fortran/45396] New: Apply front-end pass also for arrays
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Follow up to PR 45380; frontend-passes.c currently only works for scalars - cf.
PR 45380:
+ /* An expression of type EXPR_CONSTANT is only valid for scalars. */
+ /* TODO: A scalar constant may be acceptable in some cases (the scalarizer
+ handles them well). However, there are also cases that need a non-scalar
+ argument. For example the any intrinsic. See PR 45380. */
+ if (e->rank > 0)
+ return false;
For instance, for an array "a"
if (ANY ( a == a ))
can NOT be optimized to
if (ANY ( .true. ))
but only to either
if (ANY ( [ .true., .true. ... ] ))
with the proper shape or handling the transformational intrinsics as:
if (.true.)
The reason is that ANY expects an array - analogously for ALL, SUM, PRODUCT,
PARITY, NORM2, ...
--
Summary: Apply front-end pass also for arrays
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
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=45396