https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114991
--- Comment #11 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
To summarize the current state of the PR.
In 2023 f55cdce3f8dd8503e080e35be59c5f5390f6d95e resulted in using
callee-saved regs and saving/restoring it on the stack. Later this
problem was fixed.
Still problem with using less STP exists. But it is not problem of
RA. There are less RTL insns corresponding to STP on the current trunk as it
was
before the problem.
Here is RTL before IRA:
Before f55cdce3f8dd8503e080e35be59c5f5390f6d95e Trunk:
6: r93:DI=sfp:DI-0x40 6: r102:DI=sfp:DI-0x40
REG_EQUIV sfp:DI-0x40 REG_EQUIV sfp:DI-0x40
7: x0:DI=r93:DI 7: x0:DI=r102:DI
REG_EQUAL sfp:DI-0x40 REG_EQUAL sfp:DI-0x40
8: call [`g'] argc:0 8: call [`g'] argc:0
REG_DEAD x0:DI REG_DEAD x0:DI
REG_CALL_DECL `g' REG_CALL_DECL `g'
11: {r96:V4SI=[...];r97:V4SI=[...];} LDP 9: r103:DI=sfp:DI-0x80
9: r94:DI=sfp:DI-0x80 REG_EQUIV sfp:DI-0x80
REG_EQUIV sfp:DI-0x80 13: {r105:V4SI=unspec[[...]] 44;
r106:V4SI=unspec[[...]] 45;}
LDP
13: {r98:V4SI=[...];r99:V4SI=[...];} LDP 17: {r107:V4SI=unspec[[...]] 44;
r108:V4SI=unspec[[...]] 45;}
LDP
REG_DEAD r93:DI REG_DEAD r102:DI
16: x0:DI=r94:DI 12: [...]=r105:V4SI
STR
REG_EQUAL sfp:DI-0x80 REG_DEAD r105:V4SI
12: {[...]=r96:V4SI;[...]=r97:V4SI;} STP 14: [...]=unspec[r106:V4SI,r107:V4SI]
STP
REG_DEAD r97:V4SI REG_DEAD r107:V4SI
REG_DEAD r96:V4SI REG_DEAD r106:V4SI
14: {[...]=r98:V4SI;[...]=r99:V4SI;} STP 18: [...]=r108:V4SI
STR
REG_DEAD r99:V4SI REG_DEAD r108:V4SI
REG_DEAD r98:V4SI 20: x0:DI=r103:DI
REG_DEAD r94:DI REG_DEAD r103:DI
17: call [`h'] argc:0 REG_EQUAL sfp:DI-0x80
REG_DEAD x0:DI 21: call [`h'] argc:0
REG_CALL_DECL `h' REG_DEAD x0:DI
REG_CALL_DECL `h'
I believe it is a problem ldp_fussion pass run before RA.
Also on the current trunk using -fschedule-insns results in one
less LDP generation. To solve this I suspect ldp_fussion should
be run before sched1.