diff options
author | Jason Merrill <jason@redhat.com> | 2002-04-09 13:01:59 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2002-04-09 13:01:59 -0400 |
commit | edf5cd1d1d776d7eb0d2d423216a38d4cac21103 (patch) | |
tree | 2b4bfe8d351d5e7c7c7f48dc7239dff36e72fda2 | |
parent | f451b552cf66fe7b121908e7557a9ffc384bdbfb (diff) | |
download | gcc-edf5cd1d1d776d7eb0d2d423216a38d4cac21103.zip gcc-edf5cd1d1d776d7eb0d2d423216a38d4cac21103.tar.gz gcc-edf5cd1d1d776d7eb0d2d423216a38d4cac21103.tar.bz2 |
re PR rtl-optimization/6189 (Regression from 3.0.x: g++ -O3 generates wrong code)
PR optimization/6189
* semantics.c (genrtl_start_function): Don't free
DECL_SAVED_FUNCTION_DATA for inline functions.
From-SVN: r52082
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c0477bd..1f30899 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 39f9567..fb6e182 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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. */ |