On 02/12/2016 02:47 PM, Richard Biener wrote:
Another possibility, only do the convert_modes from VOIDmode for
shift_optab_p's xop1, and keep doing what we've done before otherwise.
That looks like a very targeted and safe fix indeed.
You two can obviously go ahead and sort this out, I'll just make one
more comment. What attracted me to Richard's patch was its clarity and
lack of potential to confuse readers.
- machine_mode mode0, mode1, tmp_mode;
+ machine_mode mode0, mode1 = mode, tmp_mode;
if (!shift_optab_p (binoptab))
xop1 = avoid_expensive_constant (xmode1, binoptab, 1, xop1, unsignedp);
+ else
+ mode1 = VOIDmode;
- mode1 = GET_MODE (xop1) != VOIDmode ? GET_MODE (xop1) : mode;
+ mode1 = GET_MODE (xop1) != VOIDmode ? GET_MODE (xop1) : mode1;
if (xmode1 != VOIDmode && xmode1 != mode1)
{
Here, things aren't so clear, and the fact that the mode1 calculation
now differs from the mode0 one may be overlooked by someone in the future.
Rather than use codes like "mode variable is VOIDmode", I'd prefer to
use booleans with descriptive names, like "op1_may_need_conversion".
Bernd