From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D35383858C62; Mon, 24 Jul 2023 11:24:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D35383858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690197858; bh=iKlv4Z/+E+BHjP69dIHasMlyo+V9K5NvlxkPq2ZIMmg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L8N+ah8swd8KIpzvZPskznqk6Ql9to9xGmE3V8oUCoRC67ZGZgAoxPiM1ecI9hhwM NtbtsSs3XHU+LsITTML74Vw69BePp5EdKuAjG3UDimCj9P59GIJy5fJYOBPiX1GVyO PfW7+ihxHZ4GOvg+WZ2lx5jBcCz0ICi4872/7BaA= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/110791] [12/13/14 Regression] arm: Wrong code with -Os -march=armv8.1-m.main Date: Mon, 24 Jul 2023 11:24:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: xry111 at gcc dot gnu.org X-Bugzilla-Status: WAITING 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: bug_status cc everconfirmed cf_reconfirmed_on 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=3D110791 Xi Ruoyao changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING CC| |xry111 at gcc dot gnu.org Ever confirmed|0 |1 Last reconfirmed| |2023-07-24 --- Comment #1 from Xi Ruoyao --- Isn't this a UB? while (p >=3D path && *p !=3D '/') p--; This will cause p to become "&main::path[0] - 1". C23 6.5.6p9: If the pointer operand and the result do not point to elements of the same array object or one past the last element of the array object, the behavior= is undefined.=