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

[Bug fortran/45396] New: Apply front-end pass also for arrays


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


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