From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EE323382E6A0; Fri, 10 Feb 2023 17:45:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EE323382E6A0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676051134; bh=VYa6yirnIB4zkkhoPiBVp1CDfw4EOHJ2r2zdI1wR2PQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HI0jWF6BJ1VsAkUrXQNaN1gyiLAEVbpWllXnA+5aoUsd8XlR+SPYC2feUylWJQ2OK GZXnGPVwHOLbzUgbbaqL0fajCr+28hXLU1oPGPs/Z90w+CUVKl2p8aVOhyke+7uCtg VRJhRjti/AWm+nuvtej4mhYq7i269c042SFdW8xA= 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: Fri, 10 Feb 2023 17:45:34 +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 #7 from CVS Commits --- The releases/gcc-12 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:463bf7cfb0b03d9e75754ea8ba89c61186d0982f commit r12-9139-g463bf7cfb0b03d9e75754ea8ba89c61186d0982f 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.cc (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)=