[PATCH] Fix PR11674

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Wed Sep 17 14:40:00 GMT 2003


Hello,

this bug is caused by this pattern in md:

(define_expand "floatunssisf2"
  [(use (match_operand:SF 0 "register_operand" ""))
   (use (match_operand:SI 1 "register_operand" ""))]
  "TARGET_SSE && TARGET_SSE_MATH && !TARGET_64BIT"
  "x86_emit_floatuns (operands); DONE;")

x86_emit_floatuns only works for DImode.  I am not sure what was the
intent here, but making x86_emit_floatuns to also handle SImode
seems to solve the problem.

Zdenek

	* config/i386/i386.c (x86_emit_floatuns): Also handle SImode
	operand.

Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.600
diff -c -3 -p -r1.600 i386.c
*** config/i386/i386.c	8 Sep 2003 06:41:42 -0000	1.600
--- config/i386/i386.c	17 Sep 2003 14:35:50 -0000
*************** x86_extended_reg_mentioned_p (rtx insn)
*** 15621,15637 ****
    return for_each_rtx (&PATTERN (insn), extended_reg_mentioned_1, NULL);
  }
  
! /* Generate an unsigned DImode to FP conversion.  This is the same code
     optabs would emit if we didn't have TFmode patterns.  */
  
  void
  x86_emit_floatuns (rtx operands[2])
  {
    rtx neglab, donelab, i0, i1, f0, in, out;
!   enum machine_mode mode;
  
    out = operands[0];
!   in = force_reg (DImode, operands[1]);
    mode = GET_MODE (out);
    neglab = gen_label_rtx ();
    donelab = gen_label_rtx ();
--- 15621,15642 ----
    return for_each_rtx (&PATTERN (insn), extended_reg_mentioned_1, NULL);
  }
  
! /* Generate an unsigned DImode/SImode to FP conversion.  This is the same code
     optabs would emit if we didn't have TFmode patterns.  */
  
  void
  x86_emit_floatuns (rtx operands[2])
  {
    rtx neglab, donelab, i0, i1, f0, in, out;
!   enum machine_mode mode, inmode;
! 
!   inmode = GET_MODE (operands[1]);
!   if (inmode != SImode
!       && inmode != DImode)
!     abort ();
  
    out = operands[0];
!   in = force_reg (inmode, operands[1]);
    mode = GET_MODE (out);
    neglab = gen_label_rtx ();
    donelab = gen_label_rtx ();



More information about the Gcc-patches mailing list