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

2008-02-06 Thread uros at gcc dot gnu dot org


--- Comment #8 from uros at gcc dot gnu dot org  2008-02-06 10:46 ---
Subject: Bug 35083

Author: uros
Date: Wed Feb  6 10:45:29 2008
New Revision: 132144

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=132144
Log:
PR target/35083
* optabs.c (expand_float): Do not check for decimal modes when
expanding unsigned integer through signed conversion.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/optabs.c


-- 


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



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

2008-02-06 Thread ubizjak at gmail dot com


--- Comment #9 from ubizjak at gmail dot com  2008-02-06 11:11 ---
Fixed.


-- 

ubizjak at gmail dot com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



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

2008-02-06 Thread corsepiu at gcc dot gnu dot org


--- Comment #10 from corsepiu at gcc dot gnu dot org  2008-02-06 12:03 
---
Thanks Uros, i386-rtems*-gcc now bootstraps again.


-- 


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



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

2008-02-05 Thread ubizjak at gmail dot com


--- Comment #3 from ubizjak at gmail dot com  2008-02-05 08:26 ---
Mine.


-- 

ubizjak at gmail dot com changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |ubizjak at gmail dot com
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2008-02-05 07:33:45 |2008-02-05 08:26:16
   date||


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



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

2008-02-05 Thread ubizjak at gmail dot com


--- Comment #5 from ubizjak at gmail dot com  2008-02-05 09:45 ---
optabs.c, line 5150:

--cut here--
  /* Unsigned integer, and no way to convert directly.  Convert as signed,
 then unconditionally adjust the result.  For decimal float values we
 do this only if we have already determined that a signed conversion
 provides sufficient accuracy.  */
  if (unsignedp  (can_do_signed || !DECIMAL_FLOAT_MODE_P (GET_MODE (to
--cht here--

Hm? We shortcut with !DECIMAL_FLOAT_MODE_P (...) here. Janis?


-- 


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



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

2008-02-05 Thread ubizjak at gmail dot com


--- 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
movl8(%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
movl8(%ebp), %eax
movl%eax, (%esp)
call__floatunsisf
leave
ret

This is probably due to:

2007-09-05  Janis Johnson  [EMAIL PROTECTED]

* 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



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

2008-02-05 Thread rguenth at gcc dot gnu dot org


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
   Priority|P3  |P2


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



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

2008-02-05 Thread uros at gcc dot gnu dot org


--- Comment #6 from uros at gcc dot gnu dot org  2008-02-05 11:28 ---
Subject: Bug 35083

Author: uros
Date: Tue Feb  5 11:27:41 2008
New Revision: 132114

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=132114
Log:
PR target/35083
* config/i386/i386.md (floatunsisf2): Enable for TARGET_SSE_MATH only.
Call ix86_expand_convert_uns_sisf_sse for TARGET_SSE2.

testsuite/ChangeLog:

PR target/35083
* gcc.target/i386/pr35083.c: New test.


Added:
trunk/gcc/testsuite/gcc.target/i386/pr35083.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.md
trunk/gcc/testsuite/ChangeLog


-- 


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



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

2008-02-05 Thread ubizjak at gmail dot com


--- Comment #7 from ubizjak at gmail dot com  2008-02-05 13:58 ---
This is the diff of expand_float() between gcc-4.2 and gcc-4.3. The relevant
part is logic at the top of the diff that has changed substantially:

--- 222 2008-02-05 14:52:52.0 +0100
+++ 111 2008-02-05 14:52:32.0 +0100
@@ -52,11 +52,10 @@
  }
   }

-  /* Unsigned integer, and no way to convert directly.  Convert as signed,
- then unconditionally adjust the result.  For decimal float values we
- do this only if we have already determined that a signed conversion
- provides sufficient accuracy.  */
-  if (unsignedp  (can_do_signed || !DECIMAL_FLOAT_MODE_P (GET_MODE (to
+  /* Unsigned integer, and no way to convert directly.  For binary
+ floating point modes, convert as signed, then conditionally adjust
+ the result.  */
+  if (unsignedp  can_do_signed  !DECIMAL_FLOAT_MODE_P (GET_MODE (to)))
 {
   rtx label = gen_label_rtx ();
   rtx temp;
@@ -147,7 +146,7 @@
   0, label);


-  real_2expN (offset, GET_MODE_BITSIZE (GET_MODE (from)), fmode);
+  real_2expN (offset, GET_MODE_BITSIZE (GET_MODE (from)));
   temp = expand_binop (fmode, add_optab, target,
   CONST_DOUBLE_FROM_REAL_VALUE (offset, fmode),
   target, 0, OPTAB_LIB_WIDEN);
@@ -169,7 +168,7 @@
   if (GET_MODE_SIZE (GET_MODE (from))  GET_MODE_SIZE (SImode))
from = convert_to_mode (SImode, from, unsignedp);

-  libfunc = convert_optab_libfunc (tab, GET_MODE (to), GET_MODE (from));
+  libfunc = tab-handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
   gcc_assert (libfunc);

   start_sequence ();


-- 

ubizjak at gmail dot com changed:

   What|Removed |Added

 AssignedTo|ubizjak at gmail dot com|unassigned at gcc dot gnu
   ||dot org
 Status|ASSIGNED|NEW


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



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

2008-02-04 Thread ubizjak at gmail dot com


--- Comment #2 from ubizjak at gmail dot com  2008-02-05 07:33 ---
Confirmed.

The testcase:

float test(unsigned int x)
{
  return (float)x;
}

gcc -O2 -mno-80387

t.c: In function âtestâ:
t.c:4: error: unrecognizable insn:
(insn 20 19 21 5 t.c:2 (set (reg:SF 60)
(plus:SF (reg:SF 61)
(reg:SF 61))) -1 (nil))
t.c:4: internal compiler error: in extract_insn, at recog.c:1990
Please submit a full bug report,


-- 

ubizjak at gmail dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
 GCC target triplet|i386-rtems* |i386-*-*
   Last reconfirmed|-00-00 00:00:00 |2008-02-05 07:33:45
   date||
Summary|ICE: in extract_insn, at|[4.3 regression] ICE: in
   |recog.c:1990|extract_insn, at
   ||recog.c:1990
   Target Milestone|--- |4.3.0


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