This is the mail archive of the
mailing list for the GCC project.
[incremental] Patch: FYI: 2 cgraph tweaks
- From: Tom Tromey <tromey at redhat dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 10 Oct 2007 16:03:37 -0600
- Subject: [incremental] Patch: FYI: 2 cgraph tweaks
- Reply-to: Tom Tromey <tromey at redhat dot com>
I'm checking this in on the incremental-compiler branch.
My change to cgraphbuild.c the other day was ill-advised. We need to
look at the canonical decl in record_reference to handle the case of
an initializer referring to a non-canonical function decl.
Also, an assertion in cgraph_note_duplicate could incorrectly trigger
This still doesn't bootstrap but gets much further.
2007-10-10 Tom Tromey <firstname.lastname@example.org>
* cgraph.c (cgraph_note_duplicate): Refine assertion.
* cgraphbuild.c (record_reference): Use cgraph_canonical_decl.
--- cgraphbuild.c (revision 129141)
+++ cgraphbuild.c (working copy)
@@ -59,7 +59,7 @@
functions reachable unconditionally. */
tree decl = TREE_OPERAND (*tp, 0);
if (TREE_CODE (decl) == FUNCTION_DECL)
- cgraph_mark_needed_node (cgraph_node (decl));
+ cgraph_mark_needed_node (cgraph_node (cgraph_canonical_decl (decl)));
--- cgraph.c (revision 129141)
+++ cgraph.c (working copy)
@@ -278,7 +278,9 @@
/* We already saw a definition of the function, so reverse
the duplication. */
- gcc_assert (DECL_INITIAL (decl));
+ /* If unit-at-a-time, we should only see definitions here.
+ If no-unit-at-a-time, we might see a declaration. */
+ gcc_assert (!flag_unit_at_a_time || DECL_INITIAL (decl));
tem = duplicate;
duplicate = decl;
decl = tem;