aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSteven Bosscher <stevenb@suse.de>2005-02-10 22:57:30 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2005-02-10 22:57:30 +0000
commit3b6616ddc44fe5f8e10457a1bc830e01d38ca5d7 (patch)
tree8a75234439f297ec9f0bab12690742aba6a15db7 /gcc
parenta0c5992a2084f23d36187430a733673e2601705e (diff)
downloadgcc-3b6616ddc44fe5f8e10457a1bc830e01d38ca5d7.zip
gcc-3b6616ddc44fe5f8e10457a1bc830e01d38ca5d7.tar.gz
gcc-3b6616ddc44fe5f8e10457a1bc830e01d38ca5d7.tar.bz2
re PR tree-optimization/17549 (10% increase in codesize with C code compared to GCC 3.3)
PR tree-optimization/17549 * tree-outof-ssa.c (find_replaceable_in_bb): Do not allow TER to replace a DEF with its expression if the DEF and the rhs of the expression we replace into have the same root variable. From-SVN: r94853
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/tree-outof-ssa.c19
2 files changed, 25 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3ea3e79..d86daf4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2005-02-10 Steven Bosscher <stevenb@suse.de>
+
+ PR tree-optimization/17549
+ * tree-outof-ssa.c (find_replaceable_in_bb): Do not allow
+ TER to replace a DEF with its expression if the DEF and the
+ rhs of the expression we replace into have the same root
+ variable.
+
2005-02-10 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips.md: Fix the placement of the match_scratch in the
diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c
index 65c74d3..c6aa812 100644
--- a/gcc/tree-outof-ssa.c
+++ b/gcc/tree-outof-ssa.c
@@ -1659,8 +1659,23 @@ find_replaceable_in_bb (temp_expr_table_p tab, basic_block bb)
{
if (tab->version_info[SSA_NAME_VERSION (def)])
{
- /* Mark expression as replaceable unless stmt is volatile. */
- if (!ann->has_volatile_ops)
+ bool same_root_var = false;
+ tree def2;
+ ssa_op_iter iter2;
+
+ /* See if the root variables are the same. If they are, we
+ do not want to do the replacement to avoid problems with
+ code size, see PR tree-optimization/17549. */
+ FOR_EACH_SSA_TREE_OPERAND (def2, stmt, iter2, SSA_OP_DEF)
+ if (SSA_NAME_VAR (def) == SSA_NAME_VAR (def2))
+ {
+ same_root_var = true;
+ break;
+ }
+
+ /* Mark expression as replaceable unless stmt is volatile
+ or DEF sets the same root variable as STMT. */
+ if (!ann->has_volatile_ops && !same_root_var)
mark_replaceable (tab, def);
else
finish_expr (tab, SSA_NAME_VERSION (def), false);