This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: PR6445


This is the final version of the much-discussed patch for the
__builtin_apply crash with respect to -msoft-float on x86.

Bootstrapped, tested on i686-pc-linux-gnu, applied on the mainline and
on the branch.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2002-04-26  Mark Mitchell  <mark@codesourcery.com>

	PR bootstrap/6445
	* config/i386/i386.md (untyped_call): Return the value in a float
	register if TARGET_FLOAT_RETURNS_IN_80387, not just if
	TARGET_80387.

2002-04-26  Mark Mitchell  <mark@codesourcery.com>

	PR bootstrap/6445
	* gcc.dg/20020426-1.c: New test.

Index: config/i386/i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.339.2.6
diff -c -p -r1.339.2.6 i386.md
*** config/i386/i386.md	20 Apr 2002 00:24:50 -0000	1.339.2.6
--- config/i386/i386.md	26 Apr 2002 21:07:19 -0000
***************
*** 13694,13700 ****
       simply pretend the untyped call returns a complex long double
       value.  */

!   emit_call_insn (TARGET_80387
                    ? gen_call_value (gen_rtx_REG (XCmode, FIRST_FLOAT_REG),
  				    operands[0], const0_rtx,
  				    GEN_INT (SSE_REGPARM_MAX - 1))
--- 13694,13700 ----
       simply pretend the untyped call returns a complex long double
       value.  */

!   emit_call_insn (TARGET_FLOAT_RETURNS_IN_80387
                    ? gen_call_value (gen_rtx_REG (XCmode, FIRST_FLOAT_REG),
  				    operands[0], const0_rtx,
  				    GEN_INT (SSE_REGPARM_MAX - 1))

Index: testsuite/gcc.dg/20020426-1.c
===================================================================
RCS file: testsuite/gcc.dg/20020426-1.c
diff -N testsuite/gcc.dg/20020426-1.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.dg/20020426-1.c	26 Apr 2002 21:07:22 -0000
***************
*** 0 ****
--- 1,6 ----
+ /* { dg-do compile { target i?86-*-* } } */
+ /* { dg-options "-msoft-float -mfp-ret-in-387" } */
+
+ void f() {
+   __builtin_apply(0, 0, 0);
+ }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]