On Fri, Mar 25, 2022 at 06:45:41PM +0100, Andreas Krebbel wrote:
> gcc/ChangeLog:
>       PR target/102024
>       * config/s390/s390-protos.h (s390_function_arg_vector): Remove
>       prototype.
>       * config/s390/s390.cc (s390_single_field_struct_p): New function.
>       (s390_function_arg_vector): Invoke s390_single_field_struct_p.
>       (s390_function_arg_float): Likewise.
> 
> gcc/testsuite/ChangeLog:
>       PR target/102024
>       * g++.target/s390/pr102024-1.C: New test.
>       * g++.target/s390/pr102024-2.C: New test.
>       * g++.target/s390/pr102024-3.C: New test.
>       * g++.target/s390/pr102024-4.C: New test.
>       * g++.target/s390/pr102024-5.C: New test.
>       * g++.target/s390/pr102024-6.C: New test.

LGTM, except:

> +      /* For C++ older GCCs ignored zero width bitfields and therefore
> +      passed structs more often as single values than GCC 12 does.
> +      So diagnostics are only required in cases where we do NOT
> +      accept the struct to be passed as single value.  */
> +      if (!single_p && zero_width_bf_seen_p)
> +     {
> +       static unsigned last_reported_type_uid_zero_width;
> +       if (uid != last_reported_type_uid_zero_width)
> +         {
> +           last_reported_type_uid_zero_width = uid;
> +           inform (input_location,
> +                   "parameter passing for argument of type %qT with "
> +                   "zero-width bit fields members changed in GCC 12",
> +                   orig_type);

You could use %{GCC 12.1%} and refer to
gcc-12/changes.html#zero_width_bitfields
like i386 does (not written yet, but the intent is to cover the various
arch decisions there).

        Jakub

Reply via email to