aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-11-12 09:16:12 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2008-11-12 09:16:12 +0100
commit8ebec1a5dd8a729cf24ad3cc708d9193392e8451 (patch)
treeeb28785246995032ff8cc01e09d0149549e0cf4c /gcc/expr.c
parent0d6872cba72c3fad11d88e31611fc5ff229f8288 (diff)
downloadgcc-8ebec1a5dd8a729cf24ad3cc708d9193392e8451.zip
gcc-8ebec1a5dd8a729cf24ad3cc708d9193392e8451.tar.gz
gcc-8ebec1a5dd8a729cf24ad3cc708d9193392e8451.tar.bz2
re PR target/35366 (gfortran.dg/equiv_7.f90 fails with -m64 -Os on powerpc-apple-darwin9)
PR target/35366 * expr.c (expand_expr_addr_expr_1): If EXP needs bigger alignment than INNER and INNER is a constant, forcibly align INNER as much as needed. From-SVN: r141782
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 6db637e..31af3aa 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -6862,6 +6862,16 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode,
gcc_assert (inner != exp);
subtarget = offset || bitpos ? NULL_RTX : target;
+ /* For VIEW_CONVERT_EXPR, where the outer alignment is bigger than
+ inner alignment, force the inner to be sufficiently aligned. */
+ if (CONSTANT_CLASS_P (inner)
+ && TYPE_ALIGN (TREE_TYPE (inner)) < TYPE_ALIGN (TREE_TYPE (exp)))
+ {
+ inner = copy_node (inner);
+ TREE_TYPE (inner) = copy_node (TREE_TYPE (inner));
+ TYPE_ALIGN (TREE_TYPE (inner)) = TYPE_ALIGN (TREE_TYPE (exp));
+ TYPE_USER_ALIGN (TREE_TYPE (inner)) = 1;
+ }
result = expand_expr_addr_expr_1 (inner, subtarget, tmode, modifier);
if (offset)