This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/37544] [4.2/4.3/4.4 Regression] Conversion double -> unsigned long long -> unsigned -> double gives wrong results
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Sep 2008 08:14:40 -0000
- Subject: [Bug rtl-optimization/37544] [4.2/4.3/4.4 Regression] Conversion double -> unsigned long long -> unsigned -> double gives wrong results
- References: <bug-37544-16622@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from ubizjak at gmail dot com 2008-09-17 08:14 -------
cprop_hardreg pass is propagating DImode ax register, wrongly bypassing DI-SI
conversion.
Before cprop_hardreg, we have:
(call_insn/u:HI 27 88 28 4 pr37544.c:9 (set (reg:DI 0 ax)
(call (mem:QI (symbol_ref:SI ("__fixunsdfdi") [flags 0x41]) [0 S1 A8])
(const_int 16 [0x10]))) 687 {*call_value_0} (expr_list:REG_UNUSED
(reg:SI 1 dx)
(expr_list:REG_EH_REGION (const_int -1 [0xffffffff])
(nil)))
(expr_list:REG_DEP_TRUE (use (mem:DF (plus:SI (reg/f:SI 7 sp)
(scratch:SI)) [0 S8 A8]))
(nil)))
(insn 95 28 104 4 pr37544.c:9 (set (reg:SI 21 xmm0)
(reg:SI 0 ax [78])) 41 {*movsi_1} (expr_list:REG_DEAD (reg:SI 0 ax
[78])
(nil)))
(insn 104 95 105 4 pr37544.c:9 (set (mem/c:DI (plus:SI (reg/f:SI 6 bp)
(const_int -8032 [0xffffe0a0])) [0 S8 A64])
(reg:DI 21 xmm0)) 63 {*movdi_2} (expr_list:REG_DEAD (reg:DI 21 xmm0)
(nil)))
(insn 105 104 89 4 pr37544.c:9 (set (reg/v:DF 8 st [orig:65 b ] [65])
(float:DF (mem/c:DI (plus:SI (reg/f:SI 6 bp)
(const_int -8032 [0xffffe0a0])) [0 S8 A64]))) 179
{*floatdidf2_i387} (nil))
and after cprop_hardreg:
(call_insn/u:HI 27 88 28 4 pr37544.c:9 (set (reg:DI 0 ax)
(call (mem:QI (symbol_ref:SI ("__fixunsdfdi") [flags 0x41]) [0 S1 A8])
(const_int 16 [0x10]))) 687 {*call_value_0} (expr_list:REG_UNUSED
(reg:SI 1 dx)
(expr_list:REG_EH_REGION (const_int -1 [0xffffffff])
(nil)))
(expr_list:REG_DEP_TRUE (use (mem:DF (plus:SI (reg/f:SI 7 sp)
(scratch:SI)) [0 S8 A8]))
(nil)))
(insn 95 28 104 4 pr37544.c:9 (set (reg:SI 21 xmm0)
(reg:SI 0 ax [78])) 41 {*movsi_1} (expr_list:REG_DEAD (reg:SI 0 ax
[78])
(nil)))
(insn 104 95 105 4 pr37544.c:9 (set (mem/c:DI (plus:SI (reg/f:SI 6 bp)
(const_int -8032 [0xffffe0a0])) [0 S8 A64])
(reg:DI 0 ax [21])) 63 {*movdi_2} (expr_list:REG_DEAD (reg:DI 21 xmm0)
(nil)))
(insn 105 104 89 4 pr37544.c:9 (set (reg/v:DF 8 st [orig:65 b ] [65])
(float:DF (mem/c:DI (plus:SI (reg/f:SI 6 bp)
(const_int -8032 [0xffffe0a0])) [0 S8 A64]))) 179
{*floatdidf2_i387} (nil))
Please note, how DImode ax reg propagates into (insn 104), bypassing SImode
conversion in (insn 95).
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|target |rtl-optimization
Priority|P3 |P1
Summary|Conversion double -> |[4.2/4.3/4.4 Regression]
|unsigned long long -> |Conversion double ->
|unsigned -> double gives |unsigned long long ->
|wrong results |unsigned -> double gives
| |wrong results
Target Milestone|--- |4.2.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37544