Return of bad i386 assembly output bug

David Mazieres dm@reeducation-labor.lcs.mit.edu
Mon Aug 3 22:00:00 GMT 1998


I reported the following bug a while ago.  It was fixed in
egcs-2.91.50, but unfortunately has reappeared in egcs-2.91.52.
It would be really nice if it could be fixed again for the 1.1
release...

Using the 1.1 branch:

Reading specs from /usr/local/egcs/lib/gcc-lib/i386-netbsd/egcs-2.91.52/specs
gcc version egcs-2.91.52 19980803 (gcc2 ss-980609 experimental)

The following code does not compile without optimization.  I get:

% c++ -c already-defined.C
/var/tmp/cc2mdINt.s: Assembler messages:
/var/tmp/cc2mdINt.s:28: Fatal error:Symbol ___t11ihash_entry1Z7element already defined.
% c++ -c already-defined.C |& c++filt 
/var/tmp/cc61rLxz.s: Assembler messages:
/var/tmp/cc61rLxz.s:28: Fatal error:Symbol ihash_entry<element>::ihash_entry(void) already defined.
% 

Debuging template code is considerably easier without function
inlining.  Thus, I'm not just making a theoretical claim that the
compiler should work without optimization.  The ability to disable
optimization would have real utility.

Thanks,
David

--

template<class T>
class ihash_entry {
};

template<class T, ihash_entry<T> T::*field>
struct ihash_core {
  ihash_core () {}
};

template<class T, ihash_entry<T> T::*field>
struct ihash : public ihash_core<T, field>
{
  ihash () {}
};

struct element {
  ihash_entry<element> hlink;
};

ihash<element, &element::hlink> etab;



More information about the Gcc-bugs mailing list