Bug 37074 - gcc.dg/torture/stackalign/builtin-apply-4.c failed with SSE2
Summary: gcc.dg/torture/stackalign/builtin-apply-4.c failed with SSE2
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.5.0
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords:
: 41392 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-08-10 20:17 UTC by H.J. Lu
Modified: 2010-02-26 14:49 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2008-08-10 20:17:45 UTC
gcc.dg/torture/stackalign/builtin-apply-4.c failed with SSE2. The
problem is MMX enabled with SSE2, but builtin-apply-4.c mixes mmx
and x87 instructions without emms in between.
Comment 1 H.J. Lu 2008-08-10 20:23:26 UTC
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00664.html
Comment 2 H.J. Lu 2009-09-18 03:26:41 UTC
*** Bug 41392 has been marked as a duplicate of this bug. ***
Comment 3 H.J. Lu 2010-02-26 14:05:53 UTC
gcc.dg/torture/stackalign/builtin-apply-4.c will
fail on x86-64 since -march=x86_64 will be added
by default since:

http://gcc.gnu.org/ml/gcc-cvs/2010-02/msg00664.html
Comment 4 Uroš Bizjak 2010-02-26 14:24:50 UTC
(In reply to comment #3)

MMX arguments are passed via %mm registers when __builtin_apply_args is used. Touching %mm in any way will switch FP regstack to MMX mode, and since no emms is emitted, reading %st will always return NaN.

[There were proposals to obsolete __bultin_apply, so who cares.]

Your patch from comment #1 is OK.
Comment 5 hjl@gcc.gnu.org 2010-02-26 14:49:18 UTC
Subject: Bug 37074

Author: hjl
Date: Fri Feb 26 14:49:02 2010
New Revision: 157089

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157089
Log:
Add -mno-mmx to x86 in gcc.dg/torture/stackalign/stackalign.exp.

2010-02-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR testsuite/37074:
	* gcc.dg/torture/stackalign/stackalign.exp: Add -mno-mmx to x86.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp

Comment 6 H.J. Lu 2010-02-26 14:49:51 UTC
Fixed in 4.5.0.
Comment 7 hjl@gcc.gnu.org 2010-08-14 02:29:15 UTC
Subject: Bug 37074

Author: hjl
Date: Sat Aug 14 02:28:57 2010
New Revision: 163239

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163239
Log:
Support --with-fpmath=sse for x86.

gcc/

2010-08-13  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline
	2010-02-26  H.J. Lu  <hongjiu.lu@intel.com>

	* config.gcc: Support --with-fpmath=sse for x86.

	* config/i386/ssemath.h: New.

	* doc/install.texi (--with-fpmath=sse): Documented.

gcc/testsuite/

2010-08-13  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline
	2010-02-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR testsuite/37074:
	* gcc.dg/torture/stackalign/stackalign.exp: Add -mno-mmx to x86.

Added:
    branches/ix86/gcc-4_4-branch/gcc/config/i386/ssemath.h
Modified:
    branches/ix86/gcc-4_4-branch/gcc/ChangeLog.ix86
    branches/ix86/gcc-4_4-branch/gcc/config.gcc
    branches/ix86/gcc-4_4-branch/gcc/doc/install.texi
    branches/ix86/gcc-4_4-branch/gcc/testsuite/ChangeLog.ix86
    branches/ix86/gcc-4_4-branch/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp