From patchwork Tue Apr 5 07:54:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1613315 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=ueHGGyhH; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KXg186WJ7z9sCD for ; Tue, 5 Apr 2022 17:55:23 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C00763858C56 for ; Tue, 5 Apr 2022 07:55:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C00763858C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1649145319; bh=Bfs299QgxybQuXBIiDn4ojszSXVFgjq8oKjaHBjjc6M=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ueHGGyhHRVFa38qfcxHEyq2Di2Xd12j+MxT9bc51LWkNGsnbdUxfc30xJCKMWmzET 3CGziKnU3Vv7oz6mH70MQ1gMXX6XCAIBfsZWeWDLmJRncGJj/9PQMNCTk6IUQQQNcc lOoj0NeoloJ758ha+y4SoRrmFh9MZlUBYqID+R68= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 388673858C52 for ; Tue, 5 Apr 2022 07:54:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 388673858C52 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 08E1D1F38A for ; Tue, 5 Apr 2022 07:54:38 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E79D3132B7 for ; Tue, 5 Apr 2022 07:54:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Y8w0N731S2KUfgAAMHmgww (envelope-from ) for ; Tue, 05 Apr 2022 07:54:37 +0000 Date: Tue, 5 Apr 2022 09:54:37 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] c/105151 - move early walloca pass MIME-Version: 1.0 Message-Id: <20220405075437.E79D3132B7@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" When the walloca pass gained support for ranger the early pass was not moved to a place where SSA form is available but remained in the lowering pipeline. For the testcase in this bug this is a problem because for errorneous input we still run the lowering pipeline but here have broken SSA form which ranger does not like. The solution is to rectify the mistake with using ranger without SSA form and move the pass which solves both issues. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2022-04-05 Richard Biener PR c/105151 * passes.def (pass_walloca): Move early instance into pass_build_ssa_passes to make SSA form available. * gcc.dg/gimplefe-error-14.c: New testcase. --- gcc/passes.def | 2 +- gcc/testsuite/gcc.dg/gimplefe-error-14.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/gimplefe-error-14.c diff --git a/gcc/passes.def b/gcc/passes.def index 3e44797b10f..375d3d62d51 100644 --- a/gcc/passes.def +++ b/gcc/passes.def @@ -45,7 +45,6 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_warn_function_return); NEXT_PASS (pass_coroutine_early_expand_ifns); NEXT_PASS (pass_expand_omp); - NEXT_PASS (pass_walloca, /*strict_mode_p=*/true); NEXT_PASS (pass_build_cgraph_edges); TERMINATE_PASS_LIST (all_lowering_passes) @@ -57,6 +56,7 @@ along with GCC; see the file COPYING3. If not see PUSH_INSERT_PASSES_WITHIN (pass_build_ssa_passes) NEXT_PASS (pass_fixup_cfg); NEXT_PASS (pass_build_ssa); + NEXT_PASS (pass_walloca, /*strict_mode_p=*/true); NEXT_PASS (pass_warn_printf); NEXT_PASS (pass_warn_nonnull_compare); NEXT_PASS (pass_early_warn_uninitialized); diff --git a/gcc/testsuite/gcc.dg/gimplefe-error-14.c b/gcc/testsuite/gcc.dg/gimplefe-error-14.c new file mode 100644 index 00000000000..3e1a13219b1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gimplefe-error-14.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-fgimple" } */ + +int __GIMPLE () foo () +{ + int _1; + return a_1(D); /* { dg-error "cannot have default definition" } */ +}