This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/31043] duplicated data in .rodata / .rodata.cst sections.
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Oct 2009 22:27:30 -0000
- Subject: [Bug other/31043] duplicated data in .rodata / .rodata.cst sections.
- References: <bug-31043-7667@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from ubizjak at gmail dot com 2009-10-28 22:27 -------
(In reply to comment #3)
> > And this constant is handled in different way than its shadow in the memory.
>
> could you explain why? they are identicial constants.
> -fmerge-constants should do something with this.
The load of constant into the register is expanded through ix86_expand_move in
"movdf" expander. There we have:
if (can_create_pseudo_p ()
&& FLOAT_MODE_P (mode)
&& GET_CODE (op1) == CONST_DOUBLE)
{
/* If we are loading a floating point constant to a register,
force the value to memory now, since we'll get better code
out the back end. */
op1 = validize_mem (force_const_mem (mode, op1));
if (!register_operand (op0, mode))
{
rtx temp = gen_reg_rtx (mode);
emit_insn (gen_rtx_SET (VOIDmode, temp, op1));
emit_move_insn (op0, temp);
return;
}
}
So, the trick would be to find the same FP constants in memory and load from
there.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31043