This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PR lto/44812 (missing indirections on Darwin)
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org, rguenther at suse dot de, rth at redhat dot com, dnovillo at google dot com
- Date: Fri, 3 Sep 2010 13:15:31 +0200
- Subject: PR lto/44812 (missing indirections on Darwin)
Hi,
WHOPR partitioning confused darwin, since function/variables from other partitions are declared
as !DECL_EXTERNAL. This works on elf target as there is no difference in referring symbol
in current .s file or known to be in current DSO.
The patch caused missed optimization in constant folding I fixed now, but still when I compile
Mozilla, i get code size increase 23815472 to 23882616 (on x86_64-linux).
I found some other cases where we miss initializer fodling in expr.c triggering during bootstrap
and I am in progress of fixing this. I guess the regression is tiny enough so we ought to fix
the correctness issue.
Bootstrapped/regtested x86_64-linux (and tested to fix Darwin's issues)
OK?
Honza
PR lto/44812
* lto-cgraph.c (intput_node, input_varpool_node): Set DECL_EXTERNAL
on functions/variables in other partition.
--- lto-cgraph.c 2010-09-03 12:12:36.000000000 +0200
+++ lto-cgraph.c1 2010-09-03 12:10:43.000000000 +0200
@@ -953,6 +953,11 @@
node->lowered = bp_unpack_value (bp, 1);
node->analyzed = tag == LTO_cgraph_analyzed_node;
node->in_other_partition = bp_unpack_value (bp, 1);
+ if (node->in_other_partition)
+ {
+ DECL_EXTERNAL (node->decl) = 1;
+ TREE_STATIC (node->decl) = 0;
+ }
node->alias = bp_unpack_value (bp, 1);
node->finalized_by_frontend = bp_unpack_value (bp, 1);
node->frequency = (enum node_frequency)bp_unpack_value (bp, 2);
@@ -1111,6 +1116,11 @@
node->analyzed = node->finalized;
node->used_from_other_partition = bp_unpack_value (&bp, 1);
node->in_other_partition = bp_unpack_value (&bp, 1);
+ if (node->in_other_partition)
+ {
+ DECL_EXTERNAL (node->decl) = 1;
+ TREE_STATIC (node->decl) = 0;
+ }
aliases_p = bp_unpack_value (&bp, 1);
if (node->finalized)
varpool_mark_needed_node (node);