This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: libg++ won't build with latest snapshots
Here are fixes for both of these problems.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
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.
Index: testsuite/g++.old-deja/g++.oliva/nameret1.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.oliva/nameret1.C,v
retrieving revision 1.1
diff -c -p -r1.1 nameret1.C
*** nameret1.C 1999/12/22 08:41:27 1.1
--- nameret1.C 1999/12/26 15:26:01
***************
*** 1,3 ****
--- 1,4 ----
+ // Build don't link:
// Copyright (C) 1999 Free Software Foundation
// by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
***************
*** 5,11 ****
// distilled from libg++'s Rational.cc
// Special g++ Options:
- // crash test - XFAIL sparc64*-*-* sparcv9*-*-* alpha*-*-*
inline int bar () return r {}
--- 6,11 ----
Index: testsuite/g++.old-deja/g++.oliva/nameret2.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.oliva/nameret2.C,v
retrieving revision 1.3
diff -c -p -r1.3 nameret2.C
*** nameret2.C 1999/12/22 09:25:27 1.3
--- nameret2.C 1999/12/26 15:26:01
***************
*** 1,3 ****
--- 1,4 ----
+ // Build don't link:
// Copyright (C) 1999 Free Software Foundation
// by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
*************** inline int bar () return r {}
*** 11,14 ****
int& foo (int& x) {
bar ();
return x;
! } // gets bogus error - XFAIL *-*-*
--- 12,15 ----
int& foo (int& x) {
bar ();
return x;
! }
Index: decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.524
diff -c -p -r1.524 decl.c
*** decl.c 1999/12/21 00:19:01 1.524
--- decl.c 1999/12/26 15:24:00
*************** store_return_init (decl)
*** 13445,13451 ****
if (DECL_REGISTER (decl))
{
original_result_rtx = DECL_RTL (decl);
! DECL_RTL (decl) = gen_reg_rtx (DECL_MODE (decl));
}
}
--- 13445,13458 ----
if (DECL_REGISTER (decl))
{
original_result_rtx = DECL_RTL (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));
}
}
Index: semantics.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/semantics.c,v
retrieving revision 1.119
diff -c -p -r1.119 semantics.c
*** semantics.c 1999/12/24 20:24:16 1.119
--- semantics.c 1999/12/26 15:24:05
*************** finish_named_return_value (return_id, in
*** 1203,1208 ****
--- 1203,1213 ----
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