From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5B4D03858C52; Wed, 21 Sep 2022 21:46:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B4D03858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663796796; bh=8g88EVsVYP9C6Afpf0n//GbGRuBuruKDLk+sVUXUPCs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=t+N7mSmroGmHVQjvqyXv5rv97A0W3SGoC5aA442WF9ufmJJHiYwMaJLt8591d4EaI LNJ8LkdEPVgedWLJfcngxkWIG/h9LQ7p+X7HWkdL9tv+9Tpdf9Wt4v2ISYx5qDIrTx b6cQJYexlBZzye91DU3p2viLitUKsZQk5UW6W2Es= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107005] gcc not exploiting undefined behavior to optimize away the result of division Date: Wed, 21 Sep 2022 21:46:36 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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=3D107005 --- Comment #1 from Andrew Pinski --- That is because GCC constants folds INT_MIN / -1 into INT_MIN. GCC warns about this code for this expression while clang does not ...=