Commit e3b127e8 by Richard Guenther Committed by Richard Biener

re PR debug/53470 (ICE when linking with -g in splice_child_die, at dwarf2out.c:4264)

2012-06-11  Richard Guenther  <rguenther@suse.de>

	PR middle-end/53470
	* tree.c (free_lang_data_in_type): Do not clear TYPE_CONTEXT but
	replace it with the first non-BLOCK context.

	* g++.dg/lto/pr53470_0.C: New testcase.
	* gcc.dg/lto/pr53470_0.c: Likewise.

From-SVN: r188387
parent 5a20ffcb
2012-06-11 Richard Guenther <rguenther@suse.de>
PR middle-end/53470
* tree.c (free_lang_data_in_type): Do not clear TYPE_CONTEXT but
replace it with the first non-BLOCK context.
2012-06-11 Richard Guenther <rguenther@suse.de>
* alias.c (aliases_everything_p): Remove.
(DIFFERENT_ALIAS_SETS_P): Likewise.
(true_dependence_1): Use mems_in_disjoint_alias_sets_p directly.
......
2012-06-11 Richard Guenther <rguenther@suse.de>
PR middle-end/53470
* g++.dg/lto/pr53470_0.C: New testcase.
* gcc.dg/lto/pr53470_0.c: Likewise.
2012-06-11 Richard Guenther <rguenther@suse.de>
PR c++/53616
* g++.dg/ext/pr53605.C: New testcase.
......
// { dg-lto-do link }
// { dg-lto-options { { -g -flto } } }
class sp_counted_base;
class shared_count {
sp_counted_base *pi_;
public:
template<class Y> shared_count(Y) : pi_() {}
~shared_count() {}
};
template<class T> struct shared_ptr {
T element_type;
template<class Y> shared_ptr(Y) : pn(0) {}
shared_count pn;
};
template<class> class ECGetterBase;
template<class T> struct ExtensionCord {
struct Holder {
ECGetterBase<T> *getter_;
};
ExtensionCord() : holder_(new Holder) {}
shared_ptr<Holder> holder_;
};
ExtensionCord<int> a;
int main() {}
/* { dg-lto-do link } */
/* { dg-lto-options { { -flto } { -flto -g } } } */
int main ()
{
{
union A { } v;
}
}
......@@ -4575,11 +4575,17 @@ free_lang_data_in_type (tree type)
free_lang_data_in_one_sizepos (&TYPE_SIZE (type));
free_lang_data_in_one_sizepos (&TYPE_SIZE_UNIT (type));
if (debug_info_level < DINFO_LEVEL_TERSE
|| (TYPE_CONTEXT (type)
&& TREE_CODE (TYPE_CONTEXT (type)) != FUNCTION_DECL
&& TREE_CODE (TYPE_CONTEXT (type)) != NAMESPACE_DECL))
TYPE_CONTEXT (type) = NULL_TREE;
if (TYPE_CONTEXT (type)
&& TREE_CODE (TYPE_CONTEXT (type)) == BLOCK)
{
tree ctx = TYPE_CONTEXT (type);
do
{
ctx = BLOCK_SUPERCONTEXT (ctx);
}
while (ctx && TREE_CODE (ctx) == BLOCK);
TYPE_CONTEXT (type) = ctx;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment