[Bug target/61423] Incorrect conversion from unsigned int to floating point

2014-06-18 Thread uros at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423

--- Comment #13 from uros at gcc dot gnu.org ---
Author: uros
Date: Wed Jun 18 20:01:37 2014
New Revision: 211803

URL: https://gcc.gnu.org/viewcvs?rev=211803root=gccview=rev
Log:
Backport from mainline
2014-06-06  Uros Bizjak  ubiz...@gmail.com

PR target/61423
* config/i386/i386.md (*floatunssimode2_i387_with_xmm): New
define_insn_and_split pattern, merged from *floatunssimode2_1
and corresponding splitters.  Zero extend general register
or memory input operand to XMM temporary.  Enable for
TARGET_SSE2 and TARGET_INTER_UNIT_MOVES_TO_VEC only.
(floatunssimode2): Update expander predicate.

testsuite/ChangeLog:

Backport from mainline
2014-06-13  Ilya Enkovich  ilya.enkov...@intel.com

PR rtl-optimization/61094
PR rtl-optimization/61446
* gcc.target/i386/pr61446.c : New.

Backport from mainline
2014-06-06  Uros Bizjak  ubiz...@gmail.com

PR target/61423
* gcc.target/i386/pr61423.c: New test.


Added:
branches/gcc-4_8-branch/gcc/testsuite/gcc.target/i386/pr61423.c
branches/gcc-4_8-branch/gcc/testsuite/gcc.target/i386/pr61446.c
Modified:
branches/gcc-4_8-branch/gcc/ChangeLog
branches/gcc-4_8-branch/gcc/config/i386/i386.md
branches/gcc-4_8-branch/gcc/testsuite/ChangeLog


[Bug target/61423] Incorrect conversion from unsigned int to floating point

2014-06-18 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423

Uroš Bizjak ubizjak at gmail dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |4.8.4

--- Comment #14 from Uroš Bizjak ubizjak at gmail dot com ---
Fixed in all release branches.

[Bug target/61423] Incorrect conversion from unsigned int to floating point

2014-06-16 Thread uros at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423

--- Comment #12 from uros at gcc dot gnu.org ---
Author: uros
Date: Tue Jun 17 05:00:52 2014
New Revision: 211723

URL: https://gcc.gnu.org/viewcvs?rev=211723root=gccview=rev
Log:
Backport from mainline
2014-06-06  Uros Bizjak  ubiz...@gmail.com

PR target/61423
* config/i386/i386.md (*floatunssimode2_i387_with_xmm): New
define_insn_and_split pattern, merged from *floatunssimode2_1
and corresponding splitters.  Zero extend general register
or memory input operand to XMM temporary.  Enable for
TARGET_SSE2 and TARGET_INTER_UNIT_MOVES_TO_VEC only.
(floatunssimode2): Update expander predicate.

testsuite/ChangeLog:

Backport from mainline
2014-06-06  Uros Bizjak  ubiz...@gmail.com

PR target/61423
* gcc.target/i386/pr61423.c: New test.


Added:
branches/gcc-4_9-branch/gcc/testsuite/gcc.target/i386/pr61423.c
Modified:
branches/gcc-4_9-branch/gcc/ChangeLog
branches/gcc-4_9-branch/gcc/config/i386/i386.md
branches/gcc-4_9-branch/gcc/testsuite/ChangeLog


[Bug target/61423] Incorrect conversion from unsigned int to floating point

2014-06-13 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423
Bug 61423 depends on bug 61446, which changed state.

Bug 61446 Summary: [4.10 Regression]: ICE in copyprop_hardreg_forward_1, at 
regcprop.c with -O2 -m32 -march=corei7
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61446

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED


[Bug target/61423] Incorrect conversion from unsigned int to floating point

2014-06-12 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423

--- Comment #11 from Jeffrey A. Law law at redhat dot com ---
I expect the REE bug to be fixed tomorrow AM (my time).  It's a trivial issue.


[Bug target/61423] Incorrect conversion from unsigned int to floating point

2014-06-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #9 from Jakub Jelinek jakub at gcc dot gnu.org ---
Shouldn't this patch be reverted until REE is fixed?


[Bug target/61423] Incorrect conversion from unsigned int to floating point

2014-06-11 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423

Jeffrey A. Law law at redhat dot com changed:

   What|Removed |Added

 CC||law at redhat dot com

--- Comment #10 from Jeffrey A. Law law at redhat dot com ---
Either way will cause a failure.  This is #1 on my hit list after the regex
problem that's affecting mysql.


[Bug target/61423] Incorrect conversion from unsigned int to floating point

2014-06-08 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423

