diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-10-24 09:08:56 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2012-10-24 09:08:56 +0000 |
commit | a3ae0018dae546979e8f50f26d2083359361d45a (patch) | |
tree | 5d960bdbe98ce91b7d6e48d032f6ef7eee82c859 /gcc/tree.c | |
parent | e6e45920dd9599dcc99b8e91731558d59a2f050b (diff) |
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: https://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) |