Commit 59be85d7 by Jason Merrill Committed by Jason Merrill

Fix MI conversions

From-SVN: r8856
parent 31117bfb
Thu Feb 2 15:07:58 1995 Jason Merrill <jason@phydeaux.cygnus.com>
* class.c (build_vbase_path): Bash types to make the backend happy.
* cvt.c (build_up_reference): Bash the types bashed by
build_vbase_path to be reference types instead of pointer types.
(convert_to_reference): Ditto.
Wed Jan 25 15:02:09 1995 David S. Miller (davem@nadzieja.rutgers.edu) Wed Jan 25 15:02:09 1995 David S. Miller (davem@nadzieja.rutgers.edu)
* class.c (instantiate_type): Change error message text. * class.c (instantiate_type): Change error message text.
......
...@@ -303,6 +303,10 @@ build_vbase_path (code, type, expr, path, alias_this) ...@@ -303,6 +303,10 @@ build_vbase_path (code, type, expr, path, alias_this)
if (TREE_INT_CST_LOW (offset)) if (TREE_INT_CST_LOW (offset))
{ {
/* Bash types to make the backend happy. */
offset = convert (type, offset);
expr = build1 (NOP_EXPR, type, expr);
/* For multiple inheritance: if `this' can be set by any /* For multiple inheritance: if `this' can be set by any
function, then it could be 0 on entry to any function. function, then it could be 0 on entry to any function.
Preserve such zeroness here. Otherwise, only in the Preserve such zeroness here. Otherwise, only in the
......
...@@ -609,6 +609,9 @@ build_up_reference (type, arg, flags, checkconst) ...@@ -609,6 +609,9 @@ build_up_reference (type, arg, flags, checkconst)
rval rval
= convert_to_pointer_force (build_pointer_type (target_type), rval); = convert_to_pointer_force (build_pointer_type (target_type), rval);
TREE_TYPE (rval) = type; TREE_TYPE (rval) = type;
if (TREE_CODE (rval) == PLUS_EXPR || TREE_CODE (rval) == MINUS_EXPR)
TREE_TYPE (TREE_OPERAND (rval, 0))
= TREE_TYPE (TREE_OPERAND (rval, 1)) = type;
} }
TREE_CONSTANT (rval) = literal_flag; TREE_CONSTANT (rval) = literal_flag;
return rval; return rval;
...@@ -683,6 +686,9 @@ convert_to_reference (reftype, expr, convtype, flags, decl) ...@@ -683,6 +686,9 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
convtype, flags); convtype, flags);
TREE_TYPE (expr) = type; TREE_TYPE (expr) = type;
TREE_TYPE (rval) = reftype; TREE_TYPE (rval) = reftype;
if (TREE_CODE (rval) == PLUS_EXPR || TREE_CODE (rval) == MINUS_EXPR)
TREE_TYPE (TREE_OPERAND (rval, 0))
= TREE_TYPE (TREE_OPERAND (rval, 1)) = reftype;
return rval; return rval;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment