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

--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:28b05e4317a6eade2ba46076ef17f9e138c57a34

commit r15-7980-g28b05e4317a6eade2ba46076ef17f9e138c57a34
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Mar 12 08:01:09 2025 +0100

    c++: Handle RAW_DATA_CST in modules.cc [PR119076]

    The following testcases (one with #embed, one with large initializer
    turned into RAW_DATA_CST) show that I forgot to handle RAW_DATA_CST in
    module streaming.

    Similar to the PCH case we need to stream out RAW_DATA_CST with NULL
    RAW_DATA_OWNER (i.e. a tree which has data owned by libcpp buffer) so
    that it will be streamed back in as STRING_CST which owns the data,
    but because the data can be really large (hopefully not so much for
    header modules though), without actually trying to build a STRING_CST
    on the module writing side because that would mean another large
    allocation and copying of the large data.
    RAW_DATA_CST with RAW_DATA_OWNER then needs to be streamed out and in
    by streaming the owner and offset from owner's data and length.

    2025-03-12  Jakub Jelinek  <ja...@redhat.com>

            PR c++/119076
            * module.cc (trees_out::start): Handle RAW_DATA_CST.
            (trees_in::start): Likewise.
            (trees_out::core_vals): Likewise.
            (trees_in::core_vals): Likewise.

            * g++.dg/modules/pr119076-1_a.H: New test.
            * g++.dg/modules/pr119076-1_b.C: New test.
            * g++.dg/modules/pr119076-2_a.H: New test.
            * g++.dg/modules/pr119076-2_b.C: New test.

Reply via email to