From 848be0946c097a25e63acea3e16eee11fc41e6c9 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 24 Oct 2012 11:08:56 +0200 Subject: re PR debug/54828 (ICE in based_loc_descr at dwarf2out.c:10560 with -g -O0) 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. From-SVN: r192759 --- gcc/tree.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc/tree.c') diff --git a/gcc/tree.c b/gcc/tree.c index d974362..7cb1ea1 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) -- cgit v1.1