]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Handle RAW_DATA_CST in make_tree_vector_from_ctor [PR118528]
authorJakub Jelinek <jakub@redhat.com>
Mon, 20 Jan 2025 17:00:43 +0000 (18:00 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 20 Jan 2025 17:00:43 +0000 (18:00 +0100)
commit0b58219fe112c01ff335edf699c4fc69e718c75b
treee35f578105679db7c150be92a233820267212ceb
parent9d869296f095a02c37d3721f546ce99663e5417c
c++: Handle RAW_DATA_CST in make_tree_vector_from_ctor [PR118528]

This is the first bug discovered today with the
https://gcc.gnu.org/pipermail/gcc-patches/2025-January/673945.html
hack but then turned into proper testcases where embed-21.C FAILed
since introduction of optimized #embed support and the other when
optimizing large C++ initializers using RAW_DATA_CST.

The problem is that the C++ FE calls make_tree_vector_from_ctor
and uses that as arguments vector for deduction guide handling.
The call.cc code isn't prepared to handle RAW_DATA_CST just about
everywhere, so I think it is safer to make sure RAW_DATA_CST only
appears in CONSTRUCTOR_ELTS and nowhere else.
Thus, the following patch expands the RAW_DATA_CSTs from initializers
into multiple INTEGER_CSTs in the returned vector.

2025-01-20  Jakub Jelinek  <jakub@redhat.com>

PR c++/118528
* c-common.cc (make_tree_vector_from_ctor): Expand RAW_DATA_CST
elements from the CONSTRUCTOR to individual INTEGER_CSTs.

* g++.dg/cpp/embed-21.C: New test.
* g++.dg/cpp2a/class-deduction-aggr16.C: New test.
gcc/c-family/c-common.cc
gcc/testsuite/g++.dg/cpp/embed-21.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr16.C [new file with mode: 0644]