From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4F250384AB60; Fri, 12 Apr 2024 06:33:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F250384AB60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712903606; bh=Ai5ZlHv2i82aqoXWXC49DjNa5NrEVqW40Q3OmbUzoS4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qmwn5dmAgNPS+/iQ2aZTwTnvrkSHQbDGPMdQf7bHGivb5UeImNOLoRJlscdfQ/lF8 4BB9uqQFe8Ym2iDLj0vdOXVcVWzSrimOL+NXbDFJY/jgsafUbkyPA0hyKn21scvHOI CXH6n4SRAQPv4/cN14zoBbLHrW6BSyiLNLybfK6Y= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/114700] Front-end optimization generates wrong code with -fsanitize=undefined Date: Fri, 12 Apr 2024 06:33:25 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xry111 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: short_desc cc 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=3D114700 Xi Ruoyao changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Front-end optimization |Front-end optimization |generates wrong code with |generates wrong code with |-ftrapv. |-fsanitize=3Dundefined CC| |xry111 at gcc dot gnu.org --- Comment #10 from Xi Ruoyao --- (In reply to Richard Biener from comment #9) > That that GCC doesn't promise that -ftrapv preserves all overflows and > traps, it merely guarantees that all overflows that actually happen trap.= =20 > So GCC is fine to contract some expressions where the overall number of > overflows can only > decrease. >=20 > That's not a bug with -ftrapv. >=20 > It is considered a bug with -fsanitize=3Dundefined though. So modifying the subject.=