From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BA8523857B93; Thu, 2 Nov 2023 20:53:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA8523857B93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698958432; bh=lxPpA6+rOtEioKLpBcf8mnopoYUoP5cknI7gpJJYpKA=; h=From:To:Subject:Date:From; b=f/jmoLq6avOnStRnGWR7u4owCqrkrDVHsovKoSM6Ci0kplxBnREpgLncJV1BUvQmJ 2hMwUTQ3qT+jTHTkWz4UBvwNr++GifNLxSxCeGC5cGJac41qT32ydIqbYUaxGxcziL rMx58W2P+XpcFhn3pgUdQMPnobKREAiMen4Xj6KQ= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112356] New: `x == MIN & x > y` is not optimized to 0 if x was casted to signed from unsigned Date: Thu, 02 Nov 2023 20:53:52 +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: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112356 Bug ID: 112356 Summary: `x =3D=3D MIN & x > y` is not optimized to 0 if x was casted to signed from unsigned Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization Assignee: pinskia at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Take: ``` #include signed f2_1( unsigned x, signed y) { signed xs =3D x; signed t =3D x =3D=3D INT_MIN; signed t1 =3D xs > y; return t & t1; } ``` This is not optimized to 0.=