https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90608
--- Comment #9 from Tamar Christina <tnfchris at gcc dot gnu.org> --- (In reply to Mikael Morin from comment #8) > Created attachment 56091 [details] > Rough patch > > Here is a rough patch to make the scalarizer support minloc calls. > 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 could be with the initialization of loop iteration variables. > The existing code used for scalar minloc was versioning loops, that is it > was using too loops in a row in some cases. With scalar minloc, the > initialization of the loop variable could just be disabled in the second > loop, but if there is more than one dimension as in the array case, this > can't work. So the patch above initializes the loop variables conditionally > on a "loop_break" boolean variable, which I hoped the optimizers would be > able to remove. Unfortunately, this conditional initialization seems to > confuse the optimizers a lot. > > Anyway, the patch is there; not sure how much I can pursue this further in > the future. Thanks Mikael! That's already plenty of help! I can try to debug further after I finish my current patches. Would it be ok if I ask questions when I do?