From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 13F153858D39; Tue, 25 Apr 2023 07:42:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13F153858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682408565; bh=WoaSDFBQZLNnfn0kIop0xHyqjsU6XBqZXNkQEJbN0bI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ULt5iyB2Jw/43kNeXqBCQ9VVy5GFFXaMqcZu6C2SEtVDs7VWm5pUmggj3AsS9p+cp NUKIqWxjMK43lFBrC/LyK7I6fvl/awXieNCDhilKVxcdncP9ZuO5kcRKfd/CN0u3q6 BrgCmtdU8pmNApft9/a0NLoMUNHLRevDJEJn5BHM= 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:42:44 +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: 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 --- Comment #13 from Jakub Jelinek --- strncpy second argument is an array rather than necessarily a string and characters after '\0' are not copied, so if n is non-zero, it reads between= 1 and n characters from the source array (not sure if a dumb implementation c= ould try to read all characters and only copy those until '\0' inclusive though)= .=