From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 14CFA3884FBB; Wed, 14 Dec 2022 18:18:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14CFA3884FBB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671041885; bh=Pkji8iK7ZSIag8OQtfp3GSu0dexvO8qfSavguoXaej4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=f/qRfoT/XDVUldHUAslFutHoOnkrT12B5EkQcUjmnv/nlWv4dLp1xZ3kFNU70ujPy 4D8/TTm8HAVEQY3WEdzT3kfE7W820qZOiu4hnHpJDJpFH3mkFduaiuX7DeDOiLsple Mx4/FP43qrU8JmiE+ecpEZCi38LdQMuX4b5gR+xw= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108099] [12/13 Regression] ICE with type alias with `signed __int128_t` Date: Wed, 14 Dec 2022 18:18:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: ice-on-invalid-code 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: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D108099 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #8 from Jakub Jelinek --- Started with r12-8173-ge580f81d22d61153564959f08d9a6d3bcc7fd386 For using u128 =3D unsigned __int128_t; auto a =3D sizeof (u128); it doesn't ICE but changes behavior, before that commit a was 16, now it is= 4. The reason for the ICE as well as 4 in there is because r12-8173 does: + type =3D DECL_ORIGINAL_TYPE (typedef_decl); + typedef_decl =3D NULL_TREE; which is fine for user typedefs, but for the internally created typedefs li= ke __int128_t, __uint128_t, __builtin_va_list, dunno if others too DECL_ORIGINAL_TYPE is NULL. So, the question is if we should fix it by tweaking c-common.cc so that ins= tead of say: if (targetm.scalar_mode_supported_p (TImode)) lang_hooks.decls.pushdecl (build_decl (UNKNOWN_LOCATION, TYPE_DECL, get_identifier ("__int128_t"), intTI_type_node)); do if (targetm.scalar_mode_supported_p (TImode)) { tree decl =3D build_decl (UNKNOWN_LOCATION, TYPE_DECL, get_identifier ("__int128_t"), intTI_type_node); DECL_ORIGINAL_TYPE (decl) =3D intTI_type_node; lang_hooks.decls.pushdecl (decl); } etc., or if it wouldn't be better or at least easier to: --- gcc/cp/decl.cc.jj 2022-12-05 11:10:37.528674260 +0100 +++ gcc/cp/decl.cc 2022-12-14 19:16:40.242926374 +0100 @@ -12442,7 +12442,8 @@ grokdeclarator (const cp_declarator *dec pedwarn (loc, OPT_Wpedantic, "%qs specified with %qT", key, type); ok =3D !flag_pedantic_errors; - type =3D DECL_ORIGINAL_TYPE (typedef_decl); + if (DECL_ORIGINAL_TYPE (typedef_decl)) + type =3D DECL_ORIGINAL_TYPE (typedef_decl); typedef_decl =3D NULL_TREE; } else if (declspecs->decltype_p) I'm going to test the latter.=