This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-profiling] Re: a bug in duplicate_stmt_eh_region
- From: Jan Hubicka <jh at suse dot cz>
- To: Razya Ladelsky <RAZYA at il dot ibm dot com>, gcc-patches at gcc dot gnu dot org
- Cc: jh at suse dot cz
- Date: Thu, 3 Feb 2005 19:43:01 +0100
- Subject: [tree-profiling] Re: a bug in duplicate_stmt_eh_region
- References: <OFB7F9E1A9.9ED9DAA4-ONC2256F9D.0047D3FB-C2256F9D.0048E88F@il.ibm.com>
> Jan,
>
> When debugging a failing g++ regression test, I discovered what I think is
> a bug in duplicate_stmt_eh_region (), tree-eh.c.
> I guess that since versioning goes through a different path than inlining,
> versioning uncovered this bug.
> The elements of the htab are allocated through ggc_alloc, but not freed
> through ggc_free.
>
> Here's my fix :
>
> Index: tree-eh.c
> ===================================================================
> RCS file: /cvsroot/gcc/gcc/gcc/tree-eh.c,v
> retrieving revision 1.1.2.23.2.14
> diff -c -3 -p -r1.1.2.23.2.14 tree-eh.c
> *** tree-eh.c 18 Jan 2005 19:40:59 -0000 1.1.2.23.2.14
> --- tree-eh.c 3 Feb 2005 13:25:20 -0000
> *************** duplicate_stmt_eh_region_mapping (struct
> *** 204,210 ****
>
> if (!cfun_hash)
> {
> ! cfun_hash = htab_create_ggc (31, struct_ptr_hash, struct_ptr_eq,
> free);
> set_eh_throw_stmt_table (cfun, (void *)cfun_hash);
> }
>
> --- 204,210 ----
>
> if (!cfun_hash)
> {
> ! cfun_hash = htab_create_ggc (31, struct_ptr_hash, struct_ptr_eq,
> ggc_free);
> set_eh_throw_stmt_table (cfun, (void *)cfun_hash);
> }
>
> Do you agree ?
Yes, I've bootstrapped/regtested i686-linux and commited it. Thanks!
Honza
>
> Thanks,
> Razya