From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 50CCD3858402 for ; Tue, 14 Sep 2021 14:13:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 50CCD3858402 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 4119920116; Tue, 14 Sep 2021 14:13:11 +0000 (UTC) Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 3A2BEA3B96; Tue, 14 Sep 2021 14:13:11 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id 2DEB76582; Tue, 14 Sep 2021 14:13:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id 2C9AF6575; Tue, 14 Sep 2021 14:13:11 +0000 (UTC) Date: Tue, 14 Sep 2021 14:13:11 +0000 (UTC) From: Michael Matz To: Aldy Hernandez cc: Jeff Law , gcc-patches Subject: Re: Regression with recent change In-Reply-To: Message-ID: References: <889cbb03-3a02-65e4-7790-c903293bacf7@gmail.com> <3af2aac4-1b26-ff97-b73a-fa7c086b8dd6@gmail.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 14:13:13 -0000 Hello, On Mon, 13 Sep 2021, Aldy Hernandez via Gcc-patches wrote: The testcase still tests what it's supposed to test with ... > > typedef unsigned short uint16_t; > > > > uint16_t a, b; > > > > int *j_global; > > uint16_t f(void) > > { > > int c, **p; > > short d = 2, e = 4; > > ... "c = a;" added here (i.e. it still hangs before the pr55107 change). > > for (;; b++) > > { > > int *j = j_global, k = 0; > > > > for (; *j; j++) > > { > > for(; c; c++) > > for(; k < 1; k++) > > { > > short *f = &d; > > > > if(b) > > return *f; > > } > > } > > > > if(!c) > > d *= e; > > > > a = d; > > if ((a ? b = 0 : (**p ? : 1) != (d != 1 ? 1 : (b = 0))) != ((k ? a > : 0) > > < (a * (c = k)))) > > **p = 0; > > } > > } > > > > Thanks for getting rid of the noise here. > > I've simplified the above to show what's going on in the warning on > nds32-elf: > > int george, *global; > int stuff(), readme(); > > int > f (void) > { > int store; > > for (;;) > { > int k = 0; > > while (global) > { > for (; store; ++store) Yeah, that seems a correct warning, your 'store' (the 'c' in the original testcase) is really used uninitialized (when 'global' aka '*j_global' is non-zero). Sorry for not noticing earlier, I was only getting rid of warnings, not carefully looking at the testcase itself. I think with above initialization of 'c' it's conforming, and still a correct test for the original bug. > This looks like a latent bug. For that matter, the above snippet warns > with -fdisable-tree-thread2, even on x86-64 (and before my patch). Ciao, Michael.