[PATCH] PR target/96759 - Handle global variable assignment from misaligned structure/PARALLEL return values.
Kito Cheng
kito.cheng@gmail.com
Thu Sep 10 10:05:28 GMT 2020
Optimized version of the v2 patch, get rid of assign_stack_temp.
diff --git a/gcc/expr.c b/gcc/expr.c
index 1a15f24b3979..5f744a6c1b8d 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5168,7 +5168,16 @@ expand_assignment (tree to, tree from, bool nontemporal)
rtx reg, mem;
reg = expand_expr (from, NULL_RTX, VOIDmode, EXPAND_NORMAL);
- reg = force_not_mem (reg);
+
+ if (GET_CODE (reg) == PARALLEL)
+ {
+ rtx temp = gen_reg_rtx (mode);
+ emit_group_store (temp, reg, TREE_TYPE (from),
+ int_size_in_bytes (TREE_TYPE (from)));
+ reg = temp;
+ }
+
+ reg = force_not_mem (mode, reg);
mem = expand_expr (to, NULL_RTX, VOIDmode, EXPAND_WRITE);
if (TREE_CODE (to) == MEM_REF && REF_REVERSE_STORAGE_ORDER (to))
reg = flip_storage_order (mode, reg);
More information about the Gcc-patches
mailing list