From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 831063846401; Fri, 5 Apr 2024 15:13:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 831063846401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712329988; bh=SetNZz0XhAShZW/1wpxWjz4uaoggkdC6wHqwxpCA9fo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cL3BgB6HcWPFfA0+Z0hn/eGo/kfjBKvYvkOLXxmajUEhm/7Y8X22SVp7lWodIPk2N 5alTUk93zgZyMN9t5YgDy7/T57BiiZWoTKYvq+z+kHrGt8QZWEZORrSZMG7BGd1Zz+ 6EcsIoQKOZoZKHcL45z7Jn5AI5mcy7Mg8N+z+IIU= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112723] [11/12/13/14 Regression] Missed optimization for invariants 'c+c' when c += -2147483647-1 and c is a global variable Date: Fri, 05 Apr 2024 15:13:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization, TREE 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: 11.5 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=3D112723 --- Comment #7 from Jakub Jelinek --- Ah, with -fwrapv. Without -fwrapv the testcase invokes UB always, either t= he first c + c overflows or the second one, or the c +=3D -2147483647 - 1; overflows.=