public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/105477] New: RISC-V: Regression: Useless moves in conditional select return
@ 2022-05-04 10:46 christophm30 at gmail dot com
  2022-05-04 10:58 ` [Bug rtl-optimization/105477] " rguenth at gcc dot gnu.org
  2022-05-09 10:17 ` christophm30 at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: christophm30 at gmail dot com @ 2022-05-04 10:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105477

            Bug ID: 105477
           Summary: RISC-V: Regression: Useless moves in conditional
                    select return
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: christophm30 at gmail dot com
  Target Milestone: ---

Commit 3a7ba8fd triggers a regression so that on RISC-V two useless move
instructions are generated.

Test code:
"""
long test(long a, long b, long c)
{
  return (!c ? a : b);
}
"""

GCC 10.2.0, GCC 11 or upstream/master before 3a7ba8fd generates (rv64gc + -O3):
test:
        beq     a2,zero,.L2
        mv      a0,a1
.L2:
        ret

Current upstream/master generates:
<test>:
   0:   87aa                    mv      a5,a0
   2:   852e                    mv      a0,a1
   4:   e211                    bnez    a2,8 <.L2>
   6:   853e                    mv      a0,a5
<.L2>:
   8:   8082                    ret

This might be an issue in the ifcvt code (in combination of the RISC-V backend)
or something where the RISC-V backend needs to improve.

Some context to this issue:
* The mentioned change (3a7ba8fd) is not problematic at all and fixes an issue
PR104960
* PR105314 reports a similar issue, that is also triggered by the same change

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

end of thread, other threads:[~2022-05-09 10:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04 10:46 [Bug tree-optimization/105477] New: RISC-V: Regression: Useless moves in conditional select return christophm30 at gmail dot com
2022-05-04 10:58 ` [Bug rtl-optimization/105477] " rguenth at gcc dot gnu.org
2022-05-09 10:17 ` christophm30 at gmail dot com

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