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]

powerpc64 -msoft-float ice


powerpc64-linux-gcc -c -O2 -msoft-float on the following testcase (origin
Math.java) results in an ICE.

double max (double a, double b)
{
  if (a != a)
    return a;
  if (a == 0 && b == 0)
    return a - -b;
  return (a > b) ? a : b;
}

error: insn does not satisfy its constraints:
(insn:HI 74 97 78 8 (set (reg:DF ctr [orig:118 <result> ] [118])
        (reg:DF ctr [orig:130 a ] [130])) 312 {*movdf_softfloat64} (insn_list:REG_DEP_OUTPUT 22 (insn_list 68 (insn_list 72 (insn_list:REG_DEP_ANTI 61 (nil)))))
    (nil))

The testcase compiles if using float instead of double, which led me to
movsf_softfloat.  The following copies the nop in that pattern to the
corresponding movdf pattern, and voila, fixes the problem.

	* config/rs6000/rs6000.md (movdf_softfloat64): Allow dummy ctr,ctr
	moves.

powerpc-linux bootstrap in progress, powerpc64-linux regression testing
in progress.  Assuming all is good, OK mainline?

diff -urp gcc-current/gcc/config/rs6000/rs6000.md gcc-ppc64-34/gcc/config/rs6000/rs6000.md
--- gcc-current/gcc/config/rs6000/rs6000.md	2003-10-28 21:41:04.000000000 +1030
+++ gcc-ppc64-34/gcc/config/rs6000/rs6000.md	2003-10-28 21:42:42.000000000 +1030
@@ -8160,8 +8160,8 @@
    (set_attr "length" "4,4,4,4,4,4,4,4,8,12,16")])
 
 (define_insn "*movdf_softfloat64"
-  [(set (match_operand:DF 0 "nonimmediate_operand" "=r,cl,r,r,m,r,r,r")
-	(match_operand:DF 1 "input_operand" "r,r,h,m,r,G,H,F"))]
+  [(set (match_operand:DF 0 "nonimmediate_operand" "=r,cl,r,r,m,r,r,r,*h")
+	(match_operand:DF 1 "input_operand" "r,r,h,m,r,G,H,F,0"))]
   "TARGET_POWERPC64 && (TARGET_SOFT_FLOAT || !TARGET_FPRS)
    && (gpc_reg_operand (operands[0], DFmode)
        || gpc_reg_operand (operands[1], DFmode))"
@@ -8173,9 +8173,10 @@
    std%U0%X0 %1,%0
    #
    #
-   #"
-  [(set_attr "type" "*,*,*,load,store,*,*,*")
-   (set_attr "length" "4,4,4,4,4,8,12,16")])
+   #
+   nop"
+  [(set_attr "type" "*,*,*,load,store,*,*,*,*")
+   (set_attr "length" "4,4,4,4,4,8,12,16,4")])
 
 (define_expand "movtf"
   [(set (match_operand:TF 0 "general_operand" "")

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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