From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0833D3858C5E; Wed, 3 Apr 2024 04:59:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0833D3858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712120384; bh=bCPAwDDl9SJrXsN5j4Fi2CGwxD4W5OR7lXztV1Ed62w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=O6vJk9lnh1hHva+YD8b5M9xFCWPaSjctOWpwVKk0f+oAt1zexPBbBLFgHXa3KAhcI hT/3R7AN9oILzzsYEHXYFQ5XwU7gnrzfKdjRF/YfcoVgVdKsLm4KhdH6esBF/DOmxH Qk16NZA6k0GT4Qu5hc5vHBoZ/Pzy5LTpmQ65fEHc= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/66630] Missing ubsan/ftrapv error Date: Wed, 03 Apr 2024 04:59:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: --- 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=3D66630 --- Comment #5 from Andrew Pinski --- (In reply to Marek Polacek from comment #2) > That's one thing. But there also something else going on. I hope it's j= ust > missing TYPE_OVERFLOW_SANITIZED in some match.pd patterns. ``` /* ~A + A -> -1 */ (simplify (plus:c (convert? (bit_not @0)) (convert? @0)) (if (!TYPE_OVERFLOW_TRAPS (type)) (convert { build_all_ones_cst (TREE_TYPE (@0)); }))) /* ~A + 1 -> -A */ (simplify (plus (convert? (bit_not @0)) integer_each_onep) (if (tree_nop_conversion_p (type, TREE_TYPE (@0))) (negate (convert @0)))) /* -A - 1 -> ~A */ (simplify (minus (convert? (negate @0)) integer_each_onep) (if (!TYPE_OVERFLOW_TRAPS (type) && TREE_CODE (type) !=3D COMPLEX_TYPE && tree_nop_conversion_p (type, TREE_TYPE (@0))) (bit_not (convert @0)))) /* -1 - A -> ~A */ (simplify (minus integer_all_onesp @0) (if (TREE_CODE (type) !=3D COMPLEX_TYPE) (bit_not @0))) ``` I am not sure which one of these patterns need the check for TYPE_OVERFLOW_SANITIZED though.=