20100108_0.c: New.

2010-01-10  Rafael Avila de Espindola  <espindola@google.com>

	* gcc.dg/lto/20100108_0.c: New.

2010-01-10  Rafael Avila de Espindola  <espindola@google.com>

	* lto-streamer-out.c (output_unreferenced_globals): Output static
	variables.

From-SVN: r155800
This commit is contained in:
Rafael Avila de Espindola 2010-01-11 02:28:49 +00:00 committed by Rafael Espindola
parent bd2638ac9f
commit 06bfe1d0e2
4 changed files with 25 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2010-01-10 Rafael Avila de Espindola <espindola@google.com>
* lto-streamer-out.c (output_unreferenced_globals): Output static
variables.
2010-01-10 Steven Bosscher <steven@gcc.gnu.org>
PR rtl-optimization/42621

View File

@ -1973,12 +1973,15 @@ output_unreferenced_globals (cgraph_node_set set)
{
tree var = vnode->decl;
if (TREE_CODE (var) == VAR_DECL && TREE_PUBLIC (var))
if (TREE_CODE (var) == VAR_DECL)
{
/* Outputting just the reference will not output the object itself
or references it might have.*/
/* Output the object in order to output references used in the
initialization. */
lto_output_tree (ob, var, true);
lto_output_tree_ref (ob, var);
/* If it is public we also need a reference to the object itself. */
if (TREE_PUBLIC (var))
lto_output_tree_ref (ob, var);
}
}

View File

@ -1,3 +1,7 @@
2010-01-10 Rafael Avila de Espindola <espindola@google.com>
* gcc.dg/lto/20100108_0.c: New.
2010-01-10 Uros Bizjak <ubizjak@gmail.com>
* gcc.dg/graphite/pr40281.c (dg-options): Add -w.

View File

@ -0,0 +1,9 @@
/* { dg-lto-do assemble } */
/* The problem with this testcase is that we were missing an undefined
reference to flag_exceptions. This can be tested with
GNUTARGET=plugin nm --plugin liblto_plugin.so 20100108_0.o
but we don't have support in the testsuite for doing it. */
extern int flag_exceptions;
static int *foo = &flag_exceptions;
int **bar = &foo;