This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

compiler error in template & stdarg


% /usr/local/egcs/bin/g++ -Wall -c class.cc
class.cc: In method `void C<E>::f(...)':
class.cc:15: Internal compiler error.

% uname -a
SunOS goldfinger 5.6 Generic_105181-03 sun4u sparc SUNW,Ultra-1

% /usr/local/egcs/bin/g++ -v
Reading specs from /usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.90.25/specs
gcc version egcs-2.90.25 980302 (egcs-1.0.2 prerelease)

****************************************************************************************
configured with:
../egcs-1.0.2-prerelease/configure --prefix=/usr/local/egcs --enable-shared --enable-haifa --enable-threads
****************************************************************************************
% cat class.cc
#include <stdarg.h>

template <class E> class C
{
public:
   C() { }
   void f(...);
};

template <class E>
void C<E>::f (...) {
   va_list vl;
   va_start(vl,this);
   void *p;
   while ((p=va_arg(vl,void*))) ;
   va_end(vl);
}
****************************************************************************************
% /usr/local/egcs/bin/g++ -E class.cc
template class C<int>;

# 1 "class.cc"
# 1 "/usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.90.25/include/stdarg.h" 1 3 4
# 1 "/usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.90.25/include/va-sparc.h" 1 3 4

typedef void * __gnuc_va_list;

# 47 "/usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.90.25/include/va-sparc.h" 3 4

void va_end (__gnuc_va_list);		 

enum __va_type_classes {
  __no_type_class = -1,
  __void_type_class,
  __integer_type_class,
  __char_type_class,
  __enumeral_type_class,
  __boolean_type_class,
  __pointer_type_class,
  __reference_type_class,
  __offset_type_class,
  __real_type_class,
  __complex_type_class,
  __function_type_class,
  __method_type_class,
  __record_type_class,
  __union_type_class,
  __array_type_class,
  __string_type_class,
  __set_type_class,
  __file_type_class,
  __lang_type_class
};

# 134 "/usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.90.25/include/va-sparc.h" 3 4
# 159 "/usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.90.25/include/va-sparc.h" 3 4
# 30 "/usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.90.25/include/stdarg.h" 2 3 4
# 128 "/usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.90.25/include/stdarg.h" 3 4

typedef __gnuc_va_list va_list;

# 200 "/usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.90.25/include/stdarg.h" 3 4
# 1 "class.cc" 2

template <class E> class C
{
public:
   C() { }
   void f(...);
};

template <class E>
void C<E>::f (...) {
   va_list vl;
   (__builtin_next_arg ( this ),  vl  = (char *) __builtin_saveregs ()) ;
   void *p;
   while ((p= __extension__	(*({((__builtin_classify_type (*( void* *) 0) >= __record_type_class || (__builtin_classify_type (*( void* *) 0) == __real_type_class && sizeof ( void* ) == 16))	? (( vl ) = (char *)( vl ) + (((sizeof (  void*  * ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ,	*( void*  **) (void *) ((char *)( vl ) - (((sizeof (  void*  * ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) )) : (((sizeof (  void*  ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))  == 8	? ({ union {char __d[sizeof ( void* )]; int __i[2];} __u;	__u.__i[0] = ((int *) (void *) ( vl ))[0];	__u.__i[1] = ((int *) (void *) ( vl ))[1];	( vl ) = (char *)( vl ) + 8;	( void*  *) (void *) __u.__d; })	: (( vl ) = (char *)( vl ) + (((sizeof (  void*  ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ,	(( void*  *) (void *) ((char *)( vl ) - (((sizeof (  void*  ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ))));})) )) ;
   ((void)0) ;
}

template class C<int>;

****************************************************************************************
some empty lines deleted above


With best regards,
E. Gawrilow


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]