This is the mail archive of the 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]

Re: [patch] for PR32018

On 5/22/07, Zdenek Dvorak <> wrote:

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

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.



        PR middle-end/32018
        * tree-ssa-threadupdate.c (thread_through_loop_header): Use
        (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.
        * (cfg.o): Add CFGLOOP_H dependency.
        * basic-block.h (set_loop_copy, get_loop_copy): Declare.

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