From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 01D643858C74; Wed, 9 Mar 2022 22:09:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01D643858C74 From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104859] [12 regression] liibg++ fails during bootstrap Date: Wed, 09 Mar 2022 22:09: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.0 X-Bugzilla-Keywords: build, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to everconfirmed bug_status cf_reconfirmed_on 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: Wed, 09 Mar 2022 22:09:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104859 Patrick Palka changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot g= nu.org Ever confirmed|0 |1 Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2022-03-09 --- Comment #5 from Patrick Palka --- I think we just need to add some explicit casts: diff --git a/libstdc++-v3/src/c++17/floating_to_chars.cc b/libstdc++-v3/src/c++17/floating_to_chars.cc index 5825e661bf4..0ccf2623511 100644 --- a/libstdc++-v3/src/c++17/floating_to_chars.cc +++ b/libstdc++-v3/src/c++17/floating_to_chars.cc @@ -801,14 +801,14 @@ template char leading_hexit; if constexpr (has_implicit_leading_bit) { - const unsigned nibble =3D effective_mantissa >> rounded_mantissa_bi= ts; + const unsigned nibble =3D unsigned(effective_mantissa >> rounded_mantissa_bits); __glibcxx_assert(nibble <=3D 2); leading_hexit =3D '0' + nibble; effective_mantissa &=3D ~(mantissa_t{0b11} << rounded_mantissa_bits= ); } else { - const unsigned nibble =3D effective_mantissa >> (rounded_mantissa_bits-4); + const unsigned nibble =3D unsigned(effective_mantissa >> (rounded_mantissa_bits-4)); __glibcxx_assert(nibble < 16); leading_hexit =3D "0123456789abcdef"[nibble]; effective_mantissa &=3D ~(mantissa_t{0b1111} << (rounded_mantissa_bits-4)); @@ -853,7 +853,7 @@ template while (effective_mantissa !=3D 0) { nibble_offset -=3D 4; - const unsigned nibble =3D effective_mantissa >> nibble_offset; + const unsigned nibble =3D unsigned(effective_mantissa >> nibble_offset); __glibcxx_assert(nibble < 16); *first++ =3D "0123456789abcdef"[nibble]; ++written_hexits; since on targets which lack __int128, effective_mantissa can be the integer-class uint128_t, which unlike __int128 is only _explicitly_ convert= ible to the builtin integer types. And r12-7563-ge32869a17b788b made us correc= tly exclude explicit conversion operators during copy-initialization.=