public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "maxsamukha at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug d/101226] New: Suboptimal codegen for >>/>>> Date: Sat, 26 Jun 2021 16:14:57 +0000 [thread overview] Message-ID: <bug-101226-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101226 Bug ID: 101226 Summary: Suboptimal codegen for >>/>>> Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: d Assignee: ibuclaw at gdcproject dot org Reporter: maxsamukha at gmail dot com Target Milestone: --- Target: AVR example.d: void f1() { __gshared ubyte value; value >>>= 5; } void f2() { __gshared ubyte value; value = value >>> 5; } ---- avr-gcc -fno-druntime -O3 example.d: example.f1(): lds r24,example.f1().value swap r24 lsr r24 andi r24,lo8(7) sts example.f1().value,r24 ret example.f2(): lds r24,example.f2().value ldi r25,0 ldi r27,0 ldi r26,0 ldi r18,5 1: lsr r27 ror r26 ror r25 ror r24 dec r18 brne 1b sts example.f2().value,r24 ret The compiler apparently fails to optimize out the integer promotion for >>> in f2 and produces inefficient machine code.
next reply other threads:[~2021-06-26 16:14 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-26 16:14 maxsamukha at gmail dot com [this message] 2021-07-16 22:51 ` [Bug tree-optimization/101226] " pinskia at gcc dot gnu.org 2023-05-02 4:06 ` pinskia 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-101226-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).