public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/64243] New: Passing and returning structures with single member of floating type via SSE registers is wrong on Windows x86-64 ABI
@ 2014-12-09 16:43 krzysztof.surdacki at gmail dot com
  2020-12-29 23:16 ` [Bug target/64243] " bart at bartjanssens dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: krzysztof.surdacki at gmail dot com @ 2014-12-09 16:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64243
           Summary: Passing and returning structures with single member of
                    floating type via SSE registers is wrong on Windows
                    x86-64 ABI
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: krzysztof.surdacki at gmail dot com

Two types of structures:

struct TestFloat { float x; };
struct TestDouble { double x; };

are passed and returned via SSE registers which is wrong in Windows x86-64 ABI.
According to Microsoft documentation:
http://msdn.microsoft.com/en-us/library/zthk2dkh.aspx
http://msdn.microsoft.com/en-us/library/7572ztz4.aspx
and code generated by MSVS2013 analysis, this kind of structures should be
passed via integer registers (RCX, RDX, R8, and R9) and returned in RAX
register.


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

* [Bug target/64243] Passing and returning structures with single member of floating type via SSE registers is wrong on Windows x86-64 ABI
  2014-12-09 16:43 [Bug target/64243] New: Passing and returning structures with single member of floating type via SSE registers is wrong on Windows x86-64 ABI krzysztof.surdacki at gmail dot com
@ 2020-12-29 23:16 ` bart at bartjanssens dot org
  2020-12-30  8:02 ` ubizjak at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bart at bartjanssens dot org @ 2020-12-29 23:16 UTC (permalink / raw)
  To: gcc-bugs

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

Bart Janssens <bart at bartjanssens dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bart at bartjanssens dot org

--- Comment #3 from Bart Janssens <bart at bartjanssens dot org> ---
We are still having this issue, it now manifests in cross-compiled binaries
used in the Julia ecosystem, see:
https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/315

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

* [Bug target/64243] Passing and returning structures with single member of floating type via SSE registers is wrong on Windows x86-64 ABI
  2014-12-09 16:43 [Bug target/64243] New: Passing and returning structures with single member of floating type via SSE registers is wrong on Windows x86-64 ABI krzysztof.surdacki at gmail dot com
  2020-12-29 23:16 ` [Bug target/64243] " bart at bartjanssens dot org
@ 2020-12-30  8:02 ` ubizjak at gmail dot com
  2020-12-30  9:06 ` ubizjak at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2020-12-30  8:02 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |10walls at gmail dot com

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
Adding CC.

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

* [Bug target/64243] Passing and returning structures with single member of floating type via SSE registers is wrong on Windows x86-64 ABI
  2014-12-09 16:43 [Bug target/64243] New: Passing and returning structures with single member of floating type via SSE registers is wrong on Windows x86-64 ABI krzysztof.surdacki at gmail dot com
  2020-12-29 23:16 ` [Bug target/64243] " bart at bartjanssens dot org
  2020-12-30  8:02 ` ubizjak at gmail dot com
@ 2020-12-30  9:06 ` ubizjak at gmail dot com
  2020-12-30  9:25 ` ubizjak at gmail dot com
  2020-12-30 21:20 ` bart at bartjanssens dot org
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2020-12-30  9:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Uroš Bizjak <ubizjak at gmail dot com> ---
This is fixed in gcc-11:

--cut here--
struct TestFloat { float x; };
struct TestDouble { double x; };

struct TestFloat foo (struct TestFloat x) { return x; }
struct TestDouble bar (struct TestDouble x) { return x; }
--cut here--

gcc -O2:

foo:
        movl    %ecx, %eax
        ret

bar:
        movq    %rcx, %rax
        ret

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

* [Bug target/64243] Passing and returning structures with single member of floating type via SSE registers is wrong on Windows x86-64 ABI
  2014-12-09 16:43 [Bug target/64243] New: Passing and returning structures with single member of floating type via SSE registers is wrong on Windows x86-64 ABI krzysztof.surdacki at gmail dot com
                   ` (2 preceding siblings ...)
  2020-12-30  9:06 ` ubizjak at gmail dot com
@ 2020-12-30  9:25 ` ubizjak at gmail dot com
  2020-12-30 21:20 ` bart at bartjanssens dot org
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2020-12-30  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
      Known to work|                            |9.3.1
         Resolution|---                         |FIXED
      Known to fail|                            |8.4.1

--- Comment #6 from Uroš Bizjak <ubizjak at gmail dot com> ---
Fixed in gcc-9.

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

* [Bug target/64243] Passing and returning structures with single member of floating type via SSE registers is wrong on Windows x86-64 ABI
  2014-12-09 16:43 [Bug target/64243] New: Passing and returning structures with single member of floating type via SSE registers is wrong on Windows x86-64 ABI krzysztof.surdacki at gmail dot com
                   ` (3 preceding siblings ...)
  2020-12-30  9:25 ` ubizjak at gmail dot com
@ 2020-12-30 21:20 ` bart at bartjanssens dot org
  4 siblings, 0 replies; 6+ messages in thread
From: bart at bartjanssens dot org @ 2020-12-30 21:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Bart Janssens <bart at bartjanssens dot org> ---
Thanks, confirmed that this is also working on GCC 10.2. Unfortunately the
latest in our compiler images is 9.1, and that seems to be still affected, so
we'll have to upgrade.

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

end of thread, other threads:[~2020-12-30 21:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-09 16:43 [Bug target/64243] New: Passing and returning structures with single member of floating type via SSE registers is wrong on Windows x86-64 ABI krzysztof.surdacki at gmail dot com
2020-12-29 23:16 ` [Bug target/64243] " bart at bartjanssens dot org
2020-12-30  8:02 ` ubizjak at gmail dot com
2020-12-30  9:06 ` ubizjak at gmail dot com
2020-12-30  9:25 ` ubizjak at gmail dot com
2020-12-30 21:20 ` bart at bartjanssens dot 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).