From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1FBE23858D32; Mon, 27 Feb 2023 18:14:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1FBE23858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677521695; bh=A3jFDKTFQJ8EYvDdwyVpFRnK0S9RSp5Bd19b1VPGjTo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=szVS/WG+riuFEzo8jbDMmc6/p/D0Y/CDkN2T2R3lPwHwKWiUmH5x495RlJgFc+/J5 n63t9igX3bn6nC4i1EyRUrsq577RGtx3xLr+ibHudZcNbtu1rAQfYPwS9Z/MKLrDuR qVSmAtAydz0KjFXAxBENo1Nzh8w4iGlygPUDtXpE= From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/108937] Intrinsic IBITS(I,POS,LEN) fails when LEN equals to BIT_SIZE(I). Date: Mon, 27 Feb 2023 18:14:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl 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=3D108937 --- Comment #4 from kargl at gcc dot gnu.org --- (In reply to saitofuyuki from comment #3) > Thanks a lot. >=20 > > Not sure it's a bug. >=20 > I see. I do agree it's not a bug and the answer of the particular case is > undefined. >=20 > But (for 32-bit integer case), since implemented ISHFT(I,32) returns 0 for > any representation of I, I suppose it may be better to return I as it is = by > IBITS(I,0,32) (again, I agree it is not defined by standard). >=20 > Anyway, thanks a lot for your comment. In the end, gfortran should probably do something that a user might expect, and that would likely be two-complements wrap-around unsigned integer arithmetic.=