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

--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Marek Polacek
<mpola...@gcc.gnu.org>:

https://gcc.gnu.org/g:078089a084f4fd20812b15cd1ec7bd4bcd5c9282

commit r14-11166-g078089a084f4fd20812b15cd1ec7bd4bcd5c9282
Author: Marek Polacek <pola...@redhat.com>
Date:   Thu Aug 29 15:13:03 2024 -0400

    c++: mutable temps in rodata [PR116369]

    Here we wrongly mark the reference temporary for g TREE_READONLY,
    so it's put in .rodata and so we can't modify its subobject even
    when the subobject is marked mutable.  This is so since r9-869.
    r14-1785 fixed a similar problem, but not in set_up_extended_ref_temp.

            PR c++/116369

    gcc/cp/ChangeLog:

            * call.cc (set_up_extended_ref_temp): Don't mark a temporary
            TREE_READONLY if its type is TYPE_HAS_MUTABLE_P.

    gcc/testsuite/ChangeLog:

            * g++.dg/tree-ssa/initlist-opt7.C: New test.

    (cherry picked from commit 2801a49d1144bce5568b527d1972952ad3420f66)
  • [Bug c++/116369] [12/13/14 Regr... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to