Re: [PATCH] Fix up simplify_truncation (PR rtl-optimization/56494)

2013-03-04 Thread Richard Sandiford
Jakub Jelinek writes: > On Mon, Mar 04, 2013 at 09:08:36PM +, Richard Sandiford wrote: >> ...truncations can't be to a narrower mode (already asserted at the top >> of the function) so in some ways I think it would be clearer to have an >> "if ... else" rather than two "if"s. > > So like this

Re: [PATCH] Fix up simplify_truncation (PR rtl-optimization/56494)

2013-03-04 Thread Jakub Jelinek
On Mon, Mar 04, 2013 at 09:08:36PM +, Richard Sandiford wrote: > ...truncations can't be to a narrower mode (already asserted at the top > of the function) so in some ways I think it would be clearer to have an > "if ... else" rather than two "if"s. So like this instead? 2013-03-04 Jakub Jel

Re: [PATCH] Fix up simplify_truncation (PR rtl-optimization/56494)

2013-03-04 Thread Richard Sandiford
[Sorry Jakub, mid-air collision. I just posted this comment to the PR.] Jakub Jelinek writes: > Optimizing (truncate:A (subreg:B (truncate:C X) 0)) into > (truncate:A X) is wrong if C mode is narrower than A mode. > The following patch fixes that and simplifies it into > (subreg:A (truncate:C X

[PATCH] Fix up simplify_truncation (PR rtl-optimization/56494)

2013-03-04 Thread Jakub Jelinek
Hi! Optimizing (truncate:A (subreg:B (truncate:C X) 0)) into (truncate:A X) is wrong if C mode is narrower than A mode. The following patch fixes that and simplifies it into (subreg:A (truncate:C X 0)) instead. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2013-03-04 Jaku