summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-04 13:58:30 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-04 13:58:30 +0000
commitdfbb53241937be063137055a4f4342edd15b35fa (patch)
tree2eefdf7ef8e8005e7aa45d21ff663139d975b418
parentafc0e339311a9b11bbbee4f73944d47225f462e3 (diff)
downloadgcc-dfbb53241937be063137055a4f4342edd15b35fa.tar.gz
PR gcov-profile/34609
* tree-inline.c (declare_return_variable): Set TREE_ADDRESSABLE on return_slot if result is TREE_ADDRESSABLE. * g++.dg/gcov/gcov-6.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131322 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog18
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/gcov/gcov-6.C29
-rw-r--r--gcc/tree-inline.c3
4 files changed, 49 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6dd3f159150..7aea66bff50 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR gcov-profile/34609
+ * tree-inline.c (declare_return_variable): Set TREE_ADDRESSABLE on
+ return_slot if result is TREE_ADDRESSABLE.
+
2008-01-04 Richard Sandiford <rsandifo@nildram.co.uk>
* config/mips/mips.md (sqrt_condition): Tweak comment.
@@ -5,7 +11,7 @@
2008-01-03 Tom Tromey <tromey@redhat.com>
- PR c/34457:
+ PR c/34457
* c-common.c (c_type_hash): Handle VLAs.
2008-01-03 Jan Hubicka <jh@suse.cz>
@@ -964,7 +970,7 @@
2007-12-06 Tom Tromey <tromey@redhat.com>
- PR c/29172:
+ PR c/29172
* c-opts.c (c_common_parse_file): Call cpp_clear_file_cache.
2007-12-06 Richard Sandiford <rsandifo@nildram.co.uk>
@@ -2446,7 +2452,8 @@
2007-11-06 Tom Tromey <tromey@redhat.com>
- PR c++/32256, PR c++/32368:
+ PR c++/32256
+ PR c++/32368
* function.c (saved_in_system_header): New global.
(push_cfun): Save in_system_header.
(pop_cfun): Restore in_system_header.
@@ -25910,7 +25917,7 @@
2007-03-13 David Taylor <taylor@candd.org>
- PR driver/12448:
+ PR driver/12448
* gcc.c (cpp_unique_options): If -MT or -MQ is seen, don't pass
default -MQ.
@@ -33089,7 +33096,8 @@
2007-01-11 Tom Tromey <tromey@redhat.com>
- PR preprocessor/15185, PR preprocessor/20989:
+ PR preprocessor/15185
+ PR preprocessor/20989
* doc/cppopts.texi <-MT>: Update description of algorithm for
computing default target.
<-M, -MD>: Reword "basename" text.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5cbb424e0c0..239fbebd9bc 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR gcov-profile/34609
+ * g++.dg/gcov/gcov-6.C: New test.
+
2008-01-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/31081
diff --git a/gcc/testsuite/g++.dg/gcov/gcov-6.C b/gcc/testsuite/g++.dg/gcov/gcov-6.C
new file mode 100644
index 00000000000..53a2b20bfd5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gcov/gcov-6.C
@@ -0,0 +1,29 @@
+// PR gcov-profile/34609
+// { dg-do compile }
+// { dg-options "-O -ftest-coverage" }
+
+struct A
+{
+ int i;
+ int &get () { return i; }
+};
+
+inline A foo ()
+{
+ A a;
+ a.get ();
+ return a;
+}
+
+inline A bar ()
+{
+ return foo ();
+}
+
+void baz ()
+{
+ A a;
+ a = bar ();
+}
+
+// { dg-final { cleanup-coverage-files } }
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index a58dab00ada..8c5626d6712 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1,5 +1,5 @@
/* Tree inlining.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by Alexandre Oliva <aoliva@redhat.com>
@@ -1719,6 +1719,7 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest,
{
var = return_slot;
gcc_assert (TREE_CODE (var) != SSA_NAME);
+ TREE_ADDRESSABLE (var) |= TREE_ADDRESSABLE (result);
}
if ((TREE_CODE (TREE_TYPE (result)) == COMPLEX_TYPE
|| TREE_CODE (TREE_TYPE (result)) == VECTOR_TYPE)