public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/108349] LTO mismatch for __builtin_realloc between glibc and gfortran frontend
Date: Tue, 02 May 2023 20:13:32 +0000	[thread overview]
Message-ID: <bug-108349-4-sQ3zXvSMhP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108349-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108349

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:d67efd5a4ff7ef0992c641b04b009195d872f7bd

commit r11-10698-gd67efd5a4ff7ef0992c641b04b009195d872f7bd
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Jan 11 10:40:54 2023 +0100

    fortran: Fix up function types for realloc and sincos{,f,l} builtins
[PR108349]

    As reported in the PR, the FUNCTION_TYPE for __builtin_realloc in the
    Fortran FE is wrong since r0-100026-gb64fca63690ad which changed
    -  tmp = tree_cons (NULL_TREE, pvoid_type_node, void_list_node);
    -  tmp = tree_cons (NULL_TREE, size_type_node, tmp);
    -  ftype = build_function_type (pvoid_type_node, tmp);
    +  ftype = build_function_type_list (pvoid_type_node,
    +                                    size_type_node, pvoid_type_node,
    +                                    NULL_TREE);
       gfc_define_builtin ("__builtin_realloc", ftype, BUILT_IN_REALLOC,
                          "realloc", false);
    The return type is correct, void *, but the first argument should be
    void * too and only second one size_t, while the above change changed
    realloc to be void *__builtin_realloc (size_t, void *);
    I went through all other changes from that commit and found that
    __builtin_sincos{,f,l} got broken as well, instead of the former
    void __builtin_sincos{,f,l} (ftype, ftype *, ftype *);
    where ftype is {double,float,long double} it is now incorrectly
    void __builtin_sincos{,f,l} (ftype *, ftype *);

    The following patch fixes that, plus some formatting issues around
    the spots I've changed.

    2023-01-11  Jakub Jelinek  <jakub@redhat.com>

            PR fortran/108349
            * f95-lang.c (gfc_init_builtin_function): Fix up function types
            for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}.  Formatting fixes.

    (cherry picked from commit 0986c351aa8a9f08b3cb614baec13564dd62c114)

  parent reply	other threads:[~2023-05-02 20:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10  9:28 [Bug fortran/108349] New: " rimvydas.jas at gmail dot com
2023-01-10  9:48 ` [Bug fortran/108349] " rguenth at gcc dot gnu.org
2023-01-10 10:14 ` jakub at gcc dot gnu.org
2023-01-10 10:20 ` jakub at gcc dot gnu.org
2023-01-10 11:11 ` jakub at gcc dot gnu.org
2023-01-11  9:42 ` cvs-commit at gcc dot gnu.org
2023-01-11 14:03 ` tschwinge at gcc dot gnu.org
2023-02-10 17:45 ` cvs-commit at gcc dot gnu.org
2023-05-02 20:13 ` cvs-commit at gcc dot gnu.org [this message]
2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org
2023-05-04  7:23 ` jakub at gcc dot gnu.org

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=bug-108349-4-sQ3zXvSMhP@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).