From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5DB9F3858C20; Fri, 4 Mar 2022 09:28:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5DB9F3858C20 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/99708] __SIZEOF_FLOAT128__ not defined on powerpc64le-linux Date: Fri, 04 Mar 2022 09:28:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2022 09:28:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99708 --- Comment #19 from Jakub Jelinek --- builddir/gcc/rs6000-builtins.cc:=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ibm128_float_type_node, builddir/gcc/rs6000-builtins.cc: =3D build_function_type_list (ibm128_float_type_node, rs6000-builtin.cc: else if (type_node =3D=3D ibm128_float_type_node) rs6000-builtin.cc: ibm128_float_type_node =3D long_double_type_node; rs6000-builtin.cc: ibm128_float_type_node =3D make_node (REAL_TYPE); rs6000-builtin.cc: TYPE_PRECISION (ibm128_float_type_node) =3D 128; rs6000-builtin.cc: SET_TYPE_MODE (ibm128_float_type_node, IFmode); rs6000-builtin.cc: layout_type (ibm128_float_type_node); rs6000-builtin.cc: t =3D build_qualified_type (ibm128_float_type_node, TYPE_QUAL_CONST); rs6000-builtin.cc: ptr_ibm128_float_type_node =3D build_pointer_type (= t); rs6000-builtin.cc: lang_hooks.types.register_builtin_type (ibm128_float_type_node, rs6000-builtin.cc: ieee128_float_type_node =3D long_double_type_node; rs6000-builtin.cc: ieee128_float_type_node =3D float128_type_node; rs6000-builtin.cc: t =3D build_qualified_type (ieee128_float_type_node, TYPE_QUAL_CONST); rs6000-builtin.cc: ptr_ieee128_float_type_node =3D build_pointer_type = (t); rs6000-builtin.cc: lang_hooks.types.register_builtin_type (ieee128_float_type_node, rs6000-builtin.cc: ieee128_float_type_node =3D ibm128_float_type_node =3D long_double_type_node; rs6000.cc: && ieee128_float_type_node =3D=3D long_double_type_node) rs6000.cc: && ibm128_float_type_node =3D=3D long_double_type_node)) rs6000-c.cc: if (ibm128_float_type_node) rs6000-c.cc: if (ieee128_float_type_node) rs6000.h:#define ieee128_float_type_node=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 (rs6000_builtin_types[RS6000_BTI_ieee128_float]) rs6000.h:#define ibm128_float_type_node=20=20=20=20=20=20=20=20=20 (rs6000_builtin_types[RS6000_BTI_ibm128_float]) rs6000.h:#define ptr_ieee128_float_type_node=20=20=20=20 (rs6000_builtin_types[RS6000_BTI_ptr_ieee128_float]) rs6000.h:#define ptr_ibm128_float_type_node=20=20=20=20=20 (rs6000_builtin_types[RS6000_BTI_ptr_ibm128_float]) I'd guess that else ieee128_float_type_node =3D ibm128_float_type_node =3D long_double_type_node; is there so that we don't ICE during the builtins creation (we need just ibm128_float_type_node for it though). Looking at other uses: rs6000_type_string does: else if (type_node =3D=3D ibm128_float_type_node) return "__ibm128"; could add type_node && to it. And it also makes me wonder why there is no ieee128_float_type_node case. Rest of rs6000-builtin.cc is just the setup and could live without else ieee128_float_type_node =3D ibm128_float_type_node =3D long_double_typ= e_node; Also, why do we have ptr_*_float_type_node at all when nothing uses those? rs6000.cc will be fine even with *128_float_type_node NULL, long_double_type_node is presumably always non-NULL. rs6000-c.cc is what this PR talks about, so actually needs those to be NULL= if not supported (but, we still want to move the __SIZEOF_FLOAT128__ handling next to __floa= t128 macro IMNSHO, if we add also __SIZEOF_IEEE128__ it could stay where __SIZEOF_FLOAT128__ is defined now). And finally the generated rs6000-builtins.cc, it does: tree df_ftype_if_ci =3D build_function_type_list (double_type_node, ibm128_float_type_node, integer_type_node, NULL_TREE); tree if_ftype_df_df =3D build_function_type_list (ibm128_float_type_node, double_type_node, double_type_node, NULL_TREE); rs6000_builtin_info[RS6000_BIF_PACK_IF].fntype =3D if_ftype_df_df; rs6000_builtin_decls[(int)RS6000_BIF_PACK_IF] =3D t =3D add_builtin_function ("__builtin_pack_ibm128", if_ftype_df_df, (int)RS6000_BIF_PACK_IF, BUILT_IN_MD, NULL, NULL_TREE); TREE_READONLY (t) =3D 1; TREE_NOTHROW (t) =3D 1; rs6000_builtin_info[RS6000_BIF_UNPACK_IF].fntype =3D df_ftype_if_ci; rs6000_builtin_decls[(int)RS6000_BIF_UNPACK_IF] =3D t =3D add_builtin_function ("__builtin_unpack_ibm128", df_ftype_if_ci, (int)RS6000_BIF_UNPACK_IF, BUILT_IN_MD, NULL, NULL_TREE); TREE_READONLY (t) =3D 1; TREE_NOTHROW (t) =3D 1; Unfortunately it is a generated file. Dunno what is best for that, not registering the builtins at all if ibm128_float_type_node is NULL, or keep doing what it used to, register those with some other type.=