[PATCH] Add missing TRULY_NOOP_TRUNCATION

Roger Sayle roger@eyesopen.com
Mon Jan 2 15:12:00 GMT 2006


On Mon, 2 Jan 2006, Adam Nemet wrote:
>
> 	* combine.c (apply_distributive_law <SUBREG>): Check
> 	TRULY_NOOP_TRUNCATION.

This is OK for mainline.

At first glance, it's wasn't immediately obvious why converting
(plus:SI (subreg:SI (reg:DI)) (subreg:SI (reg:DI)))
into
(subreg:SI (plus:DI (reg:DI) (reg:DI)))
isn't always a win, it would appear to convert two truncations into
a single truncation and perform the operation in word_mode, but I can
imagine that given the semantics of TRULY_NOOP_TRUNCATION that we've
machine descriptions where the SUBREGs in the first pattern aren't
truncations and plus:SI is clever, but the SUBREG in the result needs
to become an explicit truncation.

It would be nice if you could find/provide a testcase affected by
this patch for the testsuite, to prevent us undoing your change in
future, or to investigate whether it would be beneficial to perform
this transformation but with an explicit TRUNCATE:SI instead.

Roger
--




More information about the Gcc-patches mailing list