diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-24 09:08:56 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-24 09:08:56 +0000 |
commit | 8e9955ee170ced21e95ad4652db8a4c96f52cbf4 (patch) | |
tree | 5d960bdbe98ce91b7d6e48d032f6ef7eee82c859 /gcc/gimple.h | |
parent | c787842a0678f60362f809c9231c71cdd23b4a03 (diff) | |
download | gcc-8e9955ee170ced21e95ad4652db8a4c96f52cbf4.tar.gz |
PR debug/54828
* gimple.h (is_gimple_sizepos): New inline function.
* gimplify.c (gimplify_one_sizepos): Use it. Remove useless
final assignment to expr variable.
* tree.c (RETURN_TRUE_IF_VAR): Return true also if
!TYPE_SIZES_GIMPLIFIED (type) and _t is going to be gimplified
into a local temporary.
* g++.dg/debug/pr54828.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192759 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r-- | gcc/gimple.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h index bca1e149227..b34016aaac1 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -957,6 +957,24 @@ struct gimplify_ctx bool in_cleanup_point_expr; }; +/* Return true if gimplify_one_sizepos doesn't need to gimplify + expr (when in TYPE_SIZE{,_UNIT} and similar type/decl size/bitsize + fields). */ +static inline bool +is_gimple_sizepos (tree expr) +{ + /* gimplify_one_sizepos doesn't need to do anything if the value isn't there, + is constant, or contains A PLACEHOLDER_EXPR. We also don't want to do + anything if it's already a VAR_DECL. If it's a VAR_DECL from another + function, the gimplifier will want to replace it with a new variable, + but that will cause problems if this type is from outside the function. + It's OK to have that here. */ + return (expr == NULL_TREE + || TREE_CONSTANT (expr) + || TREE_CODE (expr) == VAR_DECL + || CONTAINS_PLACEHOLDER_P (expr)); +} + extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *, bool (*) (tree), fallback_t); extern void gimplify_type_sizes (tree, gimple_seq *); |