This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/21508] non-optimal code with __builtin_signbit
- From: "uros at kss-loka dot si" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jun 2005 08:13:05 -0000
- Subject: [Bug target/21508] non-optimal code with __builtin_signbit
- References: <20050511091539.21508.uros@kss-loka.si>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From uros at kss-loka dot si 2005-06-03 08:13 -------
It looks that REG_EQUAL notes gets lost between regmove and lreg pass. A
relevant part from compiling an example in description with '-O2' shows:
pr21508.c.19.regmove:
(note:HI 7 6 12 0 NOTE_INSN_FUNCTION_BEG)
(insn:HI 12 7 13 0 (set (reg:DF 62)
(mem/u/i:DF (symbol_ref/u:SI ("*.LC1") [flags 0x2]) [2 S8 A64])) 65
{*movdf_nointeger} (nil)
(expr_list:REG_EQUAL (const_double:DF -2147483648 [0x80000000] 1.0e+0
[0x0.8p+1])
(nil)))
in pr21508.c.22.lreg:
(note:HI 7 6 12 0 NOTE_INSN_FUNCTION_BEG)
(insn:HI 12 7 13 0 (set (reg:DF 62)
(mem/u/i:DF (symbol_ref/u:SI ("*.LC1") [flags 0x2]) [2 S8 A64])) 65
{*movdf_nointeger} (nil)
(nil))
However, compiling a simple program, such as:
double test (double a) {
return a + 1.0;
}
results in fld1 insn being used. REG_EQUAL notes are still present in lreg dump
file:
(note:HI 7 6 11 0 NOTE_INSN_FUNCTION_BEG)
(insn:HI 11 7 12 0 (set (reg:DF 61)
(mem/u/i:DF (symbol_ref/u:SI ("*.LC1") [flags 0x2]) [2 S8 A64])) 65
{*movdf_nointeger} (nil)
(expr_list:REG_EQUAL (const_double:DF -2147483648 [0x80000000] 1.0e+0
[0x0.8p+1])
(nil)))
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21508