From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A3B0C3858404; Mon, 31 Oct 2022 01:59:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3B0C3858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667181588; bh=2TK3DHNoozk7t9OOU9T0At0So2IoDdKt4mC1pSY57cs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NNeupvH0ONHZme/vWx+/d0OPtyNn4Mg0kt4CXldBXbOKnB33AyMkLNiupPDet87+s bjp/5PmpnVnAZjal0fNSqpM/UDuYrl+dm1+zi1nQb+wp5r6XKNteulyva/a1JFYXIX 8DqHV5jFht96JrYHKlDh7pEYdxY9Rza+mz8yo3Eg= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107465] [10/11/12/13 Regression] Bogus warning: promoted bitwise complement of an unsigned value is always nonzero Date: Mon, 31 Oct 2022 01:59:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 11.3.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: target_milestone cf_known_to_work short_desc everconfirmed cf_known_to_fail see_also bug_status cf_reconfirmed_on 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=3D107465 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |10.5 Known to work| |4.1.2 Summary|Bogus warning: promoted |[10/11/12/13 Regression] |bitwise complement of an |Bogus warning: promoted |unsigned value is always |bitwise complement of an |nonzero |unsigned value is always | |nonzero Ever confirmed|0 |1 Known to fail| |4.4.7, 4.8.1 See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D8715 Status|UNCONFIRMED |NEW Last reconfirmed| |2022-10-31 --- Comment #2 from Andrew Pinski --- >Also, it's weird that the warning is only issued with a typedef for the ty= pe of "x". My bet there is some IR difference (inside GCC) which is causing an extra NOP_EXPR (a cast) being added due to the typedef and "unsigned short" are n= ot represented the same internally for diagnostic reasons. Confirmed. r0-88988-g2d12797c692346 (PR 8715) introduced the warning in GCC 4.4.0 which seems to point to that is what is causing the bogus warning to show up.=