https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96769
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Christophe Lyon <cl...@gcc.gnu.org>: https://gcc.gnu.org/g:2033a63cbd0aab27d3a8450b4a4a5b371d583c85 commit r11-3011-g2033a63cbd0aab27d3a8450b4a4a5b371d583c85 Author: Christophe Lyon <christophe.l...@linaro.org> Date: Fri Sep 4 11:48:36 2020 +0000 arm: Improve immediate generation for thumb-1 with -mpurecode [PR96769] This patch moves the move-immediate splitter after the regular ones so that it has lower precedence, and updates its constraints. For int f3 (void) { return 0x11000000; } int f3_2 (void) { return 0x12345678; } we now generate: * with -O2 -mcpu=cortex-m0 -mpure-code: f3: movs r0, #136 lsls r0, r0, #21 bx lr f3_2: movs r0, #18 lsls r0, r0, #8 adds r0, r0, #52 lsls r0, r0, #8 adds r0, r0, #86 lsls r0, r0, #8 adds r0, r0, #121 bx lr * with -O2 -mcpu=cortex-m23 -mpure-code: f3: movs r0, #136 lsls r0, r0, #21 bx lr f3_2: movw r0, #22136 movt r0, 4660 bx lr 2020-09-04 Christophe Lyon <christophe.l...@linaro.org> PR target/96769 gcc/ * config/arm/thumb1.md: Move movsi splitter for arm_disable_literal_pool after the other movsi splitters. gcc/testsuite/ * gcc.target/arm/pure-code/pr96769.c: New test.