From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 00A91385840E; Tue, 25 Apr 2023 07:37:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 00A91385840E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682408267; bh=JmouWle/Ipeaqq4qH+sKBGrWPzIjtH79WS8P7CG15As=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sl65B6a2FAM61DQL4sf9tMw2EBP14K1mih7zc3WuT8RnXJT42r8VFPjrn3HYwhcVA 34mMCSfRzen2SUdS6SyQndr1FKshHSx+phajJ6KB8zxH+gLP4QHjkQhwy3DGErw5cM WoHO+CQjfUlCK/gPskUebV8GIGP+B/be7jSXNERY= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/109609] [12/13/14 Regression] tail call for function even when passing a ptr which references a local array still Date: Tue, 25 Apr 2023 07:37:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 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://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109609 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jsm28 at gcc dot gnu.org --- Comment #12 from Jakub Jelinek --- I had a look at memcmp recently in the context of PR109306 and my understan= ding is that the function may but doesn't have to access all bytes from both arr= ays up to the given size. While for memchr, C17 contains: "The implementation shall behave as if it reads the characters sequentially= and stops as soon as a matching character is found." and my reading of that is that it has to stop reading upon reaching the mat= ch, so in that case the read is always just up to the given size, not the whole size. While e.g. strchr doesn't say something similar and so it needs to be passed valid zero terminated string and can but doesn't have to read the whole str= ing.=