diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-18 15:17:10 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-18 15:17:10 +0000 |
commit | 78fa9ba7f63d3c9ea10d354dc38aad11a2965704 (patch) | |
tree | 898acbe389ec22bb548f7bcc5341513f81c694a6 /gcc/cfgexpand.c | |
parent | 7c7ae05372b475b93ecde42ec706e5181941fb51 (diff) | |
download | gcc-78fa9ba7f63d3c9ea10d354dc38aad11a2965704.tar.gz |
PR debug/34037
* gimplify.c (gimplify_type_sizes): When not optimizing, ensure
TYPE_MIN_VALUE and TYPE_MAX_VALUE is not is not DECL_IGNORED_P
VAR_DECL.
* cfgexpand.c (expand_used_vars): Keep DECL_ARTIFICIAL
!DECL_IGNORED_P vars in local_decls list for instantiate_decls,
ggc_free other TREE_LIST nodes from that chain.
* function.c (instantiate_decls): Instantiate also DECL_RTL
of vars in cfun->local_decls, free that list afterwards.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140459 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index d9e9835643b..06111cc85df 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1440,7 +1440,7 @@ estimated_stack_frame_size (void) static void expand_used_vars (void) { - tree t, outer_block = DECL_INITIAL (current_function_decl); + tree t, next, outer_block = DECL_INITIAL (current_function_decl); /* Compute the phase of the stack frame for this function. */ { @@ -1453,11 +1453,15 @@ expand_used_vars (void) /* At this point all variables on the local_decls with TREE_USED set are not associated with any block scope. Lay them out. */ - for (t = cfun->local_decls; t; t = TREE_CHAIN (t)) + t = cfun->local_decls; + cfun->local_decls = NULL_TREE; + for (; t; t = next) { tree var = TREE_VALUE (t); bool expand_now = false; + next = TREE_CHAIN (t); + /* We didn't set a block for static or extern because it's hard to tell the difference between a global variable (re)declared in a local scope, and one that's really declared there to @@ -1484,9 +1488,25 @@ expand_used_vars (void) TREE_USED (var) = 1; if (expand_now) - expand_one_var (var, true, true); + { + expand_one_var (var, true, true); + if (DECL_ARTIFICIAL (var) && !DECL_IGNORED_P (var)) + { + rtx rtl = DECL_RTL_IF_SET (var); + + /* Keep artificial non-ignored vars in cfun->local_decls + chain until instantiate_decls. */ + if (rtl && (MEM_P (rtl) || GET_CODE (rtl) == CONCAT)) + { + TREE_CHAIN (t) = cfun->local_decls; + cfun->local_decls = t; + continue; + } + } + } + + ggc_free (t); } - cfun->local_decls = NULL_TREE; /* At this point, all variables within the block tree with TREE_USED set are actually used by the optimized function. Lay them out. */ |