aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2008-09-18 17:17:10 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-09-18 17:17:10 +0200
commit802e9f8e7ccb805437419eef74a9a1cbe75a68ed (patch)
tree898acbe389ec22bb548f7bcc5341513f81c694a6 /gcc/gimplify.c
parenta2cd689a680e5287cbb4d704ca71092257583e96 (diff)
downloadgcc-802e9f8e7ccb805437419eef74a9a1cbe75a68ed.zip
gcc-802e9f8e7ccb805437419eef74a9a1cbe75a68ed.tar.gz
gcc-802e9f8e7ccb805437419eef74a9a1cbe75a68ed.tar.bz2
re PR debug/34037 (Bounds for VLAs not emitted into debuginfo)
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. From-SVN: r140459
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index bb38ba3..d723d9f 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: