diff options
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 81392b64ac8..126b132eb05 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -873,7 +873,7 @@ expand_one_stack_var_at (tree decl, rtx base, unsigned base_align, /* If this fails, we've overflowed the stack frame. Error nicely? */ gcc_assert (offset == trunc_int_for_mode (offset, Pmode)); - x = plus_constant (base, offset); + x = plus_constant (Pmode, base, offset); x = gen_rtx_MEM (DECL_MODE (SSAVAR (decl)), x); if (TREE_CODE (decl) != SSA_NAME) @@ -2836,6 +2836,7 @@ expand_debug_expr (tree exp) } /* FALLTHROUGH */ case INDIRECT_REF: + inner_mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))); op0 = expand_debug_expr (TREE_OPERAND (exp, 0)); if (!op0) return NULL; @@ -2853,7 +2854,7 @@ expand_debug_expr (tree exp) if (!op1 || !CONST_INT_P (op1)) return NULL; - op0 = plus_constant (op0, INTVAL (op1)); + op0 = plus_constant (inner_mode, op0, INTVAL (op1)); } if (POINTER_TYPE_P (TREE_TYPE (exp))) @@ -3347,8 +3348,10 @@ expand_debug_expr (tree exp) && (bitoffset % BITS_PER_UNIT) == 0 && bitsize > 0 && bitsize == maxsize) - return plus_constant (gen_rtx_DEBUG_IMPLICIT_PTR (mode, decl), - bitoffset / BITS_PER_UNIT); + { + rtx base = gen_rtx_DEBUG_IMPLICIT_PTR (mode, decl); + return plus_constant (mode, base, bitoffset / BITS_PER_UNIT); + } } return NULL; |