[patch] for PR32018
Richard Guenther
richard.guenther@gmail.com
Wed May 23 09:39:00 GMT 2007
On 5/22/07, Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote:
> Hello,
>
> the copy field of loop structure (that contains reference to the copy of
> the loop during loop duplication) is not cleared, and may point to a
> loop that is later removed and freed. This cases ICE during garbage
> collection.
>
> Clearing the field when it is not used would solve the problem, but
> actually a more appropriate fix seems to be using the same mechanism for
> storing loop copies as we do for basic blocks (storing the information
> in temporary hash tables).
>
> Bootstrapped & regtested on i686.
This is ok.
Thanks,
Richard.
> Zdenek
>
> PR middle-end/32018
> * tree-ssa-threadupdate.c (thread_through_loop_header): Use
> set_loop_copy.
> (thread_through_all_blocks): Call initialize_original_copy_tables
> and free_original_copy_tables.
> * cfgloopmanip.c (duplicate_loop, duplicate_loop_to_header_edge):
> Use set_loop_copy.
> * tree-cfg.c (tree_duplicate_sese_region): Ditto.
> * cfghooks.c (duplicate_block): Use get_loop_copy.
> * cfg.c: Include cfgloop.h.
> (loop_copy): New hash table.
> (initialize_original_copy_tables): Initialize loop_copy table.
> (free_original_copy_tables): Free loop_copy table.
> (copy_original_table_clear, copy_original_table_set,
> set_loop_copy, get_loop_copy): New functions.
> (set_bb_original, set_bb_copy): Use copy_original_table_set.
> * cfgloop.h (struct loop): Remove copy field.
> * Makefile.in (cfg.o): Add CFGLOOP_H dependency.
> * basic-block.h (set_loop_copy, get_loop_copy): Declare.
>
More information about the Gcc-patches
mailing list