]> gcc.gnu.org Git - gcc.git/commit
c++: Support target-specific nodes when streaming modules [PR111224]
authorNathaniel Shead <nathanieloshead@gmail.com>
Sun, 10 Mar 2024 11:06:18 +0000 (22:06 +1100)
committerNathaniel Shead <nathanieloshead@gmail.com>
Tue, 12 Mar 2024 13:33:40 +0000 (00:33 +1100)
commit4aa87b856067d4911de8fb66b3a27659dc75ca6d
treebbad3e7d65017b12e4f87f20849d91cee1f9cfa7
parentad860cc27b3312f9119c7fecb8638a7c1f6d77c9
c++: Support target-specific nodes when streaming modules [PR111224]

Some targets make use of POLY_INT_CSTs and other custom builtin types,
which currently violate some assumptions when streaming. This patch adds
support for them, such as types like Aarch64 __fp16, PowerPC __ibm128,
and vector types thereof.

This patch doesn't provide "full" support of AArch64 SVE, however, since
for that we would need to support 'target' nodes (tracked in PR108080).

Adding the new builtin types means that on Aarch64 we now have 217
global trees created on initialisation (up from 191), so this patch also
slightly bumps the initial size of the fixed_trees allocation to 250.

PR c++/98645
PR c++/98688
PR c++/111224

gcc/cp/ChangeLog:

* module.cc (enum tree_tag): Add new tag for builtin types.
(trees_out::start): POLY_INT_CSTs can be emitted.
(trees_in::start): Likewise.
(trees_out::core_vals): Stream POLY_INT_CSTs.
(trees_in::core_vals): Likewise.
(trees_out::type_node): Handle vectors with multiple coeffs.
(trees_in::tree_node): Likewise.
(init_modules): Register target-specific builtin types. Bump
initial capacity slightly.

gcc/testsuite/ChangeLog:

* g++.dg/modules/target-aarch64-1_a.C: New test.
* g++.dg/modules/target-aarch64-1_b.C: New test.
* g++.dg/modules/target-powerpc-1_a.C: New test.
* g++.dg/modules/target-powerpc-1_b.C: New test.
* g++.dg/modules/target-powerpc-2_a.C: New test.
* g++.dg/modules/target-powerpc-2_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
gcc/cp/module.cc
gcc/testsuite/g++.dg/modules/target-aarch64-1_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/target-aarch64-1_b.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/target-powerpc-1_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/target-powerpc-1_b.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/target-powerpc-2_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/target-powerpc-2_b.C [new file with mode: 0644]
This page took 0.065205 seconds and 5 git commands to generate.