summaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-19 21:08:33 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-19 21:08:33 +0000
commit4e141ba194207fd108e22bad20a8efd8c62ad1f2 (patch)
tree6527e524281c131665bd6c6a7f833615dee15251 /gcc/stor-layout.c
parentafdc9016cd75c0ac0c9f439dc7fd4d5a4a4392d7 (diff)
downloadgcc-4e141ba194207fd108e22bad20a8efd8c62ad1f2.tar.gz
PR 18067
* stor-layout.c (variable_size): Force creation of a SAVE_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92389 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 6b78fa6520e..7069ad9b2ec 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -125,11 +125,19 @@ variable_size (tree size)
just return SIZE unchanged. Likewise for self-referential sizes and
constant sizes. */
if (TREE_CONSTANT (size)
+ || TREE_CODE (size) == SAVE_EXPR
|| lang_hooks.decls.global_bindings_p () < 0
|| CONTAINS_PLACEHOLDER_P (size))
return size;
- size = save_expr (size);
+ /* Force creation of a SAVE_EXPR. This solves (1) code duplication
+ problems between parent and nested functions that occasionally can't
+ be cleaned up because of portions of the expression escaping the
+ parent function via the FRAME object, and (2) tree sharing problems
+ between the type system and the gimple code, which can leak SSA_NAME
+ objects into e.g. TYPE_SIZE, which cause heartburn when emitting
+ debug information. */
+ size = build1 (SAVE_EXPR, TREE_TYPE (size), size);
/* If an array with a variable number of elements is declared, and
the elements require destruction, we will emit a cleanup for the