public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "bina2374 at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95632] New: Redundant zero extension Date: Thu, 11 Jun 2020 04:06:40 +0000 [thread overview] Message-ID: <bug-95632-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95632 Bug ID: 95632 Summary: Redundant zero extension Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: bina2374 at gmail dot com CC: kito at gcc dot gnu.org, wilson at gcc dot gnu.org Target Milestone: --- Target: riscv32-unknown-elf Command line: bin/riscv64-unknown-elf-gcc -march=rv32imafc -mabi=ilp32f -O2 foo.c -S ========== C Source ========== unsigned short foo(unsigned short crc) { crc ^= 0x4002; crc >>= 1; crc |= 0x8000; return crc; } ========= GCC asm ========= foo: li a5,-24576 # addi a5,a5,1 # a5 = 0xffffa001 srli a0,a0,1 xor a0,a0,a5 slli a0,a0,16 # srli a0,a0,16 # redundant zero-extension ret ======================= Ideal Code Generation ======================= foo: li a5,40960 # addi a5,a5,1 # a5 = 0x0000a001 srli a0,a0,1 xor a0,a0,a5 ret
next reply other threads:[~2020-06-11 4:06 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-11 4:06 bina2374 at gmail dot com [this message] 2020-06-12 4:25 ` [Bug target/95632] " wilson at gcc dot gnu.org 2020-06-15 9:49 ` bina2374 at gmail dot com 2020-06-16 0:01 ` wilson at gcc dot gnu.org 2020-06-16 0:02 ` wilson at gcc dot gnu.org 2020-06-16 7:15 ` ubizjak at gmail dot com 2020-06-16 7:21 ` ubizjak at gmail dot com 2021-05-30 22:26 ` pinskia at gcc dot gnu.org 2022-12-27 23:31 ` cvs-commit at gcc dot gnu.org 2022-12-27 23:32 ` law 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-95632-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).