mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-24 20:01:19 +08:00
expr.c (expand_expr): For {BITFIELD,COMPONENT,ARRAY}_REF...
* expr.c (expand_expr): For {BITFIELD,COMPONENT,ARRAY}_REF, if the offset's mode is not ptr_mode, convert it. From-SVN: r19965
This commit is contained in:
parent
329745f7c1
commit
bd070e1aa9
@ -1,3 +1,8 @@
|
||||
1998-05-23 Richard Henderson <rth@cygnus.com>
|
||||
|
||||
* expr.c (expand_expr): For {BITFIELD,COMPONENT,ARRAY}_REF, if the
|
||||
offset's mode is not ptr_mode, convert it.
|
||||
|
||||
1998-05-22 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* fold-const.c (ssize_binop): New fn.
|
||||
|
27
gcc/expr.c
27
gcc/expr.c
@ -2907,6 +2907,16 @@ expand_assignment (to, from, want_value, suggest_reg)
|
||||
|
||||
if (GET_CODE (to_rtx) != MEM)
|
||||
abort ();
|
||||
|
||||
if (GET_MODE (offset_rtx) != ptr_mode)
|
||||
{
|
||||
#ifdef POINTERS_EXTEND_UNSIGNED
|
||||
offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 1);
|
||||
#else
|
||||
offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
to_rtx = change_address (to_rtx, VOIDmode,
|
||||
gen_rtx_PLUS (ptr_mode, XEXP (to_rtx, 0),
|
||||
force_reg (ptr_mode, offset_rtx)));
|
||||
@ -3307,7 +3317,7 @@ store_expr (exp, target, want_value)
|
||||
{
|
||||
target = protect_from_queue (target, 1);
|
||||
if (GET_MODE (temp) != GET_MODE (target)
|
||||
&& GET_MODE (temp) != VOIDmode)
|
||||
&& GET_MODE (target) != VOIDmode)
|
||||
{
|
||||
int unsignedp = TREE_UNSIGNED (TREE_TYPE (exp));
|
||||
if (dont_return_target)
|
||||
@ -3673,6 +3683,15 @@ store_constructor (exp, target, cleared)
|
||||
if (GET_CODE (to_rtx) != MEM)
|
||||
abort ();
|
||||
|
||||
if (GET_MODE (offset_rtx) != ptr_mode)
|
||||
{
|
||||
#ifdef POINTERS_EXTEND_UNSIGNED
|
||||
offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 1);
|
||||
#else
|
||||
offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
to_rtx
|
||||
= change_address (to_rtx, VOIDmode,
|
||||
gen_rtx_PLUS (ptr_mode, XEXP (to_rtx, 0),
|
||||
@ -5752,11 +5771,13 @@ expand_expr (exp, target, tmode, modifier)
|
||||
abort ();
|
||||
|
||||
if (GET_MODE (offset_rtx) != ptr_mode)
|
||||
{
|
||||
#ifdef POINTERS_EXTEND_UNSIGNED
|
||||
offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 1);
|
||||
offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 1);
|
||||
#else
|
||||
offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
|
||||
offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
op0 = change_address (op0, VOIDmode,
|
||||
gen_rtx_PLUS (ptr_mode, XEXP (op0, 0),
|
||||
|
Loading…
x
Reference in New Issue
Block a user