https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117414
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>: https://gcc.gnu.org/g:684e5ae90b64c3481f8a5cb7b9517daf79c78ab4 commit r15-5023-g684e5ae90b64c3481f8a5cb7b9517daf79c78ab4 Author: Andrew Pinski <quic_apin...@quicinc.com> Date: Fri Nov 1 23:20:22 2024 -0700 VN: Lookup `val != 0` if we got back val when looking up the predicate for GIMPLE_COND [PR117414] Sometimes we get back a full ssa name when looking up the comparison of the GIMPLE_COND rather than a predicate. We then want to lookup the `val != 0` for the predicate. Note this might happen with other boolean assignments and COND_EXPR but I am not sure if it is as important; I have not found a testcase yet. Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/117414 gcc/ChangeLog: * tree-ssa-sccvn.cc (process_bb): Lookup `val != 0` if got back a ssa name when looking the comparison. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/fre-predicated-4.c: New test. Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>