From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AACE3385800D; Thu, 4 Jan 2024 16:58:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AACE3385800D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704387481; bh=HyIZ769psgGqPO15qUCraAjPRLW4iIzhKYhSiFR3pm4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Lh0x6dHw6tdKnpQOgOC/lKIIOkrV92lYOB303nBvEvu8s8u0hw4Jo4YCHk/XppjTb FWSoHylW+Bcc27mfGJZrilIdp8vWRbGPUBWfItbckOnpuWghC0ObHUeyHdOxCaVSim dhwDmJ65bK3VYVfkX8efNo16rcrh2NDddSvOCSBQ= From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug testsuite/113226] [14 Regression] testsuite/std/ranges/iota/max_size_type.cc fails for cris-elf after r14-6888-ga138b99646a555 Date: Thu, 04 Jan 2024 16:58:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: testsuite X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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=3D113226 --- Comment #2 from Patrick Palka --- (In reply to Patrick Palka from comment #1) > Huh, how bizarre. >=20 > > i =3D=3D 1, j =3D=3D -100, i*j =3D=3D 4294967196, max_type(i) =3D=3D 1,= max_type(i)*j =3D=3D -100 >=20 > Here i and j are just ordinary 'long long', so I don't get why i*j is > 4294967196 instead of -100? Everything else, in particular that int64_t(max_type(i)*j) is -100, seems correct/expected to me. FWIW that expression computes the product of the corresponding promoted/sign-extended 65-bit precision values, and the overa= ll check is analogous to int32_t i =3D 1, j =3D -100; assert (int64_t(i*j) =3D=3D int64_t(i)*j); except the two precisions are 64/65 bits instead of 32/64 bits. (When shorten_p is true, the overall check is analogous to assert (i*j =3D=3D int32_t(int64_t(i)*j)) instead.)=