Commit 27e2bd9f by Richard Biener Committed by Richard Biener

re PR ipa/66705 (section is missing linker error with -flto -fipa-pta)

2015-09-03  Richard Biener  <rguenther@suse.de>

	PR ipa/66705
	* tree-ssa-structalias.c (ctor_for_analysis): New function.
	(create_variable_info_for_1): Use ctor_for_analysis instead
	of get_constructor.
	(create_variable_info_for): Likewise.

	* g++.dg/lto/pr66705_0.C: New testcase.

From-SVN: r227430
parent 37d13ae6
2015-09-03 Richard Biener <rguenther@suse.de>
PR ipa/66705
* tree-ssa-structalias.c (ctor_for_analysis): New function.
(create_variable_info_for_1): Use ctor_for_analysis instead
of get_constructor.
(create_variable_info_for): Likewise.
2015-09-02 Charles Baylis <charles.baylis@linaro.org> 2015-09-02 Charles Baylis <charles.baylis@linaro.org>
* cgraphunit.c (cgraph_node::create_wrapper): Set can_throw_external * cgraphunit.c (cgraph_node::create_wrapper): Set can_throw_external
......
2015-09-03 Richard Biener <rguenther@suse.de>
PR ipa/66705
* g++.dg/lto/pr66705_0.C: New testcase.
2015-09-02 Balaji V. Iyer <balaji.v.iyer@intel.com> 2015-09-02 Balaji V. Iyer <balaji.v.iyer@intel.com>
PR middle-end/60586 PR middle-end/60586
......
// { dg-lto-do link }
// { dg-lto-options { { -O2 -flto -flto-partition=max -fipa-pta } } }
// { dg-extra-ld-options "-r -nostdlib" }
class A {
public:
A();
};
int a = 0;
void foo() {
a = 0;
A b;
for (; a;)
;
}
...@@ -5619,7 +5619,6 @@ create_variable_info_for_1 (tree decl, const char *name) ...@@ -5619,7 +5619,6 @@ create_variable_info_for_1 (tree decl, const char *name)
auto_vec<fieldoff_s> fieldstack; auto_vec<fieldoff_s> fieldstack;
fieldoff_s *fo; fieldoff_s *fo;
unsigned int i; unsigned int i;
varpool_node *vnode;
if (!declsize if (!declsize
|| !tree_fits_uhwi_p (declsize)) || !tree_fits_uhwi_p (declsize))
...@@ -5637,12 +5636,10 @@ create_variable_info_for_1 (tree decl, const char *name) ...@@ -5637,12 +5636,10 @@ create_variable_info_for_1 (tree decl, const char *name)
/* Collect field information. */ /* Collect field information. */
if (use_field_sensitive if (use_field_sensitive
&& var_can_have_subvars (decl) && var_can_have_subvars (decl)
/* ??? Force us to not use subfields for global initializers /* ??? Force us to not use subfields for globals in IPA mode.
in IPA mode. Else we'd have to parse arbitrary initializers. */ Else we'd have to parse arbitrary initializers. */
&& !(in_ipa_mode && !(in_ipa_mode
&& is_global_var (decl) && is_global_var (decl)))
&& (vnode = varpool_node::get (decl))
&& vnode->get_constructor ()))
{ {
fieldoff_s *fo = NULL; fieldoff_s *fo = NULL;
bool notokay = false; bool notokay = false;
...@@ -5774,13 +5771,13 @@ create_variable_info_for (tree decl, const char *name) ...@@ -5774,13 +5771,13 @@ create_variable_info_for (tree decl, const char *name)
/* If this is a global variable with an initializer and we are in /* If this is a global variable with an initializer and we are in
IPA mode generate constraints for it. */ IPA mode generate constraints for it. */
if (vnode->get_constructor () ipa_ref *ref;
&& vnode->definition) for (unsigned idx = 0; vnode->iterate_reference (idx, ref); ++idx)
{ {
auto_vec<ce_s> rhsc; auto_vec<ce_s> rhsc;
struct constraint_expr lhs, *rhsp; struct constraint_expr lhs, *rhsp;
unsigned i; unsigned i;
get_constraint_for_rhs (vnode->get_constructor (), &rhsc); get_constraint_for_address_of (ref->referred->decl, &rhsc);
lhs.var = vi->id; lhs.var = vi->id;
lhs.offset = 0; lhs.offset = 0;
lhs.type = SCALAR; lhs.type = SCALAR;
......
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