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/61423] Incorrect conversion from unsigned int to floating point


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Target|                            |i?86-*-*
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-06-06
          Component|c                           |target
     Ever confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  Works with -mfpmath=sse.  Initial RTL looks ok to me:

(insn 21 20 22 (set (reg:SI 99 [ stmp_sum_5.8 ])
        (vec_select:SI (reg:V4SI 98 [ vect_sum_5.9 ])
            (parallel [
                    (const_int 0 [0])
                ]))) -1
     (nil))

(insn 22 21 23 (parallel [
            (set (reg:DF 97 [ t ])
                (unsigned_float:DF (reg:SI 99 [ stmp_sum_5.8 ])))
            (clobber (mem/c:DI (plus:SI (reg/f:SI 78 virtual-stack-vars)
                        (const_int -8 [0xfffffffffffffff8])) [0  S8 A64]))
            (clobber (scratch:SI))
        ]) t.c:18 -1
     (nil))

(insn 23 22 24 (set (reg:DF 94 [ <retval> ])
        (reg:DF 97 [ t ])) t.c:19 -1
     (nil))

So it must be a bogus *floatunssidf2_1 pattern

(insn 22 21 28 4 (parallel [
            (set (reg:DF 8 st [orig:97 t ] [97])
                (unsigned_float:DF (reg:SI 21 xmm0 [orig:99 stmp_sum_5.8 ]
[99])))
            (clobber (mem/c:DI (plus:SI (reg/f:SI 7 sp)
                        (const_int 8 [0x8])) [0  S8 A64]))
            (clobber (scratch:SI))
        ]) t.c:18 211 {*floatunssidf2_1}
     (nil))

split to

(insn 39 38 40 4 (set (mem/c:DI (plus:SI (reg/f:SI 7 sp)
                (const_int 8 [0x8])) [0  S8 A64])
        (reg:DI 21 xmm0 [orig:99 stmp_sum_5.8 ] [99])) t.c:18 89
{*movdi_internal}   
     (nil))
(insn 40 39 28 4 (set (reg:DF 8 st [orig:97 t ] [97])
        (float:DF (mem/c:DI (plus:SI (reg/f:SI 7 sp)
                    (const_int 8 [0x8])) [0  S8 A64]))) t.c:18 206
{*floatdidf2_i387}
     (nil))

note the use of a DImode memory but the missing zero-extend of xmm0:DI.


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