From c587c0a9c8cbe80a64461fe9cab0a23d3ff35211 Mon Sep 17 00:00:00 2001 From: James Greenhalgh Date: Thu, 21 Dec 2017 16:32:25 +0000 Subject: [PATCH] [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 --- gcc/ChangeLog | 5 +++++ gcc/combine.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d364df4dd45..c6dc455f319 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-12-21 James Greenhalgh + + * combine.c (simplify_set): Do not transform subregs to zero_extends + if the destination is not a scalar int mode. + 2017-12-21 Eric Botcazou PR c++/82872 diff --git a/gcc/combine.c b/gcc/combine.c index e78a7138037..31e6a4f6825 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), -- 2.30.2