From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 46DCA3858D29; Sat, 11 Sep 2021 19:33:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 46DCA3858D29 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/102291] [9/10/11/12 Regression] wrong overflow warning for compound expression conversion and bit_and expressions Date: Sat, 11 Sep 2021 19:33:23 +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.2.0 X-Bugzilla-Keywords: diagnostic 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: 9.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: short_desc cf_known_to_work cf_known_to_fail target_milestone 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 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: Sat, 11 Sep 2021 19:33:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102291 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|dubious overflow warning |[9/10/11/12 Regression] | |wrong overflow warning for | |compound expression | |conversion and bit_and | |expressions Known to work|9.4.0 |4.1.2 Known to fail| |4.4.7 Target Milestone|--- |9.5 --- Comment #1 from Andrew Pinski --- I don't think this really a regression from GCC 9 but rather a regression f= rom a long time ago. Take: typedef unsigned long ulong; typedef unsigned char uchar; ulong testera(ulong ul) { return ((((uchar) (((void)0, ((uchar) (0x80)))|0)) & 0x3f)); } ----- CUT ---- This is slightly different from your teststcase but it warns all the way ba= ck until sometime before 4.4.0 (I only can test 4.1.2).=