[Bug c++/111224] modules: xtreme-header-1_a.H etc. ICE (in core_vals, at cp/module.cc:6108) on AArch64 with SVE types

2024-03-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111224

--- Comment #11 from GCC Commits  ---
The master branch has been updated by Nathaniel Shead :

https://gcc.gnu.org/g:4aa87b856067d4911de8fb66b3a27659dc75ca6d

commit r14-9439-g4aa87b856067d4911de8fb66b3a27659dc75ca6d
Author: Nathaniel Shead 
Date:   Sun Mar 10 22:06:18 2024 +1100

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 
Reviewed-by: Patrick Palka 

[Bug c++/111224] modules: xtreme-header-1_a.H etc. ICE (in core_vals, at cp/module.cc:6108) on AArch64 with SVE types

2024-03-08 Thread nshead at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111224

Nathaniel Shead  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |nshead at gcc dot 
gnu.org

--- Comment #10 from Nathaniel Shead  ---
I now have access to an Aarch64 machine via the build farm. My patch in #c7 is
not sufficient to get the minimised testcase working (need to update the
assumptions on VECTOR_TYPEs too) and it looks like we'll need to work out how
to stream the aarch64-specific types found in the 'registered_builtin_types'
list too, like __fp16.

I'll submit a patch to the mailing lists once I've worked out the details.

[Bug c++/111224] modules: xtreme-header-1_a.H etc. ICE (in core_vals, at cp/module.cc:6108) on AArch64 with SVE types

2024-03-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111224

--- Comment #9 from Andrew Pinski  ---
(In reply to Nathaniel Shead from comment #7)
> Created attachment 57586 [details]
> Untested patch to implement POLY_INT_CST in modules
> 
> Here's a potential fix for this issue. But I only have access to an x86_64
> machine currently, so this is completely untested.

I can test it but it won't be until the middle of this up comming week.

[Bug c++/111224] modules: xtreme-header-1_a.H etc. ICE (in core_vals, at cp/module.cc:6108) on AArch64 with SVE types

2024-03-01 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111224

Patrick Palka  changed:

   What|Removed |Added

 CC||ppalka at gcc dot gnu.org

--- Comment #8 from Patrick Palka  ---
(In reply to Nathaniel Shead from comment #7)
> Created attachment 57586 [details]
> Untested patch to implement POLY_INT_CST in modules
> 
> Here's a potential fix for this issue. But I only have access to an x86_64
> machine currently, so this is completely untested.
The compile farm might have a suitable machine for testing:
https://gcc.gnu.org/wiki/CompileFarm

[Bug c++/111224] modules: xtreme-header-1_a.H etc. ICE (in core_vals, at cp/module.cc:6108) on AArch64 with SVE types

2024-03-01 Thread nshead at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111224

Nathaniel Shead  changed:

   What|Removed |Added

 CC||nshead at gcc dot gnu.org

--- Comment #7 from Nathaniel Shead  ---
Created attachment 57586
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57586=edit
Untested patch to implement POLY_INT_CST in modules

Here's a potential fix for this issue. But I only have access to an x86_64
machine currently, so this is completely untested.

[Bug c++/111224] modules: xtreme-header-1_a.H etc. ICE (in core_vals, at cp/module.cc:6108) on AArch64 with SVE types

2024-02-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111224

--- Comment #6 from Andrew Pinski  ---
case POLY_INT_CST:
  gcc_unreachable (); /* Not supported in C++.  */


That is definitely not true. POLY_INT_CST can be created via target builtins
even.

[Bug c++/111224] modules: xtreme-header-1_a.H etc. ICE (in core_vals, at cp/module.cc:6108) on AArch64 with SVE types

2024-02-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111224

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 CC||pinskia at gcc dot gnu.org
 Ever confirmed|0   |1
   Last reconfirmed||2024-02-11

--- Comment #5 from Andrew Pinski  ---
Confirmed.