On 01/14/15 10:10, Robert Suchanek wrote:
Here is the revised patch that would handle the other cases as per Richard's
comments.

I slightly modified Matthew's proposed patch and used split_const
instead of get_related_value. AFAICS, the canonical form would always have
the 'plus' expression.

The offset on the high part is most likely not important as the code generation
has to guarantee that the low part represents the true address in the case
where the high and lo_sum are directly related.

Regards,
Robert

gcc/
        * simplify-rtx.c (simplify_replace_fn_rtx): Simplify (lo_sum
        (high x) y) to y if x and y have the same base.

gcc/testsuite/
        * gcc.c-torture/compile/20150108.c: New test.
OK. The MIPS and Sparc ports are probably going to hit this the hardest. So you've got a vested interest in dealing with any fallout :-)

jeff

Reply via email to