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

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

https://gcc.gnu.org/g:9e1173009150086a927a6f0e001fd04c5cac54cb

commit r11-8698-g9e1173009150086a927a6f0e001fd04c5cac54cb
Author: Richard Biener <rguent...@suse.de>
Date:   Tue Jun 22 12:13:44 2021 +0200

    middle-end/101156 - remove not working optimization in gimplification

    This removes a premature and not working optimization from the
    gimplifier.  When gimplification is requested not to produce a SSA
    name we try to avoid generating a copy when we did so anyway but
    instead replace the LHS of its definition.  But that only works in
    case there are no uses of the SSA name already which is something
    we cannot easily check, so the following removes said optimization.

    Statistics on the whole bootstrap shows we hit this optimization
    only for libiberty/cp-demangle.c and overall we have 21652112
    gimplifications where just 240 copies are elided.  Preserving
    the optimization would require scanning the original expression
    and the pre and post sequences for SSA names and uses, that seems
    excessive to avoid these 240 copies.

    2021-06-22  Richard Biener  <rguent...@suse.de>

            PR middle-end/101156
            * gimplify.c (gimplify_expr): Remove premature incorrect
            optimization.

            * gcc.dg/pr101156.c: New testcase.

    (cherry picked from commit b4e21c80462682c4e6e5e487fe87107b27f8b4bd)

Reply via email to