Hi!
As shown on the testcase below, simplify_relational_operation_1
when canonicalizing (ltu (plus x y) y) can create invalid rtl sharing,
if x can't be shared, because it uses op0's first operand twice in the
generated rtl.
Similar place where we optimize floating 2*x into x+x is handled properly
(calls copy_rtx). I couldn't find other similar issues during quick
skimming of simplify-rtx.c.
Fixed thusly, bootstrapped/regtested on x86_64-linux.
Ok for trunk? What about 4.4 where this bug is latent?
2010-01-11 Jakub Jelinek<jakub@redhat.com>
PR debug/42662
* simplify-rtx.c (simplify_relational_operation_1): Avoid invalid rtx
sharing when canonicalizing ({lt,ge}u (plus a b) b).
* gcc.dg/pr42662.c: New test.