Skip to content
Snippets Groups Projects
Commit 4aa87b85 authored by Nathaniel Shead's avatar Nathaniel Shead
Browse files

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: default avatarNathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: default avatarPatrick Palka <ppalka@redhat.com>
parent ad860cc2
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment