Andreas Schwab <sch...@suse.de> writes: > This breaks boostrap. > > /opt/gcc/gcc-20191030/Build/./prev-gcc/xgcc > -B/opt/gcc/gcc-20191030/Build/./prev-gcc/ -B/usr/aarch64-suse-linux/bin/ > -B/usr/aarch64-suse-linux/bin/ -B/usr/aarch64-suse-linux/lib/ -isystem > /usr/aarch64-suse-linux/include -isystem /usr/aarch64-suse-linux/sys-include > -fno-checking -c -g -O2 -fno-checking -gtoggle -gnatpg -gnata -W -Wall > -nostdinc -I- -I. -Iada/generated -Iada -I../../gcc/ada > -I../../gcc/ada/gcc-interface -Iada/libgnat -I../../gcc/ada/libgnat > ../../gcc/ada/libgnat/a-charac.ads -o ada/libgnat/a-charac.o > mkdir -p ada/libgnat/ > +===========================GNAT BUG DETECTED==============================+ > | 10.0.0 20191030 (experimental) [trunk revision 277599] (aarch64-suse-linux) > | > | Storage_Error stack overflow or erroneous memory access | > | Error detected at system.ads:184:5 | > | Please submit a bug report; see https://gcc.gnu.org/bugs/ . | > | Use a subject line meaningful to you and us to track the bug. | > | Include the entire contents of this bug box in the report. | > | Include the exact command that you entered. | > | Also include sources listed below. | > +==========================================================================+ > > Please include these source files with error report > Note that list may not be accurate in some cases, > so please double check that the problem can still > be reproduced with the set of files listed. > Consider also -gnatd.n switch (see debug.adb). > > ../../gcc/ada/libgnat/system.ads > ../../gcc/ada/libgnat/a-charac.ads > ../../gcc/ada/libgnat/ada.ads > > compilation abandoned > make[3]: *** [../../gcc/ada/gcc-interface/Make-lang.in:144: > ada/libgnat/a-charac.o] Error 1
Sorry, didn't think to try non-default languages. Fixed as below, tested on aarch64-linuxg-gnu, Richard The SVE PCS support broke go, D and Ada because those languages don't call TARGET_INIT_BUILTINS. We therefore ended up trying to get the TYPE_MAIN_VARIANT of a null __SVBool_t. We shouldn't really need to apply TYPE_MAIN_VARIANT there anyway, since the ABI-defined types are (and need to be) their own main variants. This patch asserts for that instead. 2019-10-31 Richard Sandiford <richard.sandif...@arm.com> gcc/ * config/aarch64/aarch64-sve-builtins.cc (register_builtin_types): Assert that the type we store in abi_vector_types is its own main variant. (svbool_type_p): Don't apply TYPE_MAIN_VARIANT here. Index: gcc/config/aarch64/aarch64-sve-builtins.cc =================================================================== --- gcc/config/aarch64/aarch64-sve-builtins.cc 2019-10-29 08:59:18.411479577 +0000 +++ gcc/config/aarch64/aarch64-sve-builtins.cc 2019-10-31 17:15:48.414357857 +0000 @@ -2993,6 +2993,7 @@ register_builtin_types () BITS_PER_SVE_VECTOR)); } vectype = build_distinct_type_copy (vectype); + gcc_assert (vectype == TYPE_MAIN_VARIANT (vectype)); SET_TYPE_STRUCTURAL_EQUALITY (vectype); TYPE_ARTIFICIAL (vectype) = 1; abi_vector_types[i] = vectype; @@ -3235,8 +3236,7 @@ bool svbool_type_p (const_tree type) { tree abi_type = abi_vector_types[VECTOR_TYPE_svbool_t]; - return (type != error_mark_node - && TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (abi_type)); + return type != error_mark_node && TYPE_MAIN_VARIANT (type) == abi_type; } /* If TYPE is a built-in type defined by the SVE ABI, return the mangled name,