https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126658

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <[email protected]>:

https://gcc.gnu.org/g:b947bd4aac67ba3bdb6030aa4ac2f3eb0204df05

commit r17-3179-gb947bd4aac67ba3bdb6030aa4ac2f3eb0204df05
Author: Richard Biener <[email protected]>
Date:   Thu Aug 6 11:49:20 2026 +0200

    tree-optimization/126658 - TARGET_MEM_REF and non-null infering

    The following adjusts three places to avoid infering that operand
    zero of a TARGET_MEM_REF is literally dereferenced and thus may
    not be NULL.  This reflects the fact that within IVOPTs we cannot
    easily guarantee that there'll be a real pointer in TMR_BASE
    and fiddling with IVOPTs proved fragile.

    So we are taking a conservative stance here, with carving out
    the likely common case of a scaled index which is unlikely
    going to be a pointer (fingers crossing).

    For the testcase at hand the apparent non-NULLness was triggering
    a jump-threading miscompiling the testcase.

            PR tree-optimization/126658
            * gimple.cc (check_loadstore): Restrict TARGET_MEM_REF
            handling.
            * gimple-ssa-isolate-paths.cc (check_loadstore): Likewise.
            * gimple-range-infer.cc (non_null_loadstore): Likewise.

            * gcc.dg/torture/pr126658.c: New testcase.

Reply via email to