]> gcc.gnu.org Git - gcc.git/commit
c++: mutable temps in rodata [PR116369]
authorMarek Polacek <polacek@redhat.com>
Thu, 29 Aug 2024 19:13:03 +0000 (15:13 -0400)
committerMarek Polacek <polacek@redhat.com>
Tue, 10 Sep 2024 15:48:15 +0000 (11:48 -0400)
commit2801a49d1144bce5568b527d1972952ad3420f66
tree379a3bbbfa6382e871b535b8ed5f9a270d5b6a04
parente783a4a683762487cb003ae48235f3d44875de1b
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.
gcc/cp/call.cc
gcc/testsuite/g++.dg/tree-ssa/initlist-opt7.C [new file with mode: 0644]
This page took 0.058014 seconds and 5 git commands to generate.