On Fri, 11 Nov 2022 11:17:17 -0500
Andrew MacLeod via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:

> diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc
> index 3393c73a7db..a474d9d11e5 100644
> --- a/gcc/tree-vrp.cc
> +++ b/gcc/tree-vrp.cc

> @@ -4485,6 +4486,7 @@ public:
>      for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
>        gsi_next (&gsi))
>        m_ranger->register_inferred_ranges (gsi.phi ());
> +    m_last_bb_stmt = last_stmt (bb);
>    }
>  
>    void post_fold_bb (basic_block bb) override
> @@ -4497,19 +4499,14 @@ public:
>    void pre_fold_stmt (gimple *stmt) override
>    {
>      m_pta->visit_stmt (stmt);
> +    // If this is the last stmt and there are inferred ranges, reparse the
> +    // block for transitive inferred ranges that occur earlier in the block.
> +    if (stmt == m_last_bb_stmt)
> +      m_ranger->register_transitive_inferred_ranges (gimple_bb (stmt));
>    }

So of course it doesn't really matter what that stmt was, a non_debug
is as good as a debug one AFAIU, it's just a marker, as good as any SSA
version or id, i suppose. So gsi_last_nondebug_bb(bb) is not strictly
needed, fine.

But since it's last_stmt(), do you have an opinion on 1) in
https://gcc.gnu.org/pipermail/gcc-help/2021-November/140908.html
by chance, as you seem to use it..

thanks,

Reply via email to