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/tree.c | |
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/tree.c')
-rw-r--r-- | gcc/tree.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index d974362de27..7cb1ea14d1d 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -8467,14 +8467,19 @@ variably_modified_type_p (tree type, tree fn) tree t; /* Test if T is either variable (if FN is zero) or an expression containing - a variable in FN. */ + a variable in FN. If TYPE isn't gimplified, return true also if + gimplify_one_sizepos would gimplify the expression into a local + variable. */ #define RETURN_TRUE_IF_VAR(T) \ do { tree _t = (T); \ if (_t != NULL_TREE \ && _t != error_mark_node \ && TREE_CODE (_t) != INTEGER_CST \ && TREE_CODE (_t) != PLACEHOLDER_EXPR \ - && (!fn || walk_tree (&_t, find_var_from_fn, fn, NULL))) \ + && (!fn \ + || (!TYPE_SIZES_GIMPLIFIED (type) \ + && !is_gimple_sizepos (_t)) \ + || walk_tree (&_t, find_var_from_fn, fn, NULL))) \ return true; } while (0) if (type == error_mark_node) |