public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>, <fortran@gcc.gnu.org>,
	<gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] fortran: Fix up function types for realloc and sincos{,f,l} builtins [PR108349]
Date: Wed, 11 Jan 2023 10:24:22 +0100	[thread overview]
Message-ID: <c8ae38ed-a943-f9a3-d1d5-7199a7de4d13@codesourcery.com> (raw)
In-Reply-To: <Y75+1bW680qP7wiD@tucnak>

Hi,

On 11.01.23 10:18, Jakub Jelinek via Gcc-patches wrote:
> As reported in the PR, the FUNCTION_TYPE for __builtin_realloc in the
> Fortran FE is wrong since r0-100026-gb64fca63690ad [...]
> I went through all other changes from that commit and found that
> __builtin_sincos{,f,l} got broken as well, [...]
>
> The following patch fixes that, plus some formatting issues around
> the spots I've changed.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK. Thanks for the patch!

Tobias

> 2023-01-11  Jakub Jelinek  <jakub@redhat.com>
>
>       PR fortran/108349
>       * f95-lang.cc (gfc_init_builtin_function): Fix up function types
>       for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}.  Formatting fixes.
>
> --- gcc/fortran/f95-lang.cc.jj        2022-11-15 22:57:18.247210671 +0100
> +++ gcc/fortran/f95-lang.cc   2023-01-10 11:31:43.787266346 +0100
> @@ -714,31 +714,34 @@ gfc_init_builtin_functions (void)
>                                                   float_type_node, NULL_TREE);
>
>     func_cdouble_double = build_function_type_list (double_type_node,
> -                                                  complex_double_type_node,
> -                                                  NULL_TREE);
> +                                               complex_double_type_node,
> +                                               NULL_TREE);
>
>     func_double_cdouble = build_function_type_list (complex_double_type_node,
> -                                                  double_type_node, NULL_TREE);
> +                                               double_type_node, NULL_TREE);
>
> -  func_clongdouble_longdouble =
> -    build_function_type_list (long_double_type_node,
> -                              complex_long_double_type_node, NULL_TREE);
> -
> -  func_longdouble_clongdouble =
> -    build_function_type_list (complex_long_double_type_node,
> -                              long_double_type_node, NULL_TREE);
> +  func_clongdouble_longdouble
> +    = build_function_type_list (long_double_type_node,
> +                             complex_long_double_type_node, NULL_TREE);
> +
> +  func_longdouble_clongdouble
> +    = build_function_type_list (complex_long_double_type_node,
> +                             long_double_type_node, NULL_TREE);
>
>     ptype = build_pointer_type (float_type_node);
> -  func_float_floatp_floatp =
> -    build_function_type_list (void_type_node, ptype, ptype, NULL_TREE);
> +  func_float_floatp_floatp
> +    = build_function_type_list (void_type_node, float_type_node, ptype, ptype,
> +                             NULL_TREE);
>
>     ptype = build_pointer_type (double_type_node);
> -  func_double_doublep_doublep =
> -    build_function_type_list (void_type_node, ptype, ptype, NULL_TREE);
> +  func_double_doublep_doublep
> +    = build_function_type_list (void_type_node, double_type_node, ptype,
> +                             ptype, NULL_TREE);
>
>     ptype = build_pointer_type (long_double_type_node);
> -  func_longdouble_longdoublep_longdoublep =
> -    build_function_type_list (void_type_node, ptype, ptype, NULL_TREE);
> +  func_longdouble_longdoublep_longdoublep
> +    = build_function_type_list (void_type_node, long_double_type_node, ptype,
> +                             ptype, NULL_TREE);
>
>   /* Non-math builtins are defined manually, so they're not included here.  */
>   #define OTHER_BUILTIN(ID,NAME,TYPE,CONST)
> @@ -992,9 +995,8 @@ gfc_init_builtin_functions (void)
>                     "calloc", ATTR_NOTHROW_LEAF_MALLOC_LIST);
>     DECL_IS_MALLOC (builtin_decl_explicit (BUILT_IN_CALLOC)) = 1;
>
> -  ftype = build_function_type_list (pvoid_type_node,
> -                                    size_type_node, pvoid_type_node,
> -                                    NULL_TREE);
> +  ftype = build_function_type_list (pvoid_type_node, pvoid_type_node,
> +                                 size_type_node, NULL_TREE);
>     gfc_define_builtin ("__builtin_realloc", ftype, BUILT_IN_REALLOC,
>                     "realloc", ATTR_NOTHROW_LEAF_LIST);
>
>
>       Jakub
>
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

      reply	other threads:[~2023-01-11  9:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-11  9:18 Jakub Jelinek
2023-01-11  9:24 ` Tobias Burnus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8ae38ed-a943-f9a3-d1d5-7199a7de4d13@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).