Hello, this is a fix for a gcc-12 ICE regression. This ICE rings a bell to me, and I think the change by Tobias which triggers it only uncovers a bug that can also happen independently in other cases. The problem is resolution of maxloc expressions is not idempotent, that is resolution changes the expression in such a way that it can't be successfully resolved again. I have not tried to prevent multiple resolutions, and fixed instead the way the expression is changed. The patch explains the details. No regression on x86_64-pc-linux-gnu. OK for master and 12?