Commit 2c40b14d by Steve Ellcey Committed by Steve Ellcey

re PR rtl-optimization/67736 (Wrong optimization with -fexpensive-optimizations on mips64el)

2015-10-23  Steve Ellcey  <sellcey@imgtec.com>
	    Andrew Pinski  <apinski@cavium.com>

	PR rtl-optimization/67736
	* combine.c (simplify_comparison): Use gen_lowpart_or_truncate instead
	of gen_lowpart.

Co-Authored-By: Andrew Pinski <apinski@cavium.com>

From-SVN: r229259
parent f819b3b2
2015-10-23 Steve Ellcey <sellcey@imgtec.com>
Andrew Pinski <apinski@cavium.com>
PR rtl-optimization/67736
* combine.c (simplify_comparison): Use gen_lowpart_or_truncate instead
of gen_lowpart.
2015-10-23 Ilya Enkovich <enkovich.gnu@gmail.com> 2015-10-23 Ilya Enkovich <enkovich.gnu@gmail.com>
PR middle-end/68066 PR middle-end/68066
...@@ -11530,8 +11530,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) ...@@ -11530,8 +11530,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
tmode != GET_MODE (op0); tmode = GET_MODE_WIDER_MODE (tmode)) tmode != GET_MODE (op0); tmode = GET_MODE_WIDER_MODE (tmode))
if ((unsigned HOST_WIDE_INT) c0 == GET_MODE_MASK (tmode)) if ((unsigned HOST_WIDE_INT) c0 == GET_MODE_MASK (tmode))
{ {
op0 = gen_lowpart (tmode, inner_op0); op0 = gen_lowpart_or_truncate (tmode, inner_op0);
op1 = gen_lowpart (tmode, inner_op1); op1 = gen_lowpart_or_truncate (tmode, inner_op1);
code = unsigned_condition (code); code = unsigned_condition (code);
changed = 1; changed = 1;
break; break;
...@@ -12049,12 +12049,9 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) ...@@ -12049,12 +12049,9 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
& GET_MODE_MASK (mode)) & GET_MODE_MASK (mode))
+ 1)) >= 0 + 1)) >= 0
&& const_op >> i == 0 && const_op >> i == 0
&& (tmode = mode_for_size (i, MODE_INT, 1)) != BLKmode && (tmode = mode_for_size (i, MODE_INT, 1)) != BLKmode)
&& (TRULY_NOOP_TRUNCATION_MODES_P (tmode, GET_MODE (op0))
|| (REG_P (XEXP (op0, 0))
&& reg_truncated_to_mode (tmode, XEXP (op0, 0)))))
{ {
op0 = gen_lowpart (tmode, XEXP (op0, 0)); op0 = gen_lowpart_or_truncate (tmode, XEXP (op0, 0));
continue; continue;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment