On Mon, Mar 20, 2023 at 12:12:14PM +0000, Richard Biener wrote:
> PR tree-optimization/109170
> * gimple-range-op.cc (cfn_pass_through_arg1): New.
> (gimple_range_op_handler::maybe_builtin_call): Handle
> __builtin_expect and similar via cfn_pass_through_arg1
> and inspecting the calls fnspec.
> * builtins.cc (builtin_fnspec): Handle BUILT_IN_EXPECT
> and BUILT_IN_EXPECT_WITH_PROBABILITY.
I'm still worried about this builtins.cc change, can't we defer
that part till GCC 14 where there will be enough time to see if it
doesn't result in some undesirable problems (__builtin_expect* being
optimized away when it still shouldn't etc.)?
>
> * gcc.dg/Wuse-after-free-pr109170.c: New testcase.
> * gcc.dg/tree-ssa/ssa-lim-21.c: Adjust.
> * gcc.dg/predict-20.c: Likewise.
Otherwise LGTM.
Jakub