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/gimplify.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/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index bb38ba398f6..d723d9f16a9 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -7117,6 +7117,18 @@ gimplify_type_sizes (tree type, gimple_seq *list_p) /* These types may not have declarations, so handle them here. */ gimplify_type_sizes (TREE_TYPE (type), list_p); gimplify_type_sizes (TYPE_DOMAIN (type), list_p); + /* When not optimizing, ensure VLA bounds aren't removed. */ + if (!optimize + && TYPE_DOMAIN (type) + && INTEGRAL_TYPE_P (TYPE_DOMAIN (type))) + { + t = TYPE_MIN_VALUE (TYPE_DOMAIN (type)); + if (t && TREE_CODE (t) == VAR_DECL && DECL_ARTIFICIAL (t)) + DECL_IGNORED_P (t) = 0; + t = TYPE_MAX_VALUE (TYPE_DOMAIN (type)); + if (t && TREE_CODE (t) == VAR_DECL && DECL_ARTIFICIAL (t)) + DECL_IGNORED_P (t) = 0; + } break; case RECORD_TYPE: |