From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 9CC4C385142A for ; Tue, 6 Sep 2022 09:28:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9CC4C385142A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id AA3B7339C4 for ; Tue, 6 Sep 2022 09:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662456527; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=mn1ira7oD7/iwAbsv7RDPGilSF1Q3CxW7aSXERvDBGM=; b=WQEswvOVu+YBhxHKrMJIIhhbjFCbQxCTWmR/yxvG3DCCfUfQo83kjRkD6bZNuYdFV/n7vi PU3fFsi+vvhIRkzyOcNcuf0ynWs3bJohGFSo17H6r8WXGBPh88WAY/NMStlKogGO+vhjrr Rb+v0dBTuBows82BmglWqD70+T9DR5I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662456527; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=mn1ira7oD7/iwAbsv7RDPGilSF1Q3CxW7aSXERvDBGM=; b=dQmTDYiUnhBTtT4QGRKt1hzEJvTyJqWcbLOSOPqg0TpoQgPqgPcQIgrLri4TKqrnYx2/eT qjbmojYQv4ABtUAQ== 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 A573E2C141 for ; Tue, 6 Sep 2022 09:28:47 +0000 (UTC) Date: Tue, 6 Sep 2022 09:28:47 +0000 (UTC) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/106844 - fix ICE in init_use_preds User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,MISSING_MID,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Message-ID: <20220906092847.nzqZfkTOy_p99yD0oD6JHqg1_vHTfckf8iA8fXHauDA@z> The following fixes an oversight in the last change to compute_control_dep_chain where we have to return whether we found a chain. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/106844 * gimple-predicate-analysis.cc (compute_control_dep_chain): Return whether we found a chain. * gcc.dg/pr106844.c: New testcase. --- gcc/gimple-predicate-analysis.cc | 2 +- gcc/testsuite/gcc.dg/pr106844.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/pr106844.c diff --git a/gcc/gimple-predicate-analysis.cc b/gcc/gimple-predicate-analysis.cc index 681047deee7..ef2906ebc51 100644 --- a/gcc/gimple-predicate-analysis.cc +++ b/gcc/gimple-predicate-analysis.cc @@ -1077,7 +1077,7 @@ compute_control_dep_chain (basic_block dom_bb, const_basic_block dep_bb, if (dump_file) fprintf (dump_file, "param_uninit_control_dep_attempts " "exceeded: %u\n", *num_calls); - return false; + break; } ++*num_calls; diff --git a/gcc/testsuite/gcc.dg/pr106844.c b/gcc/testsuite/gcc.dg/pr106844.c new file mode 100644 index 00000000000..df68d76f257 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr106844.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O -Wuninitialized --param uninit-control-dep-attempts=1" } */ + +struct { + int count; + int array[8]; +} fde_merge_v1; + +void +fde_merge_i2() { + unsigned i1; + do + while (i1 && fde_merge_v1.array[i1 - 1]) /* { dg-warning "uninitialized" } */ + i1--; + while (fde_merge_i2); +} -- 2.35.3