]> gcc.gnu.org Git - gcc.git/commitdiff
varasm.c (output_constant): Strip off a CONVERT_EXPR to a UNION_TYPE.
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Thu, 2 Mar 2000 23:30:38 +0000 (23:30 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 2 Mar 2000 23:30:38 +0000 (18:30 -0500)
* varasm.c (output_constant): Strip off a CONVERT_EXPR to
a UNION_TYPE.

From-SVN: r32295

gcc/ChangeLog
gcc/varasm.c

index 00485c663591be892c199281a85f7eea68c1e29a..04824c6eb5d607f76993e765938b61307e38345c 100644 (file)
@@ -1,3 +1,8 @@
+Thu Mar  2 17:27:13 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * varasm.c (output_constant): Strip off a CONVERT_EXPR to
+       a UNION_TYPE.
+
 2000-03-02  Zack Weinberg  <zack@wolery.cumb.org>
 
        * cppfiles.c (cpp_read_file): New function.
index 992a3a3382ab562fdc5e6b0ac708c6b0a802eeb2..c84affcf54cf74d510c2f10f039490182c0ef059 100644 (file)
@@ -4207,12 +4207,18 @@ output_constant (exp, size)
 
   /* Eliminate the NON_LVALUE_EXPR_EXPR that makes a cast not be an lvalue.
      That way we get the constant (we hope) inside it.  Also, strip off any
-     NOP_EXPR that converts between two record, union, array, or set types.  */
+     NOP_EXPR that converts between two record, union, array, or set types
+     or a CONVERT_EXPR that converts to a union TYPE.  */
   while ((TREE_CODE (exp) == NOP_EXPR 
          && (TREE_TYPE (exp) == TREE_TYPE (TREE_OPERAND (exp, 0))
              || AGGREGATE_TYPE_P (TREE_TYPE (exp))))
+        || (TREE_CODE (exp) == CONVERT_EXPR
+            && code == UNION_TYPE)
         || TREE_CODE (exp) == NON_LVALUE_EXPR)
-    exp = TREE_OPERAND (exp, 0);
+    {
+      exp = TREE_OPERAND (exp, 0);
+      code = TREE_CODE (TREE_TYPE (exp));
+    }
 
   /* Allow a constructor with no elements for any data type.
      This means to fill the space with zeros.  */
This page took 0.072144 seconds and 5 git commands to generate.