This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ipa-visibility TLC 2/n
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Yufeng Zhang <Yufeng dot Zhang at arm dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, "rth at redhat dot com" <rth at redhat dot com>
- Date: Wed, 28 May 2014 23:56:36 +0200
- Subject: Re: ipa-visibility TLC 2/n
- Authentication-results: sourceware.org; auth=none
- References: <20140525055420 dot GA24940 at kam dot mff dot cuni dot cz> <CAJA7tRaBGkhNZjfEFpkrq8M5sSCOhNgt9dhLrTkXpYY9WZBunw at mail dot gmail dot com> <20140525222349 dot GA30013 at kam dot mff dot cuni dot cz> <20140526010404 dot GC9540 at kam dot mff dot cuni dot cz> <CAJA7tRZJ8HLjJ1y3XM7OT_ExkFr7k7=dz-p=5mcBiOuXR-zVfg at mail dot gmail dot com> <20140527200645 dot GA3384 at kam dot mff dot cuni dot cz> <20140527222049 dot GA31853 at kam dot mff dot cuni dot cz> <53861F33 dot 20605 at arm dot com>
> Any update?
>
> I've managed to generate a simple test case from
> libstdc++-v3/src/c++98/strstream.cc which reproduces the issue on
> ARM that Ramana has reported previously:
>
>
> template<class _CharT> struct char_traits;
>
> template<typename _CharT, typename _Traits>
> class basic_ios
> {
> };
>
> template<typename _CharT, typename _Traits = char_traits<_CharT> >
> class basic_istream : virtual public basic_ios<_CharT, _Traits>
> {
> protected:
> int _M_gcount;
> virtual ~basic_istream()
> { }
> };
>
> class istrstream : public basic_istream<char>
> {
> virtual ~istrstream();
> };
>
> istrstream::~istrstream()
> {
> }
>
> ------------------ CUT ------------------
>
> With an arm-none-linux-gnueabi gcc configured as:
>
> ./gcc/configure --target=arm-none-linux-gnueabi
> --enable-gnu-indirect-function --enable-shared --with-arch=armv7-a
> --with-fpu=vfpv3-d16 --with-float=softfp --with-arch=armv7-a
> (irrelevant parts omitted)
>
> With the following command line options:
>
> -fdata-sections -O2 -fPIC -S ./test.cpp
>
> We'll see
>
> ./test.cpp:17:7: error: istrstream::_ZTV10istrstream.localalias.0
> causes a section type conflict with istrstream::_ZTV10istrstream
> class istrstream : public basic_istream<char>
> ^
> ./test.cpp:17:7: note: 'istrstream::_ZTV10istrstream' was declared here
This seems to be same cause as on AIX - we do section for decl rather than
original. The following patch seems to fix it. Does it allows bootstrap
for you? (it doesn't for AIX. but that seems bug in output machinery)
Index: varasm.c
===================================================================
--- varasm.c (revision 210914)
+++ varasm.c (working copy)
@@ -1083,6 +1083,9 @@
{
addr_space_t as = ADDR_SPACE_GENERIC;
int reloc;
+ symtab_node *snode = symtab_get_node (decl);
+ if (snode)
+ decl = symtab_alias_ultimate_target (snode)->decl;
if (TREE_TYPE (decl) != error_mark_node)
as = TYPE_ADDR_SPACE (TREE_TYPE (decl));
>
>
> Yufeng