Fix MI conversions
authorJason Merrill <jason@phydeaux.cygnus.com>
Fri, 3 Feb 1995 03:45:07 +0000 (03:45 +0000)
committerJason Merrill <merrill@gnu.org>
Fri, 3 Feb 1995 03:45:07 +0000 (03:45 +0000)
From-SVN: r8856

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cvt.c

index c5cfb77..c871a58 100644 (file)
@@ -1,3 +1,10 @@
+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)
 
        * class.c (instantiate_type): Change error message text.
index ec624b9..79e76bb 100644 (file)
@@ -303,6 +303,10 @@ build_vbase_path (code, type, expr, path, alias_this)
 
   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
         function, then it could be 0 on entry to any function.
         Preserve such zeroness here.  Otherwise, only in the
index d05516f..27d38fc 100644 (file)
@@ -609,6 +609,9 @@ build_up_reference (type, arg, flags, checkconst)
        rval
          = convert_to_pointer_force (build_pointer_type (target_type), rval);
       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;
   return rval;
@@ -683,6 +686,9 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
                             convtype, flags);
          TREE_TYPE (expr) = type;
          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;
        }