From 2d48c13dc2d0912138ff2648ce9c1081d1653b73 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Mon, 29 Dec 1997 06:15:21 -0700 Subject: [PATCH] expr.c (expand_expr): For {BITFIELD,COMPONENT,ARRAY}_REF... d * expr.c (expand_expr): For {BITFIELD,COMPONENT,ARRAY}_REF, if the offset's mode is not ptr_mode, convert it. From-SVN: r17260 --- gcc/expr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/expr.c b/gcc/expr.c index 68fbbe9e89b..623a9039bad 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -5739,6 +5739,14 @@ expand_expr (exp, target, tmode, modifier) if (GET_CODE (op0) != 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 + op0 = change_address (op0, VOIDmode, gen_rtx (PLUS, ptr_mode, XEXP (op0, 0), force_reg (ptr_mode, offset_rtx)));