From patchwork Thu Jun 24 14:49:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 56795 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 81436B6F1A for ; Fri, 25 Jun 2010 00:49:45 +1000 (EST) Received: (qmail 30686 invoked by alias); 24 Jun 2010 14:49:44 -0000 Received: (qmail 30676 invoked by uid 22791); 24 Jun 2010 14:49:43 -0000 X-SWARE-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL, BAYES_00, 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; Thu, 24 Jun 2010 14:49:32 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id C23E9890B6 for ; Thu, 24 Jun 2010 16:49:29 +0200 (CEST) Date: Thu, 24 Jun 2010 16:49:29 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH][mem-ref2] Drop some more INDIRECT_REF handling Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) 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 Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2010-06-24 Richard Guenther * tree-complex.c (extract_component): Do not handle INDIRECT_REF. * tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise. * tree-ssa-structalias.c (get_constraint_for_1): Likewise. * tree-ssa-operands.c (get_expr_operands): Likewise. Index: gcc/tree-complex.c =================================================================== --- gcc/tree-complex.c (revision 161312) +++ gcc/tree-complex.c (working copy) @@ -596,7 +596,6 @@ extract_component (gimple_stmt_iterator case VAR_DECL: case RESULT_DECL: case PARM_DECL: - case INDIRECT_REF: case COMPONENT_REF: case ARRAY_REF: case VIEW_CONVERT_EXPR: Index: gcc/tree-ssa-ccp.c =================================================================== --- gcc/tree-ssa-ccp.c (revision 161312) +++ gcc/tree-ssa-ccp.c (working copy) @@ -1296,21 +1296,6 @@ fold_const_aggregate_ref (tree t) break; } - /* ??? Best do a fold_const_aggregate_ref_off with an extra constant - offset argument to avoid creating new trees. */ - case INDIRECT_REF: - { - tree base = TREE_OPERAND (t, 0); - if (TREE_CODE (base) == SSA_NAME - && (value = get_value (base)) - && value->lattice_val == CONSTANT - && TREE_CODE (value->value) == ADDR_EXPR - && useless_type_conversion_p (TREE_TYPE (t), - TREE_TYPE (TREE_TYPE (value->value)))) - return fold_const_aggregate_ref (TREE_OPERAND (value->value, 0)); - break; - } - case MEM_REF: /* Get the base object we are accessing. */ base = TREE_OPERAND (t, 0); @@ -1375,11 +1360,14 @@ fold_const_aggregate_ref (tree t) && (TYPE_MODE (TREE_TYPE (t)) == TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor)))) && GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (t))) != 0 - && integer_zerop (int_const_binop (TRUNC_MOD_EXPR, - idx, size_int (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (t)))), 0))) + && integer_zerop + (int_const_binop + (TRUNC_MOD_EXPR, idx, + size_int (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (t)))), 0))) { - idx = int_const_binop (TRUNC_DIV_EXPR, - idx, size_int (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (t)))), 0); + idx = int_const_binop (TRUNC_DIV_EXPR, idx, + size_int (GET_MODE_SIZE + (TYPE_MODE (TREE_TYPE (t)))), 0); FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), cnt, cfield, cval) if (tree_int_cst_equal (cfield, idx)) { Index: gcc/tree-ssa-structalias.c =================================================================== --- gcc/tree-ssa-structalias.c (revision 161312) +++ gcc/tree-ssa-structalias.c (working copy) @@ -3335,12 +3335,6 @@ get_constraint_for_1 (tree t, VEC (ce_s, { switch (TREE_CODE (t)) { - case INDIRECT_REF: - { - get_constraint_for_1 (TREE_OPERAND (t, 0), results, address_p); - do_deref (results); - return; - } case MEM_REF: { get_constraint_for_ptr_offset (TREE_OPERAND (t, 0), Index: gcc/tree-ssa-operands.c =================================================================== --- gcc/tree-ssa-operands.c (revision 161312) +++ gcc/tree-ssa-operands.c (working copy) @@ -711,10 +711,10 @@ mark_address_taken (tree ref) } -/* A subroutine of get_expr_operands to handle INDIRECT_REF, +/* A subroutine of get_expr_operands to handle MEM_REF, ALIGN_INDIRECT_REF and MISALIGNED_INDIRECT_REF. - STMT is the statement being processed, EXPR is the INDIRECT_REF + STMT is the statement being processed, EXPR is the MEM_REF that got us here. FLAGS is as in get_expr_operands. @@ -915,7 +915,6 @@ get_expr_operands (gimple stmt, tree *ex /* fall through */ case ALIGN_INDIRECT_REF: - case INDIRECT_REF: case MEM_REF: get_indirect_ref_operands (stmt, expr, flags, true); return;