aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-03-02 23:30:38 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2000-03-02 18:30:38 -0500
commit16214ee327ce67a984cb98816fb1230ccca232ac (patch)
treecc187d1def66ff1fce41d4480462874472542bd6 /gcc
parentb099f07de92d7b228ff662711b148addf4b2b115 (diff)
downloadgcc-16214ee327ce67a984cb98816fb1230ccca232ac.zip
gcc-16214ee327ce67a984cb98816fb1230ccca232ac.tar.gz
gcc-16214ee327ce67a984cb98816fb1230ccca232ac.tar.bz2
varasm.c (output_constant): Strip off a CONVERT_EXPR to a UNION_TYPE.
* varasm.c (output_constant): Strip off a CONVERT_EXPR to a UNION_TYPE. From-SVN: r32295
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/varasm.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 00485c6..04824c6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 992a3a3..c84affc 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -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. */