This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/45396] 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:29:11 -0000
- Subject: [Bug fortran/45396] Apply front-end pass also for arrays
- References: <bug-45396-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from burnus at gcc dot gnu dot org 2010-08-24 10:29 -------
Stupid example: Change either a == a to "a /= a" and .true. to .false. -- or
ANY to ALL. Otherwise the example does not make sense (even though it is
valid).
If one is there, one could also optimize the following:
logical :: ll
if (ALL ( [.false. , ll])) call unreachable()
end
As the single .false. makes the whole expression .false.; similarly for ANY and
.true. and for PRODUCT with an element of value 0 (though, one needs to take
case of DIM is present).
Currently, the middle end optimizes this - though there might be cases when an
early FE optimization could help - e.g. if DIM is present as then a RTL call
could happen.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45396