public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/95632] New: Redundant zero extension
@ 2020-06-11  4:06 bina2374 at gmail dot com
  2020-06-12  4:25 ` [Bug target/95632] " wilson at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: bina2374 at gmail dot com @ 2020-06-11  4:06 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-12-27 23:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11  4:06 [Bug target/95632] New: Redundant zero extension bina2374 at gmail dot com
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

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).