From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 01C393858CDB; Fri, 12 Apr 2024 05:56:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01C393858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712901405; bh=VrTutR2jLzNQ8EtQVVdUUhcl5vt4G75W/5ynuLmBypo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UONozghw6i1dJ+yrEY33AWdAKa8zEDH8+eJ8iD5HtTLuYvQYFSOZSpihGJ8U97wk7 GvhjXU+x9ymuQV9xvyAe3Fm4IcGMBs6yVx1z2YVni4HalKwxBZ+3ibqzC57zehQyzm +QKC6vN3xcJ7ytyJfMIURph7aqZ5UU0PHvdnY8cY= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/114700] Front-end optimization generates wrong code with -ftrapv. Date: Fri, 12 Apr 2024 05:56:44 +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: rguenth 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=3D114700 --- Comment #9 from Richard Biener --- That that GCC doesn't promise that -ftrapv preserves all overflows and trap= s, it merely guarantees that all overflows that actually happen trap. So GCC = is fine to contract some expressions where the overall number of overflows can only decrease. That's not a bug with -ftrapv. It is considered a bug with -fsanitize=3Dundefined though.=