From 8a693bd0bbd4a31a457cbd1a8692eeed60c1fb32 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Mon, 4 Oct 1999 23:18:09 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 +++++ gcc/stmt.c | 18 +++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 71c02a8479b..a03ab5dd3eb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Mon Oct 4 16:22:20 1999 Mark Mitchell + + * stmt.c (expand_anon_union_decl): When any of the elements of the + union is addressable, so is the entire union. + Mon Oct 4 11:38:33 1999 Richard Henderson * sbitmap.c (sbitmap_ones): Don't set too many bits. diff --git a/gcc/stmt.c b/gcc/stmt.c index 9d675021cbb..4e5a7a8ea87 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -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); } } -- 2.30.2