From patchwork Wed Jul 27 18:49:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 107140 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 3F2DDB6F68 for ; Thu, 28 Jul 2011 04:50:03 +1000 (EST) Received: (qmail 6928 invoked by alias); 27 Jul 2011 18:50:01 -0000 Received: (qmail 6918 invoked by uid 22791); 27 Jul 2011 18:49:59 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_TM, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-gx0-f175.google.com (HELO mail-gx0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 27 Jul 2011 18:49:43 +0000 Received: by gxk3 with SMTP id 3so1467255gxk.20 for ; Wed, 27 Jul 2011 11:49:42 -0700 (PDT) Received: by 10.100.18.36 with SMTP id 36mr69518anr.9.1311792582812; Wed, 27 Jul 2011 11:49:42 -0700 (PDT) Received: from napoca ([163.181.251.115]) by mx.google.com with ESMTPS id h36sm117283anm.3.2011.07.27.11.49.41 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jul 2011 11:49:42 -0700 (PDT) Received: by napoca (sSMTP sendmail emulation); Wed, 27 Jul 2011 13:49:39 -0500 From: Sebastian Pop To: gcc-patches@gcc.gnu.org Cc: rguenther@suse.de, Sebastian Pop Subject: [PATCH] Fix PR49876: Continue code generation with integer_zero_node on gloog_error Date: Wed, 27 Jul 2011 13:49:39 -0500 Message-Id: <1311792579-26332-1-git-send-email-sebpop@gmail.com> X-IsSubscribed: yes 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 When setting gloog_error, graphite should continue code generation without early returns, as otherwise the SSA representation would not be complete. So set the new expression to integer_zero_node, that would not require more SSA updates, and continue code generation as nothing happened. Regstrapping on amd64-linux. 2011-07-27 Sebastian Pop PR tree-optimization/49876 * sese.c (rename_uses): Do not return false on gloog_error: set the new_expr to integer_zero_node and continue code generation. (graphite_copy_stmts_from_block): Remove early exit on gloog_error. --- gcc/ChangeLog | 7 +++++++ gcc/sese.c | 18 ++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b07d494..a565c18 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2011-07-27 Sebastian Pop + PR tree-optimization/49876 + * sese.c (rename_uses): Do not return false on gloog_error: set + the new_expr to integer_zero_node and continue code generation. + (graphite_copy_stmts_from_block): Remove early exit on gloog_error. + +2011-07-27 Sebastian Pop + PR tree-optimization/49471 * tree-ssa-loop-manip.c (canonicalize_loop_ivs): Build an unsigned iv only when the largest type is unsigned. Do not call diff --git a/gcc/sese.c b/gcc/sese.c index ec96dfb..04a8e75 100644 --- a/gcc/sese.c +++ b/gcc/sese.c @@ -527,10 +527,10 @@ rename_uses (gimple copy, htab_t rename_map, gimple_stmt_iterator *gsi_tgt, if (chrec_contains_undetermined (scev)) { *gloog_error = true; - return false; + new_expr = integer_zero_node; } - - new_expr = chrec_apply_map (scev, iv_map); + else + new_expr = chrec_apply_map (scev, iv_map); /* The apply should produce an expression tree containing the uses of the new induction variables. We should be @@ -540,12 +540,13 @@ rename_uses (gimple copy, htab_t rename_map, gimple_stmt_iterator *gsi_tgt, || tree_contains_chrecs (new_expr, NULL)) { *gloog_error = true; - return false; + new_expr = integer_zero_node; } + else + /* Replace the old_name with the new_expr. */ + new_expr = force_gimple_operand (unshare_expr (new_expr), &stmts, + true, NULL_TREE); - /* Replace the old_name with the new_expr. */ - new_expr = force_gimple_operand (unshare_expr (new_expr), &stmts, - true, NULL_TREE); gsi_insert_seq_before (gsi_tgt, stmts, GSI_SAME_STMT); replace_exp (use_p, new_expr); @@ -621,9 +622,6 @@ graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, gloog_error)) fold_stmt_inplace (copy); - if (*gloog_error) - break; - update_stmt (copy); } }