This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix simplify_relational_operation_1 to avoid creating invalid rtl sharing (PR debug/42662)


On 01/11/10 09:07, Jakub Jelinek wrote:
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.
OK for trunk. I think it's ok for 4.4 as well, but give whomever owns that branch some time to chime in.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]