aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-01-04 22:21:00 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1997-01-04 22:21:00 -0500
commit0d15e60cd56057d72005c7fff060d387cc894fc3 (patch)
tree9a715f339d3327c017c27359b8754d19f113891e
parent5cb1f2fa910c2132a95e9198c2966a1295937875 (diff)
downloadgcc-0d15e60cd56057d72005c7fff060d387cc894fc3.zip
gcc-0d15e60cd56057d72005c7fff060d387cc894fc3.tar.gz
gcc-0d15e60cd56057d72005c7fff060d387cc894fc3.tar.bz2
(get_inner_reference): Fix type error.
(expand_expr, case COMPONENT_REF): Don't convert if modifier is EXPAND_CONST_ADDRESS, EXPAND_SUM, or EXPAND_INITIALIZER. From-SVN: r13375
-rw-r--r--gcc/expr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index e4c6609..eeed0b0 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4304,7 +4304,8 @@ get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode,
}
index = fold (build (MULT_EXPR, index_type, index,
- TYPE_SIZE (TREE_TYPE (exp))));
+ convert (index_type,
+ TYPE_SIZE (TREE_TYPE (exp)))));
if (TREE_CODE (index) == INTEGER_CST
&& TREE_INT_CST_HIGH (index) == 0)
@@ -5670,10 +5671,13 @@ expand_expr (exp, target, tmode, modifier)
MEM_IN_STRUCT_P (op0) = 1;
MEM_VOLATILE_P (op0) |= volatilep;
- if (mode == mode1 || mode1 == BLKmode || mode1 == tmode)
+ if (mode == mode1 || mode1 == BLKmode || mode1 == tmode
+ || modifier == EXPAND_CONST_ADDRESS || modifier == EXPAND_SUM
+ || modifier == EXPAND_INITIALIZER)
return op0;
- if (target == 0)
+ else if (target == 0)
target = gen_reg_rtx (tmode != VOIDmode ? tmode : mode);
+
convert_move (target, op0, unsignedp);
return target;
}