From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2695438582AE; Tue, 30 Jan 2024 15:38:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2695438582AE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706629103; bh=K9+nxHq5aqY0AynwYiqi2DHc/t2Xu+B86zpVKxGDEvM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QyW7XIejPMlowtTZyls+zBvZACAqRInjd7Gmkpl/Jd9ZZXzF/ksC5mW3gtc3wqph/ Wjx+5VozKaAJ0xgKIBpYAQntZtqdPbrUcKRSLIlXGKkM+lwfm59ud9BdOaKlC/wfDE PO0EcvZB++a851QcUoWkfIUF7ucQdprNQDc8mevE= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/113669] -fsanitize=undefined failed to check a signed integer overflow Date: Tue, 30 Jan 2024 15:38:22 +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.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 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=3D113669 --- Comment #1 from Jakub Jelinek --- This is because already the FE optimizes it, when it sees that ((int)(g_B * g_A[1])) & (g_A[1] & g_A[0]) | g_A[0] is just being added to unsigned char element, the upper bits of it aren't needed, so the multiplication and & and | are all performed in unsigned char rather than wider types.=