From 63424a08b77d38b1ce7d9b2eaad69ce5e05e9b74 Mon Sep 17 00:00:00 2001 From: dnovillo Date: Sat, 18 Sep 2004 13:56:23 +0000 Subject: [PATCH] * tree-ssa-alias.c (setup_pointers_and_addressables): Don't remove TREE_ADDRESSABLE from RESULT_DECL. testsuite/ChangeLog * g++.dg/tree-ssa/pr17153.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87703 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.dg/tree-ssa/pr17153.C | 17 +++++++++++++++++ gcc/tree-ssa-alias.c | 1 + 4 files changed, 27 insertions(+) create mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr17153.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5981fed67f9..8ac66921107 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2004-09-18 Diego Novillo + * tree-ssa-alias.c (setup_pointers_and_addressables): Don't + remove TREE_ADDRESSABLE from RESULT_DECL. + +2004-09-18 Diego Novillo + * tree-ssa-alias.c (dump_alias_info): Ignore NULL SSA_NAMEs. 2004-09-18 Jan Hubicka diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ddc44e64cdf..4bb46044e19 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-09-18 Diego Novillo + + * g++.dg/tree-ssa/pr17153.C: New test. + 2004-09-16 Geoffrey Keating PR pch/13361 diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr17153.C b/gcc/testsuite/g++.dg/tree-ssa/pr17153.C new file mode 100644 index 00000000000..91b4cfe1503 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/pr17153.C @@ -0,0 +1,17 @@ +/* The alias analyzer was marking RETVAL non-addressable, but RETVAL + is a special variable that's available across different functions. */ +void foo(const char*); + +struct A {}; + +struct B : A +{ + B(){} + B bar() + { + foo(__PRETTY_FUNCTION__); + return B(); + }; +}; + +B b=B().bar(); diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 34d9bb04212..baf5ff27696 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -1347,6 +1347,7 @@ setup_pointers_and_addressables (struct alias_info *ai) { if (!bitmap_bit_p (ai->addresses_needed, v_ann->uid) && v_ann->mem_tag_kind == NOT_A_TAG + && TREE_CODE (var) != RESULT_DECL && !is_global_var (var)) { /* The address of VAR is not needed, remove the -- 2.11.4.GIT