From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0D0BB3858CD1; Mon, 20 Nov 2023 10:45:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D0BB3858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700477155; bh=aBN9kwrNbNLt0hRQr2UrGsXd7fvcxz9hCjpuuz0H87s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=riPjCm19Mpx8y9Yc6E+Vn1LVWiLckawwOh/lM8P2xptGo6s8fHBXv4l5ZWO7Jyg1f VcU4wLOwyjl+6fjSXnov5l9qGYssl3bKlFI1FVo8XU9iwcVuBGZfChyo0B+ZkdTumQ TJjjrmdTa1+f3GrxSLsPTxGTGOQp3nhYQEhufYkc= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112635] stack smash protection does not work when code is compiled with -O Date: Mon, 20 Nov 2023 10:45:54 +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.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org 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: component 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=3D112635 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Component|libgcc |tree-optimization --- Comment #1 from Richard Biener --- Yep, GCC fixes the code for you by eliding 'buf'. That's perfectly OK thou= gh since the code invokes undefined behavior. I'm inclined to close this as INVALID/WONTFIX, it isn't really a bug (but also not a feature you can rely on of course).=