]> gcc.gnu.org Git - gcc.git/commitdiff
re PR gcov-profile/34609 (ICE with "-ftest-coverage" and references)
authorJakub Jelinek <jakub@gcc.gnu.org>
Fri, 4 Jan 2008 13:58:30 +0000 (14:58 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 4 Jan 2008 13:58:30 +0000 (14:58 +0100)
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.

From-SVN: r131322

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/gcov/gcov-6.C [new file with mode: 0644]
gcc/tree-inline.c

index 6dd3f1591504001749acc0ac3ae954c13640e75c..7aea66bff50922380d228d4d2aa575acb09ecf7b 100644 (file)
@@ -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>
 
 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>
 
 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.
 
 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.
 
 
 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.
index 5cbb424e0c01cbd06bf371d0cf078f665ebcfae1..239fbebd9bc850df0ea4bc956d9f74465dbd4e55 100644 (file)
@@ -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 (file)
index 0000000..53a2b20
--- /dev/null
@@ -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 } }
index a58dab00adad84a435ddc081d786ea63b7fb1bfc..8c5626d6712d2a4ee9962824fe0e6187e865e7b7 100644 (file)
@@ -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)
This page took 0.157049 seconds and 5 git commands to generate.