aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2007-02-15 20:51:29 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2007-02-15 20:51:29 +0000
commitbefdad071460a1bb49cb37691c73721f2e88c282 (patch)
tree92fca5300e88aba9f3665cce220913e0eff12c52
parenteab79d78e7b90cd54fd93260e5c7b9816a8dd251 (diff)
downloadgcc-befdad071460a1bb49cb37691c73721f2e88c282.zip
gcc-befdad071460a1bb49cb37691c73721f2e88c282.tar.gz
gcc-befdad071460a1bb49cb37691c73721f2e88c282.tar.bz2
expr.c (expand_expr_real_1): If a temporary is made and the reference doesn't use the alias set of its type...
* expr.c (expand_expr_real_1) <normal_inner_ref>: If a temporary is made and the reference doesn't use the alias set of its type, do not create the temporary using that type. From-SVN: r122014
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/expr.c15
2 files changed, 18 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cb41a5d..9ad61e2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2007-02-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * expr.c (expand_expr_real_1) <normal_inner_ref>: If a temporary
+ is made and the reference doesn't use the alias set of its type,
+ do not create the temporary using that type.
+
2007-02-15 Aldy Hernandez <aldyh@redhat.com>
* jump.c: Remove prototypes for delete_computation and
diff --git a/gcc/expr.c b/gcc/expr.c
index 09a6789..42cb253 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -7711,9 +7711,18 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
necessarily be constant. */
if (mode == BLKmode)
{
- rtx new
- = assign_stack_temp_for_type
- (ext_mode, GET_MODE_BITSIZE (ext_mode), 0, type);
+ HOST_WIDE_INT size = GET_MODE_BITSIZE (ext_mode);
+ rtx new;
+
+ /* If the reference doesn't use the alias set of its type,
+ we cannot create the temporary using that type. */
+ if (component_uses_parent_alias_set (exp))
+ {
+ new = assign_stack_local (ext_mode, size, 0);
+ set_mem_alias_set (new, get_alias_set (exp));
+ }
+ else
+ new = assign_stack_temp_for_type (ext_mode, size, 0, type);
emit_move_insn (new, op0);
op0 = copy_rtx (new);