------- 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