From: Martin Jambor Date: Thu, 3 Sep 2009 21:25:00 +0000 (+0200) Subject: tree-sra.c (duplicate_expr_for_different_base): Removed. X-Git-Tag: releases/gcc-4.5.0~3687 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=687b5078a5de2fb7ec7e8a8a89c08c2b95bf846f;p=thirdparty%2Fgcc.git tree-sra.c (duplicate_expr_for_different_base): Removed. 2009-09-03 Martin Jambor * tree-sra.c (duplicate_expr_for_different_base): Removed. (create_artificial_child_access): Use build_ref_for_offset instead of duplicate_expr_for_different_base. (propagate_subacesses_accross_link): Likewise. From-SVN: r151394 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 26ee0050f634..3cbcff39082f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2009-09-03 Martin Jambor + + * tree-sra.c (duplicate_expr_for_different_base): Removed. + (create_artificial_child_access): Use build_ref_for_offset instead + of duplicate_expr_for_different_base. + (propagate_subacesses_accross_link): Likewise. + 2009-09-03 Richard Sandiford * config/mips/mips.c (USEFUL_INSN_P): Use NONDEBUG_INSN_P instead diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 8d4dc90d1799..aed2839dd7ad 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -1496,26 +1496,6 @@ child_would_conflict_in_lacc (struct access *lacc, HOST_WIDE_INT norm_offset, return false; } -/* Set the expr of TARGET to one just like MODEL but with is own base at the - bottom of the handled components. */ - -static void -duplicate_expr_for_different_base (struct access *target, - struct access *model) -{ - tree t, expr = unshare_expr (model->expr); - - gcc_assert (handled_component_p (expr)); - t = expr; - while (handled_component_p (TREE_OPERAND (t, 0))) - t = TREE_OPERAND (t, 0); - gcc_assert (TREE_OPERAND (t, 0) == model->base); - TREE_OPERAND (t, 0) = target->base; - - target->expr = expr; -} - - /* Create a new child access of PARENT, with all properties just like MODEL except for its offset and with its grp_write false and grp_read true. Return the new access. Note that this access is created long after all @@ -1528,6 +1508,7 @@ create_artificial_child_access (struct access *parent, struct access *model, { struct access *access; struct access **child; + bool ok; gcc_assert (!model->grp_unscalarizable_region); @@ -1536,10 +1517,13 @@ create_artificial_child_access (struct access *parent, struct access *model, access->base = parent->base; access->offset = new_offset; access->size = model->size; - duplicate_expr_for_different_base (access, model); access->type = model->type; access->grp_write = true; access->grp_read = false; + access->expr = access->base; + ok = build_ref_for_offset (&access->expr, TREE_TYPE (access->expr), + new_offset, access->type, false); + gcc_assert (ok); child = &parent->first_child; while (*child && (*child)->offset < new_offset) @@ -1571,7 +1555,12 @@ propagate_subacesses_accross_link (struct access *lacc, struct access *racc) if (!lacc->first_child && !racc->first_child && is_gimple_reg_type (racc->type)) { - duplicate_expr_for_different_base (lacc, racc); + bool ok; + + lacc->expr = lacc->base; + ok = build_ref_for_offset (&lacc->expr, TREE_TYPE (lacc->expr), + lacc->offset, racc->type, false); + gcc_assert (ok); lacc->type = racc->type; return false; }