From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6FC563858C53; Thu, 29 Feb 2024 23:15:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6FC563858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709248512; bh=Xrk79W0wEc8IODFINpTaEaZCjRz72ZJmjr3B2Nn6Xy4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Nm9DE5M3HW9sJPvfmybJBbRG7N20LFQBTY5ULZshnKhiZsiHiRwFZ9/e66QChpjaN qVXA8nOicPAC4j4tmdUHAifKSbfQWvVSTVfhKKxRmfzE6re/qk+0llS+kw0UPeJ0be sunTD94XVoMIHg25b9jdbTJQh/Bjl2X3+FdprigQ= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114178] incorrect -Wstringop-overflow with freestanding + new w/ initialization + no sse Date: Thu, 29 Feb 2024 23:15:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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=3D114178 --- Comment #5 from Andrew Pinski --- (In reply to Evan Teran from comment #4) > @Andrew, thanks for the quick analysis! Just to confirm, the warning is in > fact incorrect and the emitted code is not stomping outside of the buffer > bounds? >=20 > I ask because I did also one last bit, which is that changing the buffer > size can make the warning go away. That is if I make the buffer in the > example something like 132, then it's happy again, which at the very leas= t, > makes me wonder if the vectorized code is in fact going out of bounds when > the size doesn't align with the vectorized code's expectations. The code is not incorrect, It is the peel part for unaligned part of the stores. Just the warning is not using the same information that the peeling part had available to it and getting confused by it. Basically -ffreestanding is needed to hit the warning because GCC will use memset rather than vectorize the store loop. Adding -fno-tree-loop-distribute-patterns instead of -ffreestanding will also cause the warning for the same reason.=