public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "clyon at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/96767] New: -mpure-code produces indirect loads for thumb-1 Date: Mon, 24 Aug 2020 13:11:14 +0000 [thread overview] Message-ID: <bug-96767-4@http.gcc.gnu.org/bugzilla/> (raw) 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
next reply other threads:[~2020-08-24 13:11 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-08-24 13:11 clyon at gcc dot gnu.org [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-96767-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).