This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [LTO][PATCH] Check for defintions in prevailing DECLs
- From: Rafael Espindola <espindola at google dot com>
- To: Doug Kwan (éæå) <dougkwan at google dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Diego Novillo <dnovillo at google dot com>
- Date: Wed, 26 Nov 2008 08:30:19 +0000
- Subject: Re: [LTO][PATCH] Check for defintions in prevailing DECLs
- References: <498552560811260016i47542a8m3963e9dbb5a619f7@mail.gmail.com>
2008/11/26 Doug Kwan (éæå) <dougkwan@google.com>:
> Hi,
>
> This patch add a check for defintions in DECLs. DECLs without
> definitions are not consider prevailing. Note that this matches the
> behaviour of the linker. Tested on i686-unknown-linux-gnu.
I think this is the wrong way to do it. We should define that on disk
if a decl is not DECL_EXTERNAL it must have a body and if it is
DECL_EXTERNAL it must not have one. We can then fix cc1/cc1plus to
make it happen.
The linker behavior is to see uses (without body) and definitions (with body).
> -Doug
>
> 2008-11-25 Doug Kwan <dougkwan@google.com>
>
> * lto-function-in.c (get_resolution): Check for definitions in
> DECLs.
>
> testsuite/ChangeLog.lto:
>
> * g++.dg/lto/20081125.h: New.
> * g++.dg/lto/20081125_0.C: New.
> * g++.dg/lto/20081125_1.C: New.
>
Cheers,
--
Rafael Avila de Espindola
Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047