From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6D5E83858402; Tue, 14 Sep 2021 18:53:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D5E83858402 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/102317] signed integer overflow sanitizer cannot work well with -fno-strict-overflow Date: Tue, 14 Sep 2021 18:53:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 18:53:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102317 --- Comment #10 from Jakub Jelinek --- The optimize attribute is how different options are represented in LTO compilation, so it grew over years from perhaps initial debugging use to something that is used everywhere. And we definitely aren't going to add further and further attributes that match just a small subset of the optimi= ze and/or target attributes, especially when they'd need to use the same infrastructure under the hood anyway. If you don't want to use optimize attribute, there is always the option to = just do the arithmetics in unsigned types in the few selected functions where you don't want the sanitization, and if you really want use -fwrapv-pointer together with -fsanitize=3Dinteger-signed-overflow and throw away -fno-strict-overflow.=