From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 11D5A38582AD; Tue, 9 Jan 2024 18:50:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 11D5A38582AD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1704826211; bh=i763Nv8m8Y6kTUjg8QMNDaowKhISX6x07exdPGKTd6M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mJNLIqsBRi6Smri0DkUAtXVTF7BcDahD929oIO1xOmsvkQt/74q1rTMtBVQtT514g 7bbb7L+FkDqdZJHwGUkTld57gLo03Dz8RN38n/e0VHFz7k5nAQ+VVh/Nsuzr+67bfk mGP723Kb02L8WC1qH5CshFr55mORhWay9UtAstTk= From: "ssbssa at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug cli/7285] printing expression gives different result to executing equivalent statement Date: Tue, 09 Jan 2024 18:50:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: cli X-Bugzilla-Version: 6.5 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ssbssa at sourceware dot org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D7285 Hannes Domani changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ssbssa at sourceware dot o= rg --- Comment #2 from Hannes Domani --- (In reply to dcoutts from comment #0) > 6 lx =3D -(1 << 63); > (gdb) n > (gdb) p lx > $2 =3D -2147483648 Isn't that undefined behavior? gcc has this warning: ``` gdb_bug.c: In function 'main': gdb_bug.c:6:12: warning: left shift count >=3D width of type [-Wshift-count-overflow] lx =3D -(1 << 63); ^~ ``` And gdb also shows a warning nowadays: ``` (gdb) p (long) -(1 << 63) warning: left shift count >=3D width of type $1 =3D 0 ``` --=20 You are receiving this mail because: You are on the CC list for the bug.=