https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126175
--- Comment #3 from Cedric Bail <cedric.bail at pm dot me> --- I tried -Os and -O2 with -m2 and -m4. For -m2a, I did also -Os and -O2, but I had to specify -mb. I wanted to see if the idea of "pivot" register was something that make sense and got into a session with claude code to see if that was something that could be integrated in the lra algorithm. It identified that the code had a spot that was responsible for actually redoing the computation of the base address and proposed a fairly small patch that make sense, to me. It solve the reproduction case and actually seems to improve the result compared to even pre lra. I have very narrow knowledge of gcc code base and can't tests for other platforms as this is clearly going to impact, but likely help, any platform with displacement constraints.
