aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-06-15 22:36:38 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2018-06-15 22:36:38 +0200
commitda8ea71e3733ba9c5f70a84cea9cafea6b0126b0 (patch)
treec9666afbacc9e91f2ba218c44d66904e891c37cb /gcc/expr.c
parentfe7a23a611df9954918f334f855935ce228c88d6 (diff)
downloadgcc-da8ea71e3733ba9c5f70a84cea9cafea6b0126b0.zip
gcc-da8ea71e3733ba9c5f70a84cea9cafea6b0126b0.tar.gz
gcc-da8ea71e3733ba9c5f70a84cea9cafea6b0126b0.tar.bz2
re PR middle-end/85878 (ICE in convert_mode_scalar, at expr.c:287)
PR middle-end/85878 * expr.c (expand_assignment): Remove now redundant COMPLEX_MODE_P check from first store_expr, use to_mode instead of GET_MODE (to_rtx). Only call store_expr for halves if the mode is the same. * gfortran.fortran-torture/compile/pr85878.f90: New test. From-SVN: r261659
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index d6b3eb4..793b283 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5150,12 +5150,12 @@ expand_assignment (tree to, tree from, bool nontemporal)
gcc_checking_assert (COMPLEX_MODE_P (to_mode));
poly_int64 mode_bitsize = GET_MODE_BITSIZE (to_mode);
unsigned short inner_bitsize = GET_MODE_UNIT_BITSIZE (to_mode);
- if (TYPE_MODE (TREE_TYPE (from)) == GET_MODE (to_rtx)
- && COMPLEX_MODE_P (GET_MODE (to_rtx))
+ if (TYPE_MODE (TREE_TYPE (from)) == to_mode
&& known_eq (bitpos, 0)
&& known_eq (bitsize, mode_bitsize))
result = store_expr (from, to_rtx, false, nontemporal, reversep);
- else if (known_eq (bitsize, inner_bitsize)
+ else if (TYPE_MODE (TREE_TYPE (from)) == GET_MODE_INNER (to_mode)
+ && known_eq (bitsize, inner_bitsize)
&& (known_eq (bitpos, 0)
|| known_eq (bitpos, inner_bitsize)))
result = store_expr (from, XEXP (to_rtx, maybe_ne (bitpos, 0)),