From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2C9793858C5F; Mon, 27 Mar 2023 14:59:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C9793858C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679929175; bh=jHI/EZzD4B2l7hRXiqKvo5aaDd4OAfQKF3jLZgyE7rU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vDD5Toe4tbrHssVCy1tvQ4doX1ZoZcAWj+0IaE7aTGB/Wav8Mx6Bf7eqGHS1w2CWw 3sYwR5UDYNiUAzCNxsOTZpKxNrJ/9eEhuigjMkfG7FP+Zp2hnN2jxysjSIe1wuHuCk qIHRy/2O9hmdiGkdMEgV85RunLFl610SeLH7wvfg= From: "tromey at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug gdb/30278] gdb gives wrong value at -O1 Date: Mon, 27 Mar 2023 14:59:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tromey at sourceware dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot 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://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30278 --- Comment #2 from Tom Tromey --- gdb runs into this code: if (low =3D=3D high && pc =3D=3D low) { /* This is entry PC record present only at entry point of a function. Verify it is really the function entry point. = */ in dwarf2_find_location_expression. In other code paths it does properly check the condition: if (pc >=3D low && pc < high) It's hard to be sure but maybe this code is some workaround for a bad compiler case involving entry values, that's then hit by this particular test case as well. So right now I'm inclined to say that, while this is a bug, it's probably better to leave it in place than to try harder to fix it. The kind of code in the example here isn't really normal or useful. Maybe one option would be to see if the symbol ("i" in this case) really could possibly have an entry value. That would exclude "i" here since it is not a parameter. --=20 You are receiving this mail because: You are on the CC list for the bug.=