On Wed, Sep 23, 2026 at 2:25 AM Juergen Christ <[email protected]> wrote:
>
> Hi,
>
> thanks for your work on this.  I will implement the s390x specific
> part once this series is accepted.
>
> > diff --git a/gcc/kcfi-typeinfo.cc b/gcc/kcfi-typeinfo.cc
> > new file mode 100644
> > index 000000000000..b6723fac48da
> > --- /dev/null
> > +++ b/gcc/kcfi-typeinfo.cc
>
>
> > +/* Test mangling of basic builtin types.  */
> > +
> > +static void
> > +test_typeinfo_basic_types ()
> > +{
> > +  ASSERT_STREQ ("v", kcfi_test_mangle (void_type_node).c_str ());
> > +  ASSERT_STREQ ("c", kcfi_test_mangle (char_type_node).c_str ());
> > +  ASSERT_STREQ ("a", kcfi_test_mangle (signed_char_type_node).c_str ());
> > +  ASSERT_STREQ ("h", kcfi_test_mangle (unsigned_char_type_node).c_str ());
> > +  ASSERT_STREQ ("s", kcfi_test_mangle (short_integer_type_node).c_str ());
> > +  ASSERT_STREQ ("t", kcfi_test_mangle (short_unsigned_type_node).c_str ());
> > +  ASSERT_STREQ ("i", kcfi_test_mangle (integer_type_node).c_str ());
> > +  ASSERT_STREQ ("j", kcfi_test_mangle (unsigned_type_node).c_str ());
> > +  ASSERT_STREQ ("l", kcfi_test_mangle (long_integer_type_node).c_str ());
> > +  ASSERT_STREQ ("m", kcfi_test_mangle (long_unsigned_type_node).c_str ());
> > +  ASSERT_STREQ ("x", kcfi_test_mangle (long_long_integer_type_node).c_str 
> > ());
> > +  ASSERT_STREQ ("y", kcfi_test_mangle (long_long_unsigned_type_node).c_str 
> > ());
> > +  ASSERT_STREQ ("f", kcfi_test_mangle (float_type_node).c_str ());
> > +  ASSERT_STREQ ("d", kcfi_test_mangle (double_type_node).c_str ());
> > +  ASSERT_STREQ ("e", kcfi_test_mangle (long_double_type_node).c_str ());
>
> I looked at this on s390x.  We actually change the mangling of long
> double if we are on a target where long double is 128bit IEEE to a
> "g".  This causes this self-test to fail.  I suggest to add this patch
> on top of our patch to fix this:
>
> diff --git a/gcc/kcfi-typeinfo.cc b/gcc/kcfi-typeinfo.cc
> index b6723fac48da..fab06249ae16 100644
> --- a/gcc/kcfi-typeinfo.cc
> +++ b/gcc/kcfi-typeinfo.cc
> @@ -659,7 +659,14 @@ test_typeinfo_basic_types ()
>    ASSERT_STREQ ("y", kcfi_test_mangle (long_long_unsigned_type_node).c_str 
> ());
>    ASSERT_STREQ ("f", kcfi_test_mangle (float_type_node).c_str ());
>    ASSERT_STREQ ("d", kcfi_test_mangle (double_type_node).c_str ());
> +#if defined (__s390x__)
> +  if (TARGET_LONG_DOUBLE_128)
> +    ASSERT_STREQ ("g", kcfi_test_mangle (long_double_type_node).c_str ());
> +  else
> +    ASSERT_STREQ ("e", kcfi_test_mangle (long_double_type_node).c_str ());
> +#else
>    ASSERT_STREQ ("e", kcfi_test_mangle (long_double_type_node).c_str ());
> +#endif

Maybe we should use out the target hook here instead of hard coding
the encoding.

>  }
>
>  /* Test mangling of pointer types.  */
>

Reply via email to