On Tue, Sep 29, 2026 at 11:32 AM Eric Botcazou <[email protected]> wrote:
>
> Hi,
>
> the STMT parameter of the new optimize_agr_copyprop_1 in tree-ssa-forwprop.cc
> is only used for the dump file:
>
>   if (dump_file && (dump_flags & TDF_DETAILS))
>     {
>       fprintf (dump_file, "Simplified\n  ");
>       print_gimple_stmt (dump_file, use_stmt, 0, dump_flags);
>       fprintf (dump_file, "after previous\n  ");
>       print_gimple_stmt (dump_file, stmt, 0, dump_flags);
>     }
>
> so it makes no sense to use the index of its BB to purge EH edges:
>
>   if (maybe_clean_or_replace_eh_stmt (orig_stmt, use_stmt))
>     bitmap_set_bit (to_purge, gimple_bb (stmt)->index);
>
> Instead the index of the BB of USE_STMT needs to be used, as in the attached
> patch.  This fixes the failure of 4 ACATS tests with a modified compiler based
> on GCC 16.
>
> Tested on x86-64/Linux, OK for the mainline and 16 branch?

Yes and sorry for the typo.  I think what happened is I copied the
bitmap_set_bit line from a different place and forgot to update to the
use_stmt and didn't notice it.

Thanks,
Andrea

>
>
> 2026-09-29  Eric Botcazou  <[email protected]>
>
>         * tree-ssa-forwprop.cc (optimize_agr_copyprop_1): Use the index of
>         the basic block of USE_STMT instead of STMT to purge EH edges.
>
> --
> Eric Botcazou

Reply via email to