This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-profiling] Re: a bug in duplicate_stmt_eh_region


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]