summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-01 20:46:30 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-01 20:46:30 +0000
commit959aa063a150a3f577d69730e94f7c363f904d8c (patch)
tree4fd3653042cd7b017ac9cd6a959417dfec967094 /gcc/combine.c
parent9e0aee4b7f780a7379224827264830684587d328 (diff)
downloadgcc-959aa063a150a3f577d69730e94f7c363f904d8c.tar.gz
PR rtl-optimization/39588
* combine.c (merge_outer_ops): Do not set the constant when this is not necessary. (simplify_shift_const_1): Do not modify it either in this case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145430 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 3ce8a75ca2f..80187347aed 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -8971,13 +8971,13 @@ merge_outer_ops (enum rtx_code *pop0, HOST_WIDE_INT *pconst0, enum rtx_code op1,
&& op0 == AND)
op0 = UNKNOWN;
+ *pop0 = op0;
+
/* ??? Slightly redundant with the above mask, but not entirely.
Moving this above means we'd have to sign-extend the mode mask
for the final test. */
- const0 = trunc_int_for_mode (const0, mode);
-
- *pop0 = op0;
- *pconst0 = const0;
+ if (op0 != UNKNOWN && op0 != NEG)
+ *pconst0 = trunc_int_for_mode (const0, mode);
return 1;
}
@@ -9700,7 +9700,8 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode,
if (outer_op != UNKNOWN)
{
- if (GET_MODE_BITSIZE (result_mode) < HOST_BITS_PER_WIDE_INT)
+ if (GET_RTX_CLASS (outer_op) != RTX_UNARY
+ && GET_MODE_BITSIZE (result_mode) < HOST_BITS_PER_WIDE_INT)
outer_const = trunc_int_for_mode (outer_const, result_mode);
if (outer_op == AND)