--- Comment #8 from Uroš Bizjak ubizjak at gmail dot com ---
(In reply to Uroš Bizjak from comment #5)
 Created attachment 32903 [details]
 Testcase that fails in REE pass
 
 This testcase fails with patched gcc in REE pass:

This is now PR61446.

[Bug target/61423] Incorrect conversion from unsigned int to floating point

2014-06-06 Thread rguenth at gcc dot gnu.org
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 [0xfff8])) [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.


[Bug target/61423] Incorrect conversion from unsigned int to floating point

2014-06-06 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423

Uroš Bizjak ubizjak at gmail dot com changed:

   What|Removed |Added

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

--- Comment #3 from Uroš Bizjak ubizjak at gmail dot com ---
Looking into it.

[Bug target/61423] Incorrect conversion from unsigned int to floating point

2014-06-06 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423

--- Comment #4 from Uroš Bizjak ubizjak at gmail dot com ---
Created attachment 32901
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=32901action=edit
Proposed patch

This patch fies invalid code gen, but unfortunately uncovers a problem in REE
pass and fails bootstrap when configured --with-arch=core-avx-i
--with-cpu=core-avx-i.

[Bug target/61423] Incorrect conversion from unsigned int to floating point

2014-06-06 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423

--- Comment #5 from Uroš Bizjak ubizjak at gmail dot com ---
Created attachment 32903
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=32903action=edit
Testcase that fails in REE pass

This testcase fails with patched gcc in REE pass:

cc1 -O2 -m32 -march=corei7 libgcc2.i

/home/uros/gcc-svn/trunk/libgcc/libgcc2.c: In function ‘__fixunssfdi’:
/home/uros/gcc-svn/trunk/libgcc/libgcc2.c:1492:1: error: insn does not satisfy
its constraints:
 }
 ^
(insn 54 11 47 2 (set (reg:DI 0 ax)
(reg:DI 21 xmm0)) /home/uros/gcc-svn/trunk/libgcc/libgcc2.c:1444 89
{*movdi_internal}
 (expr_list:REG_UNUSED (reg:DI 0 ax)
(nil)))
/home/uros/gcc-svn/trunk/libgcc/libgcc2.c:1492:1: internal compiler error: in
copyprop_hardreg_forward_1, at regcprop.c:776
...

_split2 pass produces correct sequence:

(insn 46 11 47 2 (set (reg:DI 21 xmm0 [118])
(zero_extend:DI (reg/v:SI 0 ax [orig:85 hi ] [85])))
/home/uros/gcc-svn/trunk/libgcc/libgcc2.c:1452 133 {*zero_extendsidi2}
 (nil))
(insn 47 46 48 2 (set (mem/c:DI (reg/f:SI 7 sp) [0  S8 A64])
(reg:DI 21 xmm0 [118])) /home/uros/gcc-svn/trunk/libgcc/libgcc2.c:1452
89 {*movdi_internal}
 (nil))
(insn 48 47 13 2 (set (reg:DF 9 st(1) [orig:101 D.6895 ] [101])
(float:DF (mem/c:DI (reg/f:SI 7 sp) [0  S8 A64])))
/home/uros/gcc-svn/trunk/libgcc/libgcc2.c:1452 206 {*floatdidf2_i387}
 (nil))

and _ree pass converts this to:

(insn 11 45 54 2 (set (reg:DI 21 xmm0)
(zero_extend:DI (reg:SI 2 cx [99])))
/home/uros/gcc-svn/trunk/libgcc/libgcc2.c:1444 133 {*zero_extendsidi2}
 (nil))
(insn 54 11 47 2 (set (reg:DI 0 ax)
(reg:DI 21 xmm0)) /home/uros/gcc-svn/trunk/libgcc/libgcc2.c:1444 -1
 (nil))
(insn 47 54 48 2 (set (mem/c:DI (reg/f:SI 7 sp) [0  S8 A64])
(reg:DI 21 xmm0 [118])) /home/uros/gcc-svn/trunk/libgcc/libgcc2.c:1452
89 {*movdi_internal}
 (nil))
(insn 48 47 13 2 (set (reg:DF 9 st(1) [orig:101 D.6895 ] [101])
(float:DF (mem/c:DI (reg/f:SI 7 sp) [0  S8 A64])))
/home/uros/gcc-svn/trunk/libgcc/libgcc2.c:1452 206 {*floatdidf2_i387}
 (nil))


Please note ivalid (insn 54).

[Bug target/61423] Incorrect conversion from unsigned int to floating point

2014-06-06 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423

Uroš Bizjak ubizjak at gmail dot com changed:

   What|Removed |Added

 CC||law at gcc dot gnu.org

--- Comment #6 from Uroš Bizjak ubizjak at gmail dot com ---
Jeff, can you please look at what goes wrong in REE pass?

[Bug target/61423] Incorrect conversion from unsigned int to floating point

2014-06-06 Thread uros at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61423

--- Comment #7 from uros at gcc dot gnu.org ---
Author: uros
Date: Fri Jun  6 17:45:10 2014
New Revision: 211321

URL: http://gcc.gnu.org/viewcvs?rev=211321root=gccview=rev
Log:
PR target/61423
* config/i386/i386.md (*floatunssimode2_i387_with_xmm): New
define_insn_and_split pattern, merged from *floatunssimode2_1
and corresponding splitters.  Zero extend general register
or memory input operand to XMM temporary.  Enable for
TARGET_SSE2 and TARGET_INTER_UNIT_MOVES_TO_VEC only.
(floatunssimode2): Update expander predicate.

testsuite/ChangeLog:

PR target/61423
* gcc.target/i386/pr61423.c: New test.


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