Commit fdb415fe by Andrew Pinski Committed by Andrew Pinski

re PR lto/51198 ([c++0x] [4.7 Regression] ICE with -flto and non-static data member initializers)

2011-12-01  Andrew Pinski  <apinski@cavium.com>

	PR lto/51198
	* tree.c (free_lang_data_in_decl): Clear FIELD_DECL's
	DECL_INITIAL also.

2011-12-01  Andrew Pinski  <apinski@cavium.com>

	PR lto/51198
	* g++.dg/torture/pr51198.C: New testcase.

From-SVN: r181886
parent 17dcf075
2011-12-01 Andrew Pinski <apinski@cavium.com>
PR lto/51198
* tree.c (free_lang_data_in_decl): Clear FIELD_DECL's
DECL_INITIAL also.
2011-12-01 Jakub Jelinek <jakub@redhat.com> 2011-12-01 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/51246 PR tree-optimization/51246
2011-12-01 Andrew Pinski <apinski@cavium.com>
PR lto/51198
* g++.dg/torture/pr51198.C: New testcase.
2011-12-01 Jakub Jelinek <jakub@redhat.com> 2011-12-01 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/51246 PR tree-optimization/51246
......
/* { dg-options "-std=gnu++0x" } */
struct A
{
int i = 0 ? 0 : throw 1;
};
struct B
{
int f();
int i = f();
};
struct C
{
C(int);
};
struct D
{
C a = 0;
};
A a;
B b;
D d;
...@@ -4651,7 +4651,8 @@ free_lang_data_in_decl (tree decl) ...@@ -4651,7 +4651,8 @@ free_lang_data_in_decl (tree decl)
|| (decl_function_context (decl) && !TREE_STATIC (decl))) || (decl_function_context (decl) && !TREE_STATIC (decl)))
DECL_INITIAL (decl) = NULL_TREE; DECL_INITIAL (decl) = NULL_TREE;
} }
else if (TREE_CODE (decl) == TYPE_DECL) else if (TREE_CODE (decl) == TYPE_DECL
|| TREE_CODE (decl) == FIELD_DECL)
DECL_INITIAL (decl) = NULL_TREE; DECL_INITIAL (decl) = NULL_TREE;
else if (TREE_CODE (decl) == TRANSLATION_UNIT_DECL else if (TREE_CODE (decl) == TRANSLATION_UNIT_DECL
&& DECL_INITIAL (decl) && DECL_INITIAL (decl)
......
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