From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 40D463858D37; Wed, 1 Feb 2023 13:16:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 40D463858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675257366; bh=ycBSYXYXG0OC2nQf6JvTV9lD4LvSYXzGdXwLMgQ9dxE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RmB/wYNGiL9d/SEk26ZS5USExUDuTGA4GRHnWMKw5B5PqOwGNDmkAqFVLm4f1Z/Lu Y9nSpWf430bM2Y0sgmxUk+Tl5xFxO1XIPglm6WYCuyjiigTU3ZZ2mXMUSb0KxyinXD zbRibMLeIIWYjnRosU6nP9qI85PReumODTEl3uoM= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/108481] [10/11/12/13 Regression] UBsan missed a signed integer overflow Date: Wed, 01 Feb 2023 13:16:06 +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: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 13.0 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=3D108481 --- Comment #6 from Jakub Jelinek --- I'd say the implementation intends to warn about UB that still remains in t= he code after optimizations, if a result of some UB invoking operation isn't u= sed (the DCE case) or as in this case the UB happens only when the result of th= e UB isn't used but it is used in some other path (sinking) etc., then the UB is= n't really invoked in the generated code. While in -O0 code it will be encountered and so it is diagnosed.=