diff options
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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) |