aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorRoger Sayle <roger@nextmovesoftware.com>2022-07-01 09:18:07 +0100
committerRoger Sayle <roger@nextmovesoftware.com>2022-07-01 09:18:07 +0100
commit17419b61edd350147b0cc10c3da0b8461e51a42c (patch)
treee6134b3fc69c61b4dd2a694bfc17f0b2f79b6366 /gcc/cp
parente8a46e5cdab500eadffc0a11850d074498b3c2b2 (diff)
downloadgcc-17419b61edd350147b0cc10c3da0b8461e51a42c.zip
gcc-17419b61edd350147b0cc10c3da0b8461e51a42c.tar.gz
gcc-17419b61edd350147b0cc10c3da0b8461e51a42c.tar.bz2
PR target/106122: Don't update %esp via the stack with -Oz on x86.
When optimizing for size with -Oz, setting a register can be minimized by pushing an immediate value to the stack and popping it to the destination. Alas the one general register that shouldn't be updated via the stack is the stack pointer itself, where "pop %esp" can't be represented in GCC's RTL ("use of a register mentioned in pre_inc, pre_dec, post_inc or post_dec is not permitted within the same instruction"). This patch fixes PR target/106122 by explicitly checking for SP_REG in the problematic peephole2. 2022-07-01 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog PR target/106122 * config/i386/i386.md (peephole2): Avoid generating pop %esp when optimizing for size. gcc/testsuite/ChangeLog PR target/106122 * gcc.target/i386/pr106122.c: New test case.
Diffstat (limited to 'gcc/cp')
0 files changed, 0 insertions, 0 deletions