aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorJames Greenhalgh <james.greenhalgh@arm.com>2017-12-21 16:32:25 +0000
committerJames Greenhalgh <jgreenhalgh@gcc.gnu.org>2017-12-21 16:32:25 +0000
commitc587c0a9c8cbe80a64461fe9cab0a23d3ff35211 (patch)
tree2d4372af559ea44da1d6393984a83606e1b2bf64 /gcc/combine.c
parent6ffc0c0cf5ada5d74da5c0b68fade4b5ec0e944a (diff)
downloadgcc-c587c0a9c8cbe80a64461fe9cab0a23d3ff35211.zip
gcc-c587c0a9c8cbe80a64461fe9cab0a23d3ff35211.tar.gz
gcc-c587c0a9c8cbe80a64461fe9cab0a23d3ff35211.tar.bz2
[Patch combine] Don't create ZERO_EXTEND from subregs unless we have a scalar int mode
gcc/ * combine.c (simplify_set): Do not transform subregs to zero_extends if the destination is not a scalar int mode. From-SVN: r255945
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index e78a713..31e6a4f 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -6967,12 +6967,13 @@ simplify_set (rtx x)
/* If we have (set FOO (subreg:M (mem:N BAR) 0)) with M wider than N, this
would require a paradoxical subreg. Replace the subreg with a
zero_extend to avoid the reload that would otherwise be required.
- Don't do this for vector modes, as the transformation is incorrect. */
+ Don't do this unless we have a scalar integer mode, otherwise the
+ transformation is incorrect. */
enum rtx_code extend_op;
if (paradoxical_subreg_p (src)
&& MEM_P (SUBREG_REG (src))
- && !VECTOR_MODE_P (GET_MODE (src))
+ && SCALAR_INT_MODE_P (GET_MODE (src))
&& (extend_op = load_extend_op (GET_MODE (SUBREG_REG (src)))) != UNKNOWN)
{
SUBST (SET_SRC (x),