From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7D9F63881D39; Tue, 2 May 2023 20:13:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D9F63881D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683058413; bh=txUO3XWjWzg6wEVObD4tOPht11kLAfIX5ljVmqcIoYY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=id3fjdziQXxDen0b6ofsHDa7AvF1XOEmecWeHebZGpzmplATgy4rQvgxnrK7JFiDl IYkHpbYxbTHnhW6hZT/MhUMmkQtvdEHx6zrSkqxWmkRV8wLEHzojp2kogQI/2mDkC3 bATu4xdfCw3Pb+G8XdtH+ygoEQrbtTnfisKkriNY= From: "cvs-commit at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108349 --- Comment #8 from CVS Commits --- The releases/gcc-11 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:d67efd5a4ff7ef0992c641b04b009195d872f7bd commit r11-10698-gd67efd5a4ff7ef0992c641b04b009195d872f7bd Author: Jakub Jelinek 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 -=C2=A0=C2=A0tmp=C2=A0=3D=C2=A0tree_cons=C2=A0(NULL_TREE,=C2=A0pvoid_ty= pe_node,=C2=A0void_list_node); -=C2=A0=C2=A0tmp=C2=A0=3D=C2=A0tree_cons=C2=A0(NULL_TREE,=C2=A0size_typ= e_node,=C2=A0tmp); -=C2=A0=C2=A0ftype=C2=A0=3D=C2=A0build_function_type=C2=A0(pvoid_type_n= ode,=C2=A0tmp); +=C2=A0=C2=A0ftype=C2=A0=3D=C2=A0build_function_type_list=C2=A0(pvoid_t= ype_node, +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0siz= e_type_node,=C2=A0pvoid_type_node, +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0NUL= L_TREE); =C2=A0=C2=A0=C2=A0gfc_define_builtin=C2=A0("__builtin_realloc",=C2=A0ft= ype,=C2=A0BUILT_IN_REALLOC, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"realloc",= =C2=A0false); 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 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 fix= es. (cherry picked from commit 0986c351aa8a9f08b3cb614baec13564dd62c114)=