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] Fix PR28158, ICE on valid code due to bogus negdf2 pattern


This fixes PR28158 by fixing the *negdf2_1 pattern to be enabled for
-msse -mfpmath=sse.  The *absdf2_1 pattern has the same problem.

Bootstrapped and tested on i686-pc-linux-gnu.

Ok for mainline?

Thanks,
Richard.

:ADDPATCH i386:

2006-07-04  Richard Guenther  <rguenther@suse.de>

	PR target/28158
	* config/i386/i386.md (*negdf2_1): Restrict pattern to
	TARGET_SSE2 targets if using SSE math.
	(*absdf2_1): Likewise.

	* gfortran.dg/pr28158.f90: New testcase.

Index: config/i386/i386.md
===================================================================
*** config/i386/i386.md	(revision 115175)
--- config/i386/i386.md	(working copy)
*************** (define_insn "*negsf2_1"
*** 9913,9919 ****
  (define_insn "*negdf2_1"
    [(set (match_operand:DF 0 "register_operand" "=f")
  	(neg:DF (match_operand:DF 1 "register_operand" "0")))]
!   "TARGET_80387 && (reload_completed || !TARGET_SSE_MATH)"
    "fchs"
    [(set_attr "type" "fsgn")
     (set_attr "mode" "DF")])
--- 9913,9919 ----
  (define_insn "*negdf2_1"
    [(set (match_operand:DF 0 "register_operand" "=f")
  	(neg:DF (match_operand:DF 1 "register_operand" "0")))]
!   "TARGET_80387 && (reload_completed || !(TARGET_SSE2 && TARGET_SSE_MATH))"
    "fchs"
    [(set_attr "type" "fsgn")
     (set_attr "mode" "DF")])
*************** (define_insn "*abssf2_1"
*** 9937,9943 ****
  (define_insn "*absdf2_1"
    [(set (match_operand:DF 0 "register_operand" "=f")
  	(abs:DF (match_operand:DF 1 "register_operand" "0")))]
!   "TARGET_80387 && (reload_completed || !TARGET_SSE_MATH)"
    "fabs"
    [(set_attr "type" "fsgn")
     (set_attr "mode" "DF")])
--- 9937,9943 ----
  (define_insn "*absdf2_1"
    [(set (match_operand:DF 0 "register_operand" "=f")
  	(abs:DF (match_operand:DF 1 "register_operand" "0")))]
!   "TARGET_80387 && (reload_completed || !(TARGET_SSE2 && TARGET_SSE_MATH))"
    "fabs"
    [(set_attr "type" "fsgn")
     (set_attr "mode" "DF")])
Index: testsuite/gfortran.dg/pr28158.f90
===================================================================
*** testsuite/gfortran.dg/pr28158.f90	(revision 0)
--- testsuite/gfortran.dg/pr28158.f90	(revision 0)
***************
*** 0 ****
--- 1,7 ----
+ ! { dg-do compile { target i?86-*-* x86_64-*-* } }
+ ! { dg-require-effective-target ilp32 }
+ ! { dg-options "-O -msse -mfpmath=sse" }
+     subroutine yhalf(z)
+     complex cdexpj,z
+     z=cdexpj((0.d0,1.d0)*z)
+     end


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