diff options
author | Richard Henderson <rth@cygnus.com> | 1998-05-22 16:03:25 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1998-05-22 16:03:25 -0700 |
commit | bd070e1aa9a4f7b6575e6b58a78de2dc708e5d38 (patch) | |
tree | 28159966dd01ab20238a4e9e0996bf825107145c | |
parent | 329745f7c1aa1eb0f5ad89a327b86c2d3293ebbe (diff) | |
download | gcc-bd070e1aa9a4f7b6575e6b58a78de2dc708e5d38.zip gcc-bd070e1aa9a4f7b6575e6b58a78de2dc708e5d38.tar.gz gcc-bd070e1aa9a4f7b6575e6b58a78de2dc708e5d38.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/expr.c | 27 |
2 files changed, 29 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4b21e90..1d5d766 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. @@ -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), |