summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-04 12:41:52 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-04 12:41:52 +0000
commitfd304a932522a0d854fbe316429753f001e5b7de (patch)
tree268423f878efbc6f96e2577bc8b63cfd72fe0f6a /gcc/combine.c
parent36c30f9e6ff19c50712b8635e83d8f5caefc5f49 (diff)
downloadgcc-fd304a932522a0d854fbe316429753f001e5b7de.tar.gz
* combine.c (combine_simplify_rtx) <case SUBREG>: If nonzero_bits
on op shows all bits zero in mode of a lowpart subreg, return zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198595 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 0792ba3b6f4..b737bc5529f 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5417,6 +5417,17 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest,
SUBREG_BYTE (x));
if (temp)
return temp;
+
+ /* If op is known to have all lower bits zero, the result is zero. */
+ if (!in_dest
+ && SCALAR_INT_MODE_P (mode)
+ && SCALAR_INT_MODE_P (op0_mode)
+ && GET_MODE_PRECISION (mode) < GET_MODE_PRECISION (op0_mode)
+ && subreg_lowpart_offset (mode, op0_mode) == SUBREG_BYTE (x)
+ && HWI_COMPUTABLE_MODE_P (op0_mode)
+ && (nonzero_bits (SUBREG_REG (x), op0_mode)
+ & GET_MODE_MASK (mode)) == 0)
+ return CONST0_RTX (mode);
}
/* Don't change the mode of the MEM if that would change the meaning