diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-10-04 23:18:09 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-10-04 23:18:09 +0000 |
commit | 8a693bd0bbd4a31a457cbd1a8692eeed60c1fb32 (patch) | |
tree | caa4d91eb575c61613e3e99ae95c86c8600f14ba /gcc/stmt.c | |
parent | 436c94cb55eb00f2120e95963538331a2469fd6a (diff) | |
download | gcc-8a693bd0bbd4a31a457cbd1a8692eeed60c1fb32.zip gcc-8a693bd0bbd4a31a457cbd1a8692eeed60c1fb32.tar.gz gcc-8a693bd0bbd4a31a457cbd1a8692eeed60c1fb32.tar.bz2 |
stmt.c (expand_anon_union_decl): When any of the elements of the union is addressable, so is the entire union.
* stmt.c (expand_anon_union_decl): When any of the elements of the
union is addressable, so is the entire union.
From-SVN: r29816
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -4162,15 +4162,25 @@ expand_anon_union_decl (decl, cleanup, decl_elts) { struct nesting *thisblock = current_function == 0 ? 0 : block_stack; rtx x; + tree t; + /* If any of the elements are addressable, so is the entire union. */ + for (t = decl_elts; t; t = TREE_CHAIN (t)) + if (TREE_ADDRESSABLE (TREE_VALUE (t))) + { + TREE_ADDRESSABLE (decl) = 1; + break; + } + expand_decl (decl); expand_decl_cleanup (decl, cleanup); x = DECL_RTL (decl); - while (decl_elts) + /* Go through the elements, assigning RTL to each. */ + for (t = decl_elts; t; t = TREE_CHAIN (t)) { - tree decl_elt = TREE_VALUE (decl_elts); - tree cleanup_elt = TREE_PURPOSE (decl_elts); + tree decl_elt = TREE_VALUE (t); + tree cleanup_elt = TREE_PURPOSE (t); enum machine_mode mode = TYPE_MODE (TREE_TYPE (decl_elt)); /* Propagate the union's alignment to the elements. */ @@ -4213,8 +4223,6 @@ expand_anon_union_decl (decl, cleanup, decl_elts) thisblock->data.block.cleanups = temp_tree_cons (decl_elt, cleanup_elt, thisblock->data.block.cleanups); - - decl_elts = TREE_CHAIN (decl_elts); } } |