From a17ea89bb15f7e9668860609b8953e94b69d0763 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 11 Sep 2004 20:57:06 +0200 Subject: [PATCH] tree-ssa-alias.c (collect_points_to_info_r): Handle pointing to PTR + OFFSET as PTR... * tree-ssa-alias.c (collect_points_to_info_r): Handle pointing to PTR + OFFSET as PTR, not as pointing to PTR or pointing to OFFSET. * gcc.dg/tree-ssa/20040911-1.c: New test. From-SVN: r87357 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/tree-ssa/20040911-1.c | 21 +++++++++++++++++++++ gcc/tree-ssa-alias.c | 12 ++++++++---- 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/20040911-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 80d1437f056..57e38175d5e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-09-11 Jakub Jelinek + + * tree-ssa-alias.c (collect_points_to_info_r): Handle + pointing to PTR + OFFSET as PTR, not as pointing to PTR or pointing + to OFFSET. + 2004-09-11 Richard Henderson * expr.c (expand_expr_addr_expr_1) Rename from expand_expr_addr_expr. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 07cf16e8271..3727d52ce4d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-09-11 Jakub Jelinek + + * gcc.dg/tree-ssa/20040911-1.c: New test. + 2004-09-11 Andreas Jaeger * gcc.c-torture/execute/991118-1.x: Delete, PR 16437 is fixed. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040911-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040911-1.c new file mode 100644 index 00000000000..6b49570d21a --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/20040911-1.c @@ -0,0 +1,21 @@ +/* Verify that points-to information is handled properly for PTR + OFFSET + pointer arithmetics. */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-alias1-vops" } */ + +char buf[4], *q; +int foo (int i) +{ + char c, *p; + q = &c; + p = buf; + if (i) + p = p + 3; + else + p = p + 2; + *p = 6; + c = 8; + return *p; +} + +/* { dg-final { scan-tree-dump-not "VUSE