https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125642
--- Comment #5 from Zhou Qiankang <wszqkzqk at qq dot com> ---
(In reply to Drea Pinski from comment #3)
> Confirmed, this has been a bug since _Fract support was added with
> r0-83137-g0f996086cbf162. long before loongarch was done.
>
> Simple fix:
> ```
> diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
> index 7296ee8b3ba..900843e8d03 100644
> --- a/gcc/c-family/c-cppbuiltin.cc
> +++ b/gcc/c-family/c-cppbuiltin.cc
> @@ -1378,7 +1378,7 @@ c_cpp_builtins (cpp_reader *pfile)
> }
>
> /* For fixed-point fibt, ibit, max, min, and epsilon. */
> - if (targetm.fixed_point_supported_p ())
> + if (!c_dialect_cxx () && targetm.fixed_point_supported_p ())
> {
> builtin_define_fixed_point_constants ("SFRACT", "HR",
> short_fract_type_node);
>
> ```
>
> This is preapproved if this fixes the issue.
It works now with this patch, tested on Arch Linux for Loong64, see also:
https://github.com/lcpu-club/loongarch-packages/pull/920 and
https://github.com/lcpu-club/loongarch-packages/pull/922