aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 77503d3..3eebaa2 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3732,13 +3732,12 @@ expand_assignment (to, from, want_value, suggest_reg)
abort ();
if (GET_MODE (offset_rtx) != ptr_mode)
- {
+ offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
+
#ifdef POINTERS_EXTEND_UNSIGNED
- offset_rtx = convert_memory_address (ptr_mode, offset_rtx);
-#else
- offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
+ if (GET_MODE (offset_rtx) != Pmode)
+ offset_rtx = convert_memory_address (Pmode, offset_rtx);
#endif
- }
/* A constant address in TO_RTX can have VOIDmode, we must not try
to call force_reg for that case. Avoid that case. */
@@ -4637,7 +4636,8 @@ store_constructor (exp, target, align, cleared, size)
offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
#ifdef POINTERS_EXTEND_UNSIGNED
- offset_rtx = convert_memory_address (Pmode, offset_rtx);
+ if (GET_MODE (offset_rtx) != Pmode)
+ offset_rtx = convert_memory_address (Pmode, offset_rtx);
#endif
to_rtx = offset_address (to_rtx, offset_rtx,
@@ -7044,7 +7044,8 @@ expand_expr (exp, target, tmode, modifier)
offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
#ifdef POINTERS_EXTEND_UNSIGNED
- offset_rtx = convert_memory_address (ptr_mode, offset_rtx);
+ if (GET_MODE (offset_rtx) != Pmode)
+ offset_rtx = convert_memory_address (Pmode, offset_rtx);
#endif
/* A constant address in OP0 can have VOIDmode, we must not try
@@ -9057,7 +9058,8 @@ expand_expr_unaligned (exp, palign)
offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
#ifdef POINTERS_EXTEND_UNSIGNED
- offset_rtx = convert_memory_address (ptr_mode, offset_rtx);
+ if (GET_MODE (offset_rtx) != Pmode)
+ offset_rtx = convert_memory_address (Pmode, offset_rtx);
#endif
op0 = offset_address (op0, offset_rtx,