On 04/07/2011 01:34 PM, Alexander Monakov wrote:
Hello,

(quoting myself from the PR audit trail)
We call sched_scan for preheader blocks from inner regions twice: first during
sel_add_loop_preheaders, and then during the subsequent call to sel_init_bbs
in setup_current_loop_nest.  As a result, we also call remove_notes for those
blocks twice, and after the second call incorrectly record that the block has
no notes.

The solution is to call sel_add_loop_preheaders after sel_init_bbs.  We need
to add new preheader blocks into 'bbs' vector in setup_current_loop_nest, so
we pass the pointer to the vector to sel_add_loop_preheaders.


        PR rtl-optimization/48302
        * sel-sched-ir.h (sel_add_loop_preheaders): Update prototype.
        * sel-sched-ir.c (sel_add_loop_preheaders): Add 'bbs' argument.  Use
        it to record added preheader blocks.
        (setup_current_loop_nest): Add 'bbs' argument.  Pass it on to
        sel_add_loop_preheaders.
        (sel_region_init): Move call to setup_current_loop_nest after
        sel_init_bbs.

testsuite:
        g++.dg/opt/pr48302.C: New.
Ok, thanks.

Reply via email to