From 823f0809e616d4de3347dce1dec5f5a897f841ad Mon Sep 17 00:00:00 2001 From: Diego Novillo Date: Fri, 17 Sep 2004 21:30:23 +0000 Subject: [PATCH] re PR tree-optimization/17319 (-fno-tree-dce cause ICE) PR tree-optimization/17319 * tree-ssa-alias.c (compute_points_to_and_addr_escape): Also examine pointers on the LHS of an assignment. (collect_points_to_info_r): Handle RETURN_EXPR. testsuite/ChangeLog PR tree-optimization/17319 * gcc.dg/pr17319.c: New test. From-SVN: r87673 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr17319.c | 12 ++++++++++++ gcc/tree-ssa-alias.c | 9 +++++++++ 4 files changed, 33 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr17319.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 70a193ca095..ad206dea5da 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-09-17 Diego Novillo + + PR tree-optimization/17319 + * tree-ssa-alias.c (compute_points_to_and_addr_escape): Also + examine pointers on the LHS of an assignment. + (collect_points_to_info_r): Handle RETURN_EXPR. + 2004-09-17 Jeff Law * tree-ssa-dom.c (const_and_copies_stack): New. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index db4d92d86da..815bbbf7995 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-09-17 Diego Novillo + + PR tree-optimization/17319 + * gcc.dg/pr17319.c: New test. + 2004-09-17 Devang Patel * gcc.dg/20040813-1.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr17319.c b/gcc/testsuite/gcc.dg/pr17319.c new file mode 100644 index 00000000000..5d39e4c5707 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr17319.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-dce" } */ + +typedef unsigned long long HARD_REG_ELT_TYPE; +typedef HARD_REG_ELT_TYPE HARD_REG_SET[2]; +static HARD_REG_SET newpat_used_regs; +int try_combine (void) +{ + HARD_REG_ELT_TYPE *scan_tp_ = newpat_used_regs; + scan_tp_[0] = 0; + scan_tp_[1] = 0; +} diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index d30dc38d637..2fe4069c3c0 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -694,6 +694,9 @@ compute_points_to_and_addr_escape (struct alias_info *ai) bitmap_set_bit (ai->written_vars, ann->uid); if (may_be_aliased (var)) (VARRAY_UINT (ai->num_references, ann->uid))++; + + if (POINTER_TYPE_P (TREE_TYPE (op))) + collect_points_to_info_for (ai, op); } /* Mark variables in V_MAY_DEF operands as being written to. */ @@ -1831,6 +1834,12 @@ collect_points_to_info_r (tree var, tree stmt, void *data) switch (TREE_CODE (stmt)) { + case RETURN_EXPR: + if (TREE_CODE (TREE_OPERAND (stmt, 0)) != MODIFY_EXPR) + abort (); + stmt = TREE_OPERAND (stmt, 0); + /* FALLTHRU */ + case MODIFY_EXPR: { tree rhs = TREE_OPERAND (stmt, 1); -- 2.30.2