tree-ssa-alias.c (setup_pointers_and_addressables): Don't remove TREE_ADDRESSABLE...
authorDiego Novillo <dnovillo@redhat.com>
Sat, 18 Sep 2004 13:56:23 +0000 (13:56 +0000)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Sat, 18 Sep 2004 13:56:23 +0000 (09:56 -0400)
* 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.

From-SVN: r87703

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr17153.C [new file with mode: 0644]
gcc/tree-ssa-alias.c

index 5981fed67f9ff9180d10432d4ef8758471ae8738..8ac669211072193cd55a943a9958728c2ab80468 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-18  Diego Novillo  <dnovillo@redhat.com>
+
+       * tree-ssa-alias.c (setup_pointers_and_addressables): Don't
+       remove TREE_ADDRESSABLE from RESULT_DECL.
+
 2004-09-18  Diego Novillo  <dnovillo@redhat.com>
 
        * tree-ssa-alias.c (dump_alias_info): Ignore NULL SSA_NAMEs.
index ddc44e64cdfb08aa48d516fc5f86b42e334f51c2..4bb46044e19981d92b4bc4eea37bfbd132c537b9 100644 (file)
@@ -1,3 +1,7 @@
+2004-09-18  Diego Novillo  <dnovillo@redhat.com>
+
+       * g++.dg/tree-ssa/pr17153.C: New test.
+
 2004-09-16  Geoffrey Keating  <geoffk@apple.com>
 
        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 (file)
index 0000000..91b4cfe
--- /dev/null
@@ -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();
index 34d9bb04212a36e6e7d9371d11c0731debabdcbb..baf5ff27696052d6e1609ac81528d71ee6c2c8c3 100644 (file)
@@ -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