[Bug c++/100468] set_up_extended_ref_temp via extend_ref_init_temps_1 drops TREE_ADDRESSABLE

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 18 09:29:12 GMT 2022


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

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

https://gcc.gnu.org/g:462900ba21f5fdf865c93f693083da3179dd3151

commit r11-9591-g462900ba21f5fdf865c93f693083da3179dd3151
Author: Richard Biener <rguenther@suse.de>
Date:   Fri May 7 09:51:18 2021 +0200

    middle-end/100464 - avoid spurious TREE_ADDRESSABLE in folding debug stmts

    canonicalize_constructor_val was setting TREE_ADDRESSABLE on bases
    of ADDR_EXPRs but that's futile when we're dealing with CTOR values
    in debug stmts.  This rips out the code which was added for Java
    and should have been an assertion when we didn't have debug stmts.
    To not regress g++.dg/tree-ssa/array-temp1.C we have to adjust the
    testcase to not look for a no longer applied invalid optimization.

    2021-05-10  Richard Biener  <rguenther@suse.de>

            PR middle-end/100464
            PR c++/100468
    gcc/
            * gimple-fold.c (canonicalize_constructor_val): Do not set
            TREE_ADDRESSABLE.

    gcc/cp/
            * call.c (set_up_extended_ref_temp): Mark the temporary
            addressable if the TARGET_EXPR was.

    gcc/testsuite/
            * gcc.dg/pr100464.c: New testcase.
            * g++.dg/tree-ssa/array-temp1.C: Adjust.

    (cherry picked from commit a076632e274abe344ca7648b7c7f299273d4cbe0)


More information about the Gcc-bugs mailing list