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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jakub Jelinek
<ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:7a1a52934a2ab9ac9205a3a4d5b82a672fefba7e

commit r13-8631-g7a1a52934a2ab9ac9205a3a4d5b82a672fefba7e
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Fri Apr 12 10:59:54 2024 +0200

    Limit special asan/ubsan/bitint returns_twice handling to calls in bbs with
abnormal pred [PR114687]

    The tree-cfg.cc verifier only diagnoses returns_twice calls preceded
    by non-label/debug stmts if it is in a bb with abnormal predecessor.
    The following testcase shows that if a user lies in the attributes
    (a function which never returns can't be pure, and can't return
    twice when it doesn't ever return at all), when we figure it out,
    we can remove the abnormal edges to the "returns_twice" call and perhaps
    whole .ABNORMAL_DISPATCHER etc.
    edge_before_returns_twice_call then ICEs because it can't find such
    an edge.

    The following patch limits the special handling to calls in bbs where
    the verifier requires that.

    2024-04-12  Jakub Jelinek  <ja...@redhat.com>

            PR sanitizer/114687
            * gimple-iterator.cc (gsi_safe_insert_before): Only use
            edge_before_returns_twice_call if bb_has_abnormal_pred.
            (gsi_safe_insert_seq_before): Likewise.

            * gcc.dg/asan/pr114687.c: New test.

    (cherry picked from commit c9e94ae448ba309dba74de3ee1974a3ed9248889)

Reply via email to