From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B9AA13858CDB; Tue, 12 Sep 2023 21:55:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B9AA13858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694555737; bh=AmAROsZSevmCnYjV6xUuVN2QPxuDmbZjIpfd49w6W08=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ByEG0tCV5G1/2dNCaSunnYWMvqvb1JHHANaV8SVqdke9UIJCUjWK/ONZ8NmuXDFHx g+l8orXp7g+VxOlYsLQlP4Q9IR/hXgOnTNE8krVh9Fpsu+6L9L1yhSApK6QXzdsAhg nxoTVQ4i/6H5z7vCqr9Y3bj2+m2gf++ZVjBwAV7E= From: "aiya64bits at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111394] Warning about uninitialized memory that is actually initialized Date: Tue, 12 Sep 2023 21:55:37 +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: unknown X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: aiya64bits at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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 resolution 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=3D111394 Sayu changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID |--- --- Comment #3 from Sayu --- (In reply to Andrew Pinski from comment #1) > N could be -1 which then would access out of bounds .. >=20 > I suspect if you add a check for n being negative in memoized_cut_rod the > warning will go away and a security issue is solved too. I see. I didn't realize that negative indexes are allowed in C, I always assumed it was undefined behavior or just invalid. However, what does "*r_3= 0 + _122" mean in the warning?=