[cft] fix 24160

Joern RENNECKE joern.rennecke@st.com
Mon Nov 7 23:46:00 GMT 2005


Richard Henderson wrote:

> 
>So I've adjusted eliminate_regs and eliminate_regs_in_insn to only
>substitute invariants inside MEM, PLUS, and the direct rhs of a SET.
>
>For x86 building cc1, the only place I could find that we used to 
>perform this optimization and we now don't is in the strmovsi_1
>pattern (and friends). 
>
I've analyzed the first difference I've found in the aifftr01 dump, and 
found
that we don't recognize any more as suitable instructions like:

(insn:HI 2612 215 2131 13 (set (reg/f:SI 1200)
        (plus:SI (reg/f:SI 153 invariant)
            (reg/f:SI 1200))) 39 {*addsi3_compact} 
(insn_list:REG_DEP_TRUE 2611
(nil))
    (expr_list:REG_EQUAL (plus:SI (reg/f:SI 153 invariant)
            (const_int -2120 [0xfffff7b8]))
        (nil)))

Clearly, since the RHS is ultimately the sum of (reg/f:SI 153 invariant) and
a constant, it should be treated as such.

I think that also if the other summand was an arbitrary pseudo register, it
is reasonable to expect reload to handle this.  It should be not uncommon
because that is what you expect to see when the address of a automatic array
is indexed.

Where eliminate_regs_in_insn fixes up the REG_NOTES, it must also allow
invariante replacement.

I've tried to implement this in the attached patch (experimental, not 
pretty),
but I still get the same inflated sizes.  Maybe someone else can spot what
is missing.

 Another worrying thing, but probably unrelated to your patch, is that the
text size is 32 bytes longer when compiling with -da.
 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tmp
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20051107/649e26d4/attachment.ksh>


More information about the Gcc-patches mailing list