expr.c (expand_assignment): Remove dependency on flag_strict_volatile_bitfields.

2013-12-11  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * expr.c (expand_assignment): Remove dependency on
        flag_strict_volatile_bitfields. Always set the memory
        access mode.
        (expand_expr_real_1): Likewise.

From-SVN: r205899
This commit is contained in:
Bernd Edlinger 2013-12-11 17:15:44 +00:00 committed by Bernd Edlinger
parent ebb99f967b
commit 996947e67d
2 changed files with 18 additions and 15 deletions

View File

@ -1,3 +1,10 @@
2013-12-11 Bernd Edlinger <bernd.edlinger@hotmail.de>
* expr.c (expand_assignment): Remove dependency on
flag_strict_volatile_bitfields. Always set the memory
access mode.
(expand_expr_real_1): Likewise.
2013-12-11 Bernd Edlinger <bernd.edlinger@hotmail.de> 2013-12-11 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR middle-end/59134 PR middle-end/59134

View File

@ -4838,13 +4838,13 @@ expand_assignment (tree to, tree from, bool nontemporal)
to_rtx = expand_expr (tem, NULL_RTX, VOIDmode, EXPAND_WRITE); to_rtx = expand_expr (tem, NULL_RTX, VOIDmode, EXPAND_WRITE);
/* If the bitfield is volatile, we want to access it in the /* If the field has a mode, we want to access it in the
field's mode, not the computed mode. field's mode, not the computed mode.
If a MEM has VOIDmode (external with incomplete type), If a MEM has VOIDmode (external with incomplete type),
use BLKmode for it instead. */ use BLKmode for it instead. */
if (MEM_P (to_rtx)) if (MEM_P (to_rtx))
{ {
if (volatilep && flag_strict_volatile_bitfields > 0) if (mode1 != VOIDmode)
to_rtx = adjust_address (to_rtx, mode1, 0); to_rtx = adjust_address (to_rtx, mode1, 0);
else if (GET_MODE (to_rtx) == VOIDmode) else if (GET_MODE (to_rtx) == VOIDmode)
to_rtx = adjust_address (to_rtx, BLKmode, 0); to_rtx = adjust_address (to_rtx, BLKmode, 0);
@ -9970,13 +9970,13 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
VOIDmode, VOIDmode,
modifier == EXPAND_SUM ? EXPAND_NORMAL : modifier); modifier == EXPAND_SUM ? EXPAND_NORMAL : modifier);
/* If the bitfield is volatile, we want to access it in the /* If the field has a mode, we want to access it in the
field's mode, not the computed mode. field's mode, not the computed mode.
If a MEM has VOIDmode (external with incomplete type), If a MEM has VOIDmode (external with incomplete type),
use BLKmode for it instead. */ use BLKmode for it instead. */
if (MEM_P (op0)) if (MEM_P (op0))
{ {
if (volatilep && flag_strict_volatile_bitfields > 0) if (mode1 != VOIDmode)
op0 = adjust_address (op0, mode1, 0); op0 = adjust_address (op0, mode1, 0);
else if (GET_MODE (op0) == VOIDmode) else if (GET_MODE (op0) == VOIDmode)
op0 = adjust_address (op0, BLKmode, 0); op0 = adjust_address (op0, BLKmode, 0);
@ -10108,17 +10108,13 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
&& modifier != EXPAND_CONST_ADDRESS && modifier != EXPAND_CONST_ADDRESS
&& modifier != EXPAND_INITIALIZER && modifier != EXPAND_INITIALIZER
&& modifier != EXPAND_MEMORY) && modifier != EXPAND_MEMORY)
/* If the field is volatile, we always want an aligned /* If the bitfield is volatile and the bitsize
access. Do this in following two situations: is narrower than the access size of the bitfield,
1. the access is not already naturally we need to extract bitfields from the access. */
aligned, otherwise "normal" (non-bitfield) volatile fields || (volatilep && TREE_CODE (exp) == COMPONENT_REF
become non-addressable. && DECL_BIT_FIELD_TYPE (TREE_OPERAND (exp, 1))
2. the bitsize is narrower than the access size. Need && mode1 != BLKmode
to extract bitfields from the access. */ && bitsize < GET_MODE_SIZE (mode1) * BITS_PER_UNIT)
|| (volatilep && flag_strict_volatile_bitfields > 0
&& (bitpos % GET_MODE_ALIGNMENT (mode) != 0
|| (mode1 != BLKmode
&& bitsize < GET_MODE_SIZE (mode1) * BITS_PER_UNIT)))
/* If the field isn't aligned enough to fetch as a memref, /* If the field isn't aligned enough to fetch as a memref,
fetch it as a bit field. */ fetch it as a bit field. */
|| (mode1 != BLKmode || (mode1 != BLKmode