This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: More memory reductions on PR c++/12850
- From: Jan Hubicka <jh at suse dot cz>
- To: Eric Botcazou <ebotcazou at libertysurf dot fr>
- Cc: Jan Hubicka <jh at suse dot cz>, gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Mon, 9 Feb 2004 20:21:25 +0100
- Subject: Re: More memory reductions on PR c++/12850
- References: <20040128211648.GE8094@kam.mff.cuni.cz> <200402082100.54210.ebotcazou@libertysurf.fr>
> > 2004-01-28 Jan Hubicka <jh@suse.cz>
> > PR c++/12850
> > * cgraph.c (cgraph_remove_node): Clear out saved/insns/arguments and
> > initial pointers.
> > * cgraphunit.c (cgraph_finalize_function): Clear out DECL_SAVED_INSNS
> > for functions that will be only inlined.
> > (cgraph_mark_function_to_output): Likewise.
> > (cgraph_expand_function): Sanity check that DECL_DEFER_OUTPUT is clear;
> > do not clear function body.
> > * tree-optimize.c (clear_decl_rtl): Use decl_function_context.
> > (tree_rest_of_compilation): Reorganize the logic releasing function
> > body to use callgraph datastructure.
>
> This patch introduced several C++ regressions on SPARC:
>
> FAIL: g++.dg/abi/covariant2.C (test for excess errors)
> FAIL: g++.dg/abi/covariant3.C (test for excess errors)
> UNRESOLVED: g++.dg/ext/attrib10.C
> FAIL: g++.dg/inherit/covariant11.C (test for excess errors)
> FAIL: g++.dg/inherit/covariant3.C (test for excess errors)
> WARNING: g++.dg/inherit/covariant3.C compilation failed to produce executable
> FAIL: g++.dg/inherit/covariant4.C (test for excess errors)
> WARNING: g++.dg/inherit/covariant4.C compilation failed to produce executable
> FAIL: g++.dg/inherit/covariant6.C (test for excess errors)
> FAIL: g++.dg/inherit/covariant8.C (test for excess errors)
> FAIL: g++.dg/inherit/covariant9.C (test for excess errors)
> UNRESOLVED: g++.old-deja/g++.ext/attrib5.C
> FAIL: g++.old-deja/g++.robertl/eb17.C (test for excess errors)
> WARNING: g++.old-deja/g++.robertl/eb17.C compilation failed to produce
> executable
>
>
> covariant2.C aborts on a sanity check because start_function is passed a
> function with a null DECL_ARGUMENTS, from use_thunk. I guess you didn't see
> it on i386 because TARGET_ASM_CAN_OUTPUT_MI_THUNK is different.
Hi,
I am having bad luck to reproduce it on i386, but in the case I
understand the problem right, the attached patch shall fix it.
It is C++ frontend busyness to release datastructures it didn't passed
to cgraph, but it is not very good on doing it, unfortunately.
Honza
Index: cgraph.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraph.c,v
retrieving revision 1.41.2.4
diff -c -3 -p -r1.41.2.4 cgraph.c
*** cgraph.c 1 Feb 2004 13:01:09 -0000 1.41.2.4
--- cgraph.c 9 Feb 2004 18:47:05 -0000
*************** cgraph_remove_node (struct cgraph_node *
*** 234,243 ****
cgraph_nodes = node->next;
if (node->next)
node->next->previous = node->previous;
! DECL_SAVED_TREE (node->decl) = NULL;
! DECL_SAVED_INSNS (node->decl) = NULL;
! DECL_ARGUMENTS (node->decl) = NULL;
! DECL_INITIAL (node->decl) = error_mark_node;
slot =
htab_find_slot_with_hash (cgraph_hash, DECL_ASSEMBLER_NAME (node->decl),
IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME
--- 234,246 ----
cgraph_nodes = node->next;
if (node->next)
node->next->previous = node->previous;
! if (node->local.finalized)
! {
! DECL_SAVED_TREE (node->decl) = NULL;
! DECL_SAVED_INSNS (node->decl) = NULL;
! DECL_ARGUMENTS (node->decl) = NULL;
! DECL_INITIAL (node->decl) = error_mark_node;
! }
slot =
htab_find_slot_with_hash (cgraph_hash, DECL_ASSEMBLER_NAME (node->decl),
IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME