This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ipa-prop for vector reallocation (PR other/37419)
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 9 Sep 2008 14:17:35 +0200
- Subject: Re: [PATCH] Fix ipa-prop for vector reallocation (PR other/37419)
- References: <20080909120348.GL17472@hs20-bc2-1.build.redhat.com>
> Hi!
>
> When a call appends to a vector and might actually need to reallocate it,
> passing the vector around as VEC (cgraph_edge_p, heap) *new_edges is fatal,
> as the caller after reallocation will work with freed memory. We need
> to pass the VEC * by reference. Also, the ipa_check_create_edge_args ()
> call in update_call_notes_after_inlining might reallocate the vector
> for IPA_EDGE_REF, which means top would be in freed memory. Fixed by
> rereading it after the ipa_check_create_edge_args call.
> Without this valgrind, glibc malloc and ElectricFence complain loudly.
Nasty...
>
> Ok for trunk?
OK,
thanks!
Honza