From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 777AE3858006; Tue, 6 Feb 2024 21:51:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 777AE3858006 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707256311; bh=YdwfuW+SN2ze/GcitIBgfB5h60VP5LstftvZHqNPNgE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hvXZDVG3StouiGL21OnymJhkxOjbTt4ZtlymTrQzbv9LaxB3KUTX63I0Mg0p3Z70j s58+Rd2F+2fBJJO7v229AwHNYR2XNxpyBJa1lv27+GMuAbmGnh+WrUFG3dU6YDEeQa mvMfJMl0+re2YlWHFyj8p5bm26iaxHQ2Pmg0+JV8= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available Date: Tue, 06 Feb 2024 21:51:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 7.3.0 X-Bugzilla-Keywords: rejects-valid 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D87744 --- Comment #8 from Jakub Jelinek --- if (!__l._M_hi) { __l._M_lo %=3D __m; return __l; } auto __n =3D __l._M_hi ? __builtin_clzll(__l._M_hi) : 64 + __builtin_clzll(__l._M_lo); So, on the __n initializer you already know that __l._M_hi is non-zero, no = need to test it again. Sure, the compiler will optimize it, but the shorter the method in the header the better.=