diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-12-26 15:28:18 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-12-26 15:28:18 +0000 |
commit | f0ad3f46757c37b2968fbcb9f7d26a16409ba05f (patch) | |
tree | 55a2742c78d03dd182d4d3aa9767bdaf5afece4a /gcc | |
parent | 1d691c534447434946ede05598e13e37026cf124 (diff) | |
download | gcc-f0ad3f46757c37b2968fbcb9f7d26a16409ba05f.zip gcc-f0ad3f46757c37b2968fbcb9f7d26a16409ba05f.tar.gz gcc-f0ad3f46757c37b2968fbcb9f7d26a16409ba05f.tar.bz2 |
decl.c (store_return_init): Use mode of old RTL generated for DECL_RESULT, not the mode of DECL_RESULT itself.
* decl.c (store_return_init): Use mode of old RTL generated for
DECL_RESULT, not the mode of DECL_RESULT itself.
* semantics.c (finish_named_return_value): Set DECL_UNINLINABLE
for functions that used named return values.
From-SVN: r31092
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/decl.c | 9 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.oliva/nameret1.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.oliva/nameret2.C | 3 |
5 files changed, 23 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f8936b6..9045196 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +1999-12-26 Mark Mitchell <mark@codesourcery.com> + + * decl.c (store_return_init): Use mode of old RTL generated for + DECL_RESULT, not the mode of DECL_RESULT itself. + * semantics.c (finish_named_return_value): Set DECL_UNINLINABLE + for functions that used named return values. + 1999-12-24 Mark Mitchell <mark@codesourcery.com> * semantics.c (expand_body): Use diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index db44737..f8c473f 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -13445,7 +13445,14 @@ store_return_init (decl) if (DECL_REGISTER (decl)) { original_result_rtx = DECL_RTL (decl); - DECL_RTL (decl) = gen_reg_rtx (DECL_MODE (decl)); + /* Note that the mode of the old DECL_RTL may be wider than the + mode of DECL_RESULT, depending on the calling conventions for + the processor. For example, on the Alpha, a 32-bit integer + is returned in a DImode register -- the DECL_RESULT has + SImode but the DECL_RTL for the DECL_RESULT has DImode. So, + here, we use the mode the back-end has already assigned for + the return value. */ + DECL_RTL (decl) = gen_reg_rtx (GET_MODE (original_result_rtx)); } } diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index d55ee15..efcfc1a 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1203,6 +1203,11 @@ finish_named_return_value (return_id, init) store_return_init (decl); } } + + /* Don't use tree-inlining for functions with named return values. + That doesn't work properly because we don't do any translation of + the RETURN_INITs when they are copied. */ + DECL_UNINLINABLE (current_function_decl) = 1; } /* Cache the value of this class's main virtual function table pointer diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/nameret1.C b/gcc/testsuite/g++.old-deja/g++.oliva/nameret1.C index 377f9f3..88bc4666 100644 --- a/gcc/testsuite/g++.old-deja/g++.oliva/nameret1.C +++ b/gcc/testsuite/g++.old-deja/g++.oliva/nameret1.C @@ -1,3 +1,4 @@ +// Build don't link: // Copyright (C) 1999 Free Software Foundation // by Alexandre Oliva <oliva@lsd.ic.unicamp.br> @@ -5,7 +6,6 @@ // distilled from libg++'s Rational.cc // Special g++ Options: -// crash test - XFAIL sparc64*-*-* sparcv9*-*-* alpha*-*-* inline int bar () return r {} diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/nameret2.C b/gcc/testsuite/g++.old-deja/g++.oliva/nameret2.C index c3f77b4..3a69edf 100644 --- a/gcc/testsuite/g++.old-deja/g++.oliva/nameret2.C +++ b/gcc/testsuite/g++.old-deja/g++.oliva/nameret2.C @@ -1,3 +1,4 @@ +// Build don't link: // Copyright (C) 1999 Free Software Foundation // by Alexandre Oliva <oliva@lsd.ic.unicamp.br> @@ -11,4 +12,4 @@ inline int bar () return r {} int& foo (int& x) { bar (); return x; -} // gets bogus error - XFAIL *-*-* +} |