re PR rtl-optimization/6189 (Regression from 3.0.x: g++ -O3 generates wrong code)
authorJason Merrill <jason@redhat.com>
Tue, 9 Apr 2002 17:01:59 +0000 (13:01 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 9 Apr 2002 17:01:59 +0000 (13:01 -0400)
        PR optimization/6189
        * semantics.c (genrtl_start_function): Don't free
        DECL_SAVED_FUNCTION_DATA for inline functions.

From-SVN: r52082

gcc/cp/ChangeLog
gcc/cp/semantics.c

index c0477bdf96cf28abfcb4fcbad251b08c47961d3b..1f30899d9353dcf0bcf51930cc8ccaabd22d54c2 100644 (file)
@@ -1,5 +1,9 @@
 2002-04-09  Jason Merrill  <jason@redhat.com>
 
+       PR optimization/6189
+       * semantics.c (genrtl_start_function): Don't free
+       DECL_SAVED_FUNCTION_DATA for inline functions.
+
        * init.c (build_member_call): For now, don't convert to
        intermediate base if it would cause an error.
 
index 39f9567d06362238c552c7289a9606e4b3b099c2..fb6e1823e75526b5f0e9aac8a5888366e0b3b714 100644 (file)
@@ -2470,9 +2470,14 @@ genrtl_start_function (fn)
       if (!current_function_cannot_inline)
        current_function_cannot_inline = cp_function_chain->cannot_inline;
 
-      /* We don't need the saved data anymore.  */
-      free (DECL_SAVED_FUNCTION_DATA (fn));
-      DECL_SAVED_FUNCTION_DATA (fn) = NULL;
+      /* We don't need the saved data anymore.  Unless this is an inline
+         function; we need the named return value info for
+         cp_copy_res_decl_for_inlining.  */
+      if (! DECL_INLINE (fn))
+       {
+         free (DECL_SAVED_FUNCTION_DATA (fn));
+         DECL_SAVED_FUNCTION_DATA (fn) = NULL;
+       }
     }
 
   /* Keep track of how many functions we're presently expanding.  */