aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-10-08 00:54:35 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2015-10-07 22:54:35 +0000
commitee3db47daa5f1add5fa6d025352070b0956a0929 (patch)
tree42a9c5df71558c4b9f561422da10083a7fc6fc6c /gcc/expr.c
parentd44bd40ef006102f4001a54a2ac37fbf3b67f128 (diff)
downloadgcc-ee3db47daa5f1add5fa6d025352070b0956a0929.zip
gcc-ee3db47daa5f1add5fa6d025352070b0956a0929.tar.gz
gcc-ee3db47daa5f1add5fa6d025352070b0956a0929.tar.bz2
expr.c (store_expr_with_bounds): Handle aggregate moves from BLKmode.
* expr.c (store_expr_with_bounds): Handle aggregate moves from BLKmode. * gimple-expr.c (useless_type_conversion_p): Do not use TYPE_CANONICAL to define gimple type system; compare aggregates only by size. From-SVN: r228586
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 6498a63..6f6554d 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5425,6 +5425,14 @@ store_expr_with_bounds (tree exp, rtx target, int call_param_p,
temp = convert_modes (GET_MODE (target), TYPE_MODE (TREE_TYPE (exp)),
temp, TYPE_UNSIGNED (TREE_TYPE (exp)));
+ /* We allow move between structures of same size but different mode.
+ If source is in memory and the mode differs, simply change the memory. */
+ if (GET_MODE (temp) == BLKmode && GET_MODE (target) != BLKmode)
+ {
+ gcc_assert (MEM_P (temp));
+ temp = adjust_address_nv (temp, GET_MODE (target), 0);
+ }
+
/* If value was not generated in the target, store it there.
Convert the value to TARGET's type first if necessary and emit the
pending incrementations that have been queued when expanding EXP.