https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90608
Mikael Morin <mikael at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #56091|0 |1 is obsolete| | --- Comment #11 from Mikael Morin <mikael at gcc dot gnu.org> --- Created attachment 56094 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56094&action=edit Improved patch This improved patch (still single argument only) passes the fortran regression testsuite. (In reply to Mikael Morin from comment #8) > It regresses on minloc_1.f90 at least, but I haven't be able to pinpoint the > problem in the original tree dump so far. > The problem was an initialization of the result to the first element of the array that the patch removed, which seemed useless to me but made a difference in the questionable case where the array argument is filled with nans. > The problem could be with the initialization of loop iteration variables. > (...) > Unfortunately, this conditional initialization seems to > confuse the optimizers a lot. > On closer look, the conditional initialization doesn't seem to be that confusing (at least in the problematic case), as it's removed early (ccp1) in the pipeline. The loop iteration variables remain initialized with phis, but that's because of the loops.