From: Eric Botcazou Date: Thu, 29 Jun 2017 19:21:25 +0000 (+0000) Subject: expr.c (expand_expr): When testing for unaligned objects... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3ba358bf20a292e277df4de02b2f57c203e627cc;p=gcc.git expr.c (expand_expr): When testing for unaligned objects... * expr.c (expand_expr) : When testing for unaligned objects, take into account only the alignment of 'op0' and 'mode1' if 'op0' is a MEM. From-SVN: r249811 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 079c674a7ce..4f8868bc8be 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-06-29 Eric Botcazou + + * expr.c (expand_expr) : When testing for unaligned + objects, take into account only the alignment of 'op0' and 'mode1' if + 'op0' is a MEM. + 2017-06-29 Steve Ellcey * ccmp.c (ccmp_tree_comparison_p): New function. diff --git a/gcc/expr.c b/gcc/expr.c index 0a52a3d7209..0e8216ba7d0 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -10639,11 +10639,11 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode, /* If the field isn't aligned enough to fetch as a memref, fetch it as a bit field. */ || (mode1 != BLKmode - && (((TYPE_ALIGN (TREE_TYPE (tem)) < GET_MODE_ALIGNMENT (mode) - || (bitpos % GET_MODE_ALIGNMENT (mode) != 0) - || (MEM_P (op0) - && (MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode1) - || (bitpos % GET_MODE_ALIGNMENT (mode1) != 0)))) + && (((MEM_P (op0) + ? MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode1) + || (bitpos % GET_MODE_ALIGNMENT (mode1) != 0) + : TYPE_ALIGN (TREE_TYPE (tem)) < GET_MODE_ALIGNMENT (mode) + || (bitpos % GET_MODE_ALIGNMENT (mode) != 0)) && modifier != EXPAND_MEMORY && ((modifier == EXPAND_CONST_ADDRESS || modifier == EXPAND_INITIALIZER)