public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/102737] New: [x86] Failure to optimize out bad register usage involving int->double conversion
@ 2021-10-13 21:08 gabravier at gmail dot com
  2021-10-13 21:25 ` [Bug target/102737] [9/10/11/12 Regression] extra mov with int->double conversion and addition (incoming arguments and return) pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gabravier at gmail dot com @ 2021-10-13 21:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102737
           Summary: [x86] Failure to optimize out bad register usage
                    involving int->double conversion
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

double foo(int s, double a)
{
  return s + a;
}

With -O3, GCC outputs this on AMD64:

foo(int, double):
        movapd  xmm1, xmm0
        pxor    xmm0, xmm0
        cvtsi2sd        xmm0, edi
        addsd   xmm0, xmm1
        ret

LLVM outputs this:

foo(int, double):
        cvtsi2sd        xmm1, edi
        addsd   xmm0, xmm1
        ret

The movapd in GCC's version can be optimized out.

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

end of thread, other threads:[~2023-07-07 10:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 21:08 [Bug target/102737] New: [x86] Failure to optimize out bad register usage involving int->double conversion gabravier at gmail dot com
2021-10-13 21:25 ` [Bug target/102737] [9/10/11/12 Regression] extra mov with int->double conversion and addition (incoming arguments and return) pinskia at gcc dot gnu.org
2021-10-13 21:27 ` pinskia at gcc dot gnu.org
2022-01-19  8:55 ` rguenth at gcc dot gnu.org
2022-05-27  9:46 ` [Bug target/102737] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:46 ` jakub at gcc dot gnu.org
2023-07-07 10:41 ` [Bug target/102737] [11/12/13/14 " rguenth 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).