Float arguments are passed incorrectly from a ms_abi function to a sysv function, as can be witnessed by a simple testcase, which fails on all optimizations. I don't think this is a regression, as wine always failed on that testcase.
Created attachment 20474 [details] testcase testcase that fails
This works with: GNU C (GCC) version 4.6.0 20100422 (experimental) [trunk revision 158652] (x86_64-unknown-linux-gnu)
(In reply to comment #2) > This works with: > GNU C (GCC) version 4.6.0 20100422 (experimental) [trunk revision 158652] > (x86_64-unknown-linux-gnu) > I take that back, it still fails, for some reason I thought the testcase was using abort to test for a failure rather than the return value.
Created attachment 20483 [details] Patch that fixes the testcase It appears that SSE_REGPARM_MAX will change based on ix86_cfun_abi(), so using SSE_REGPARM_MAX will cause sse regparm max to be 4, if calling a sysv function from a ms_abi function. The attached patch will clean up some of the issues. setup_incoming_varargs_64 will also assume the sysv abi now, since setup_incoming_varargs_ms_64 is a separate function
Subject: Bug 43869 Author: ktietz Date: Sun May 23 06:51:50 2010 New Revision: 159754 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159754 Log: 2010-05-23 Naarten Lankhorst <mlankhorst@codeweavers.com> PR target/43869 * gcc.c-target/pr43869.c: New test. Added: trunk/gcc/testsuite/gcc.target/i386/pr43869.c (with props) Modified: trunk/gcc/testsuite/ChangeLog Propchange: trunk/gcc/testsuite/gcc.target/i386/pr43869.c ('svn:eol-style' added) Propchange: trunk/gcc/testsuite/gcc.target/i386/pr43869.c ('svn:mime-type' added)
Subject: Bug 43869 Author: ktietz Date: Sun May 23 06:52:32 2010 New Revision: 159755 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159755 Log: 2010-05-23 Naarten Lankhorst <mlankhorst@codeweavers.com> PR target/43869 * config/i386/i386.c: Make sure that the correct regparm is passed. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386.c
Subject: Bug 43869 Author: ktietz Date: Sun May 23 06:57:20 2010 New Revision: 159756 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159756 Log: 2010-05-23 Naarten Lankhorst <mlankhorst@codeweavers.com> Merged from trunk PR target/43869 * config/i386/i386.c: Make sure that the correct regparm is passed. 2010-05-23 Naarten Lankhorst <mlankhorst@codeweavers.com> Merged from trunk PR target/43869 * gcc.c-target/pr43869.c: New test. Added: branches/gcc-4_5-branch/gcc/testsuite/gcc.target/i386/pr43869.c (with props) Modified: branches/gcc-4_5-branch/gcc/ChangeLog branches/gcc-4_5-branch/gcc/config/i386/i386.c branches/gcc-4_5-branch/gcc/testsuite/ChangeLog Propchange: branches/gcc-4_5-branch/gcc/testsuite/gcc.target/i386/pr43869.c ('svn:eol-style' added) Propchange: branches/gcc-4_5-branch/gcc/testsuite/gcc.target/i386/pr43869.c ('svn:mime-type' added)
Fixed on trunk and back-merged to gcc-4_5 branch.