returning struct or union with just double on Win32/x86

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

returning struct or union with just double on Win32/x86

Jay-93
typedef struct { double d; } Struct;


Struct f1 ()
{
Struct res = {3.0};
return res;
}

typedef union { double d; } Union;


Union f2 ()
{
Union res = {3.0};
return res;
}

x86 mingw 7.3.0

The first returns in ST0, the  second in edx:eax.

Msvc returns first in edx:eax.

Seems like a bug?

Thank you,
 - Jay
Reply | Threaded
Open this post in threaded view
|

Re: returning struct or union with just double on Win32/x86

Jonathan Wakely-4
On Tue, 4 Dec 2018 at 10:19, Jay K wrote:
> Seems like a bug?

Then it should be reported to Bugzilla, not this mailing list. See
https://gcc.gnu.org/bugs/