https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90608
Mikael Morin <mikael at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #56094|0 |1 is obsolete| | --- Comment #14 from Mikael Morin <mikael at gcc dot gnu.org> --- Created attachment 56313 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56313&action=edit inline minloc with mask This patch adds support for {min,max}loc with mask. It is not 100% testsuite clean as there are (runtime) error messages that regress slightly for maxloc_bounds_{4,5,6,7}.f90 (In reply to Mikael Morin from comment #11) > > > 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. Unfortunately, this is true for rank 1 arrays, but not for higher ranks. Constant values are slowly propagated to the phi arguments as optimization passes are run, but no simplification of the control flow happens as soon as multiple loop levels are involved. Need to look into the dim argument next.