From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 94AAB385782A; Tue, 2 Mar 2021 08:43:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94AAB385782A From: "schwab@linux-m68k.org" To: gdb-prs@sourceware.org Subject: [Bug sim/27483] aarch64: adds test failing when adding 0x80000000 & 0xffffffff Date: Tue, 02 Mar 2021 08:43:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: sim X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: schwab@linux-m68k.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: nickc at redhat dot com 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://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 08:43:40 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27483 --- Comment #6 from Andreas Schwab --- The compiler can assume that overflow does not happen and infer that the condition compares values that are always the same. A cast does not invoke undefined behavior, the result is merely implementation defined when the va= lue does not fit. A truely portable check would compare against INT_MIN/INT_MA= X, and the 32-bit result would have to be computed with unsigned arithmethic. --=20 You are receiving this mail because: You are on the CC list for the bug.=