From patchwork Fri Sep 25 15:41:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 522902 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C424D140788 for ; Sat, 26 Sep 2015 01:41:49 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=A8koQO5e; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=K0tzShP2erTZKLWWQ9lz5EKHsKHFjKinyv9mJvNiD2kqjzBKaX kEDti4UFzZPNOBJldPX0d+iCPs83Wk5DFVLY8FJ39nnPYm0K7ZD6UC00lrSTlWrw PYeYbGL0I8iJ/skBUrY3XytKN/v0CM04QePZC1QVufPEpPQW+MQRp2Mtg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=OoBxejyn7pYQ5UhqnvGtFbrcu6Y=; b=A8koQO5e8vckKkL2q4ZN 2sl6qhAoHiIOQZLLOTfTNCXPQUWSDSre51W+XskCRdqg1uwxspmJ3C6X1ptEgCw3 fTNMhfedE6DJHd8f+fGxApJE90n5leL0FwBKIi3od76X1Z0pEBQlTA6800IBk917 AuEs3IVCV2cQsWLWffYBPCc= Received: (qmail 61958 invoked by alias); 25 Sep 2015 15:41:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 61926 invoked by uid 89); 25 Sep 2015 15:41:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mailout09.t-online.de Received: from mailout09.t-online.de (HELO mailout09.t-online.de) (194.25.134.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 25 Sep 2015 15:41:40 +0000 Received: from fwd32.aul.t-online.de (fwd32.aul.t-online.de [172.20.26.144]) by mailout09.t-online.de (Postfix) with SMTP id 2A1E574C25 for ; Fri, 25 Sep 2015 17:41:36 +0200 (CEST) Received: from [192.168.2.105] (rICQtwZQ8hjzRHJXcKXqlIhGZpXxhYWjWAz8b7tc8IcH5sUgxRcnF8IbL43Zofhw8g@[84.167.116.215]) by fwd32.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1ZfV7u-2W7eaW0; Fri, 25 Sep 2015 17:41:34 +0200 To: GCC Patches From: Bernd Schmidt Subject: Dead code in move_stmt_r Message-ID: <56056B2B.6010108@t-online.de> Date: Fri, 25 Sep 2015 17:41:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 X-IsSubscribed: yes I noticed this a while ago while trying to defer parts of omp expansion until after LTO. move_tree_r, which is used when moving code into omp child functions, has code not to remap variables inside an OMP directive. However, by the time we get here, these directives should all have been expanded already, and the code appears to be dead. Hence, the following patch. Bootstrapped and tested on x86_64-linux, ok? Bernd * tree-cfg.c (move_stmt_r): Replace dead code with an assert. Remove name from now unused argument. diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 807d96f..5712e8d 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -6557,7 +6557,7 @@ move_stmt_eh_region_tree_nr (tree old_t_nr, struct move_stmt_d *p) statement. */ static tree -move_stmt_r (gimple_stmt_iterator *gsi_p, bool *handled_ops_p, +move_stmt_r (gimple_stmt_iterator *gsi_p, bool *, struct walk_stmt_info *wi) { struct move_stmt_d *p = (struct move_stmt_d *) wi->info; @@ -6619,21 +6619,7 @@ move_stmt_r (gimple_stmt_iterator *gsi_p, bool *handled_ops_p, case GIMPLE_OMP_CONTINUE: break; default: - if (is_gimple_omp (stmt)) - { - /* Do not remap variables inside OMP directives. Variables - referenced in clauses and directive header belong to the - parent function and should not be moved into the child - function. */ - bool save_remap_decls_p = p->remap_decls_p; - p->remap_decls_p = false; - *handled_ops_p = true; - - walk_gimple_seq_mod (gimple_omp_body_ptr (stmt), move_stmt_r, - move_stmt_op, wi); - - p->remap_decls_p = save_remap_decls_p; - } + gcc_assert (!is_gimple_omp (stmt)); break; }