public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/96767] New: -mpure-code produces indirect loads for thumb-1
@ 2020-08-24 13:11 clyon at gcc dot gnu.org
2020-09-08 12:51 ` [Bug target/96767] " clyon at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-08-24 13:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96767
Bug ID: 96767
Summary: -mpure-code produces indirect loads for thumb-1
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: clyon at gcc dot gnu.org
Target Milestone: ---
As described in PR94538, -mpure-code produces suboptimal code for thumb-1 CPUs.
int x;
int f1 (void) { return x; }
Compiled with -O2 -mpure-code,
-mcpu=cortex-m0:
movs r3, #:upper8_15:#.LC0
lsls r3, #8
adds r3, #:upper0_7:#.LC0
lsls r3, #8
adds r3, #:lower8_15:#.LC0
lsls r3, #8
adds r3, #:lower0_7:#.LC0
@ sp needed
ldr r3, [r3]
ldr r0, [r3]
bx lr
-> extra indirection, there should be only one ldr
For reference, -mcpu=cortex-m[347] and m23 produce:
movw r3, #:lower16:.LANCHOR0
movt r3, #:upper16:.LANCHOR0
ldr r0, [r3]
bx lr
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/96767] -mpure-code produces indirect loads for thumb-1
2020-08-24 13:11 [Bug target/96767] New: -mpure-code produces indirect loads for thumb-1 clyon at gcc dot gnu.org
@ 2020-09-08 12:51 ` clyon at gcc dot gnu.org
2020-09-28 9:10 ` clyon at gcc dot gnu.org
2020-11-02 7:39 ` clyon at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-09-08 12:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96767
Christophe Lyon <clyon at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Ever confirmed|0 |1
Last reconfirmed| |2020-09-08
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/96767] -mpure-code produces indirect loads for thumb-1
2020-08-24 13:11 [Bug target/96767] New: -mpure-code produces indirect loads for thumb-1 clyon at gcc dot gnu.org
2020-09-08 12:51 ` [Bug target/96767] " clyon at gcc dot gnu.org
@ 2020-09-28 9:10 ` clyon at gcc dot gnu.org
2020-11-02 7:39 ` clyon at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-09-28 9:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96767
--- Comment #1 from Christophe Lyon <clyon at gcc dot gnu.org> ---
Patch sent for review:
https://gcc.gnu.org/pipermail/gcc-patches/2020-September/554956.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/96767] -mpure-code produces indirect loads for thumb-1
2020-08-24 13:11 [Bug target/96767] New: -mpure-code produces indirect loads for thumb-1 clyon at gcc dot gnu.org
2020-09-08 12:51 ` [Bug target/96767] " clyon at gcc dot gnu.org
2020-09-28 9:10 ` clyon at gcc dot gnu.org
@ 2020-11-02 7:39 ` clyon at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-11-02 7:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96767
Christophe Lyon <clyon at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #2 from Christophe Lyon <clyon at gcc dot gnu.org> ---
The master branch has been updated by Christophe Lyon <clyon@gcc.gnu.org>:
https://gcc.gnu.org/g:4d9af90d6a216822fe117337fb9836ba656dc3af
commit r11-4598-g4d9af90d6a216822fe117337fb9836ba656dc3af
Author: Christophe Lyon <christophe.lyon@linaro.org>
Date: Mon Nov 2 07:31:22 2020 +0000
arm: Avoid indirection with -mpure-code on v6m (PR96967)
With -mpure-code on v6m (thumb-1), to avoid a useless indirection when
building the address of a symbol, we want to consider SYMBOL_REF as a
legitimate constant. This way, we build the address using a series of
upper/lower relocations instead of loading the address from memory.
This patch also fixes a missing "clob" conds attribute for
thumb1_movsi_insn, needed because that alternative clobbers the flags.
2020-11-02 Christophe Lyon <christophe.lyon@linaro.org>
gcc/
PR target/96967
* config/arm/arm.c (thumb_legitimate_constant_p): Add support for
disabled literal pool in thumb-1.
* config/arm/thumb1.md (thumb1_movsi_symbol_ref): Remove.
(*thumb1_movsi_insn): Add support for SYMBOL_REF with -mpure-code.
gcc/testsuite
PR target/96967
* gcc.target/arm/pure-code/pr96767.c: New test.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-11-02 7:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24 13:11 [Bug target/96767] New: -mpure-code produces indirect loads for thumb-1 clyon at gcc dot gnu.org
2020-09-08 12:51 ` [Bug target/96767] " clyon at gcc dot gnu.org
2020-09-28 9:10 ` clyon at gcc dot gnu.org
2020-11-02 7:39 ` clyon at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).