This is the mail archive of the gcc-bugs@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]

[Bug target/35083] [4.3 regression] ICE: in extract_insn, at recog.c:1990



------- Comment #4 from ubizjak at gmail dot com  2008-02-05 09:36 -------
Following patch fixes ICE (and avoids nasty runtime/code-size regression for
x87 math where we don't use fildll):

--cut here--
Index: config/i386/i386.md
===================================================================
--- config/i386/i386.md (revision 132088)
+++ config/i386/i386.md (working copy)
@@ -5306,9 +5306,9 @@
 (define_expand "floatunssisf2"
   [(use (match_operand:SF 0 "register_operand" ""))
    (use (match_operand:SI 1 "nonimmediate_operand" ""))]
-  "!TARGET_64BIT"
+  "!TARGET_64BIT && TARGET_SSE_MATH"
 {
-  if (TARGET_SSE_MATH && TARGET_SSE2)
+  if (TARGET_SSE2)
     ix86_expand_convert_uns_sisf_sse (operands[0], operands[1]);
   else
     x86_emit_floatuns (operands);
--cut here--

but there is another problem for soft-float, where neither signed or unsigned
float pattern is provided. Instead of calling __floatunssfsi() directly for
soft-float targets, we expand as:

test:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $24, %esp
        movl    8(%ebp), %edx
        testl   %edx, %edx
        js      .L3
        movl    %edx, (%esp)
        call    __floatsisf
        leave
        ret
.L3:
        movl    %edx, %eax
        andl    $1, %eax
        shrl    %edx
        orl     %edx, %eax
        movl    %eax, (%esp)
        call    __floatsisf
        movl    %eax, 4(%esp)
        movl    %eax, (%esp)
        call    __addsf3
        leave
        ret

This is a huge code-size (and performance?) regression from 4.2 where we
generated:

test:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $24, %esp
        movl    8(%ebp), %eax
        movl    %eax, (%esp)
        call    __floatunsisf
        leave
        ret

This is probably due to:

        2007-09-05  Janis Johnson  <janis187@us.ibm.com>

        * optabs.c (expand_float): Convert unsigned integer as signed only
        if it provides sufficient accuracy; add mode argument to real_2expN.
        ...


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janis at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35083


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