From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A87243858D38; Mon, 20 Nov 2023 10:52:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A87243858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700477559; bh=3HF2uMC1Bg9REqZhKEjQfPGcO6jTcHDVHJqMdTMb3BE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gnztcApF5foYo9K7UC3reByqa1DsPgbI+H+OYjSXD/1jBHTkh3X5yZIzHFBNvww8v VLqSAmJ/+4bP0ov50YG5kv9d8uX3Slc2Om3tZ9rY9MjmBl6krzE1yKhDq14NQRXJZx zmh85kwm3kNstk/TVUB0iDqYVaZGim3fZfyDdcIs= From: "ago at gentoo dot 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:52:39 +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: ago at gentoo dot 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: 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 --- Comment #2 from Agostino Sarubbo --- (In reply to Richard Biener from comment #1) > Yep, GCC fixes the code for you by eliding 'buf'. That's perfectly OK th= ough > since the code invokes undefined behavior. >=20 > 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). Thanks for the response. So the question is: to have a reliable ssp, do I have to use -O0 ?=