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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>:

https://gcc.gnu.org/g:13a43a90aea368a25da50762eba4873bafb4e448

commit r12-3284-g13a43a90aea368a25da50762eba4873bafb4e448
Author: Richard Biener <rguent...@suse.de>
Date:   Wed Sep 1 11:49:39 2021 +0200

    tree-optimization/93491 - avoid PRE of trapping calls across exits

    This makes us avoid PREing calls that could trap across other
    calls that might not return.  The PR88087 testcase has exactly
    such case so I've refactored the testcase to contain a valid PRE.
    I've also adjusted PRE to not consider pure calls possibly
    not returning in line with what we do elsewhere.

    Note we don't have a good idea whether a function always returns
    normally or whether its body is known to never trap.  That's
    something IPA could compute.

    2021-09-01  Richard Biener  <rguent...@suse.de>

            PR tree-optimization/93491
            * tree-ssa-pre.c (compute_avail): Set BB_MAY_NOTRETURN
            after processing the stmt itself.  Do not consider
            pure functions possibly not returning.  Properly avoid
            adding possibly trapping calls to EXP_GEN when there's
            a preceeding possibly not returning call.
            * tree-ssa-sccvn.c (vn_reference_may_trap): Conservatively
            not handle calls.

            * gcc.dg/torture/pr93491.c: New testcase.
            * gcc.dg/tree-ssa/pr88087.c: Change to valid PRE opportunity.

Reply via email to