From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 748DA385B1A5; Wed, 14 Dec 2022 19:05:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 748DA385B1A5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671044730; bh=+uEOMYUsGRlDWk0RNS0T9EmULTNZjo1cIPq8Kc+Lcrg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=N3tXVkuUb+ZOtmvehzIKXBUIcSavnV2UdyGPUmo2jUPrA1RE0OYDoVPy50zSA5Y1n eY3TDNgPcoosOpAkn83j8z62FvhotAea2lF7ENEtpZJ0ab09Dmxyb5XwqKZBi64u+I eWlTS5Pbt0Pi8mLiX4tXUALfYf3dLUiY0GUstWMw= 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 19:05:29 +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: 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 --- Comment #9 from Jakub Jelinek --- Though, on // PR c++/108099 // { dg-do compile { target c++11 } } // { dg-options "" } using u128 =3D unsigned __int128_t; using s128 =3D signed __int128_t; template struct integral_constant { static constexpr T value =3D v; }; typedef integral_constant false_type; typedef integral_constant true_type; template struct is_same : false_type {}; template struct is_same : true_type {}; static_assert (is_same <__int128, s128>::value, ""); static_assert (is_same ::value, ""); static_assert (is_same <__int128_t, s128>::value, ""); static_assert (is_same ::value, ""); static_assert (is_same <__uint128_t, u128>::value, ""); static_assert (sizeof (s128) =3D=3D sizeof (__int128), ""); static_assert (sizeof (u128) =3D=3D sizeof (unsigned __int128), ""); static_assert (s128(-1) < 0, ""); static_assert (u128(-1) > 0, ""); in GCC 11 2 assertions failed (is_same with u128), while in trunk with the above patch 3 assertions fail (also the sizeof (u128) - u128 is then unsigned int rather than unsigned __int128. No idea what we want for the is_same assertions, but I bet if we just pedwa= rn on unsigned __int128_t and don't reject it, users would expect at least some 128-bit unsigned type. Though, even on: // PR c++/108099 // { dg-do compile { target c++11 } } // { dg-options "" } typedef long long t64; using u64 =3D unsigned t64; using s64 =3D signed t64; template struct integral_constant { static constexpr T value =3D v; }; typedef integral_constant false_type; typedef integral_constant true_type; template struct is_same : false_type {}; template struct is_same : true_type {}; static_assert (is_same ::value, ""); static_assert (is_same ::value, ""); static_assert (is_same ::value, ""); static_assert (sizeof (s64) =3D=3D sizeof (long long), ""); static_assert (sizeof (u64) =3D=3D sizeof (unsigned long long), ""); static_assert (s64(-1) < 0, ""); static_assert (u64(-1) > 0, ""); in GCC 11 only one assertion failed (is_same for u64), while in GCC 12 and unpatched or patched trunk 2 of them fail (also the sizeof (u64) one). So, it seems the r12-8173 change behavior not just for the builtin types, b= ut also for any other typedefs (in the unsigned case).=