public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/111782] New: [11/12/13/14 Regression] Extra move in complex double multiplication
@ 2023-10-12  9:43 ktkachov at gcc dot gnu.org
  2023-10-12 10:46 ` [Bug middle-end/111782] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2023-10-12  9:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111782
           Summary: [11/12/13/14 Regression] Extra move in complex double
                    multiplication
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ktkachov at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64

The testcase:
    __complex double
    foo (__complex double a, __complex double b)
    {
      return a * b;
    }

With GCC trunk at -Ofast I see on aarch64:
foo(double _Complex, double _Complex):
        fmov    d31, d1
        fmul    d1, d1, d2
        fmadd   d1, d0, d3, d1
        fmul    d31, d31, d3
        fnmsub  d0, d0, d2, d31
        ret

with GCC 10 the codegen used to be tighter:
foo(double _Complex, double _Complex):
        fmul    d4, d1, d3
        fmul    d5, d1, d2
        fmadd   d1, d0, d3, d5
        fnmsub  d0, d0, d2, d4
        ret

There's an extra fmov emitted on trunk.
I noticed this regressed with the GCC 11 series

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

end of thread, other threads:[~2024-03-07 21:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-12  9:43 [Bug middle-end/111782] New: [11/12/13/14 Regression] Extra move in complex double multiplication ktkachov at gcc dot gnu.org
2023-10-12 10:46 ` [Bug middle-end/111782] " rguenth at gcc dot gnu.org
2023-10-12 21:42 ` [Bug rtl-optimization/111782] " pinskia at gcc dot gnu.org
2023-10-12 21:55 ` [Bug rtl-optimization/111782] [11/12/13/14 Regression] Extra move in double argument and multiplication and return pinskia at gcc dot gnu.org
2024-03-07 21:05 ` [Bug rtl-optimization/111782] [11/12/13/14 Regression] Extra move with arguments and returns and still using the argument for the last statement 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).