From patchwork Mon May 14 13:50:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 159004 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]) by ozlabs.org (Postfix) with SMTP id C3889B7028 for ; Mon, 14 May 2012 23:50:59 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1337608260; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:Message-ID:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=eCvGZxer/cMWj9+UzcgV /1ARNWk=; b=EKnTkkbOkYYYakFrXlHiAK9X7zgGNldAqlR6cEHF8mbxTWwleJVF cEr6LPEE4h+58gHdk+/gC3zEwQMfM6PPFklag3UaDfYRneXiSWdgi8p1P3V07DUq 4+8NpfZgGlDe/7KC0KKsJGxEaK5x4BjorI+yfUuDz9hUlH/D91VKvIY= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Vfd/jy6uUKUWRSi4Ns85ffUBZVBqbx2S0qvHEjFxRqFhHaLzLiy83pIyz9lGIu 29feTR0SZRp29EZnDRsHaAppEcIq+uMHYUOspmJfnKd8E2L445ya4ITwS3QzEnKB tQgHU1b4nPvm9mhsFUDYwhccfPXK6e1LnNK/blDMq6bWM=; Received: (qmail 10929 invoked by alias); 14 May 2012 13:50:54 -0000 Received: (qmail 10894 invoked by uid 22791); 14 May 2012 13:50:52 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, TW_TM, TW_TX, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 May 2012 13:50:39 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 0F3FE89994 for ; Mon, 14 May 2012 15:50:38 +0200 (CEST) Date: Mon, 14 May 2012 15:50:37 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH][3/n] Remove mark_symbols_for_renaming Message-ID: MIME-Version: 1.0 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 This makes sure we consistently (in all paths into the gimplifier) mark generated _LHS_(!) for renaming. This exposes enough bugs in OMP lowering in SSA form (via autopar) that this is 3/n and not 2/n which relies on random stmt operands being rewritten into SSA form for random stmt gimplification ... Bootstrapped and tested on x86_64-unknown-linux-gnu (with autopar fallout hopefully fixed by 2/n). Richard. 2012-05-14 Richard Guenther * gimplify.c (gimple_regimplify_operands): Only mark the LHS of statements for renaming. (force_gimple_operand_1): Likewise, consistently for both calls to force_gimple_operand and force_gimple_operand_gsi. Index: gcc/gimplify.c =================================================================== --- gcc/gimplify.c (revision 187456) +++ gcc/gimplify.c (working copy) @@ -8531,7 +8531,13 @@ gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator i; for (i = gsi_start (pre); !gsi_end_p (i); gsi_next (&i)) - mark_symbols_for_renaming (gsi_stmt (i)); + { + tree lhs = gimple_get_lhs (gsi_stmt (i)); + if (lhs + && TREE_CODE (lhs) != SSA_NAME + && is_gimple_reg (lhs)) + mark_sym_for_renaming (lhs); + } } gsi_insert_seq_before (gsi_p, pre, GSI_SAME_STMT); } @@ -8585,6 +8591,21 @@ force_gimple_operand_1 (tree expr, gimpl for (t = gimplify_ctxp->temps; t ; t = DECL_CHAIN (t)) add_referenced_var (t); + if (!gimple_seq_empty_p (*stmts) + && gimplify_ctxp->into_ssa) + { + gimple_stmt_iterator i; + + for (i = gsi_start (*stmts); !gsi_end_p (i); gsi_next (&i)) + { + tree lhs = gimple_get_lhs (gsi_stmt (i)); + if (lhs + && TREE_CODE (lhs) != SSA_NAME + && is_gimple_reg (lhs)) + mark_sym_for_renaming (lhs); + } + } + pop_gimplify_context (NULL); return expr; @@ -8621,14 +8642,6 @@ force_gimple_operand_gsi_1 (gimple_stmt_ if (!gimple_seq_empty_p (stmts)) { - if (gimple_in_ssa_p (cfun)) - { - gimple_stmt_iterator i; - - for (i = gsi_start (stmts); !gsi_end_p (i); gsi_next (&i)) - mark_symbols_for_renaming (gsi_stmt (i)); - } - if (before) gsi_insert_seq_before (gsi, stmts, m); else