From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C8681388C006; Mon, 22 Jun 2020 07:52:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C8681388C006 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592812361; bh=A6sAEkVBsC/3Z/pV8h9aFSqZENjJoCMN6s4CmHycvgk=; h=From:To:Subject:Date:From; b=VsMyXQlekCON9PqesogzSYI35qxodyk4L0095mqiHUwUCImn3gRHrH1aBWYNieBL4 Yfm9gNN5AHO+huz7NSlbsKwlOLTsLDyC19TNKqwBWLzjfSKZ7dZkQpYK6wu9eD7FCV aZpiIT+yyQsOwLoR685RKB+dv/GCYVbocJ+uvUlA= From: "felix.von.s at posteo dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/95810] New: Spurious UBSan warning when computing the opposite of the absolute value of INT_MIN Date: Mon, 22 Jun 2020 07:52:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: felix.von.s at posteo dot de 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2020 07:52:41 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95810 Bug ID: 95810 Summary: Spurious UBSan warning when computing the opposite of the absolute value of INT_MIN Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: felix.von.s at posteo dot de Target Milestone: --- When the expression (x <=3D 0 ? x : -x) with x having type int is compiled = with -fsanitize=3Dundefined -O3, setting (x =3D INT_MIN) triggers a spurious UBS= an warning about INT_MIN being negated. Not sure if I should file this against tree-ssa or the frontend(s), because= the expression apparently becomes (-ABS_EXPR ) very early, even at -O0. I checked this with C, C++ and D frontends.=