Article View: gnu.g++.bug
Article #154Fatal signal
From: Douglas C. Schmidt
Date: Mon, 03 Aug 1992 10:16
Date: Mon, 03 Aug 1992 10:16
275 lines
8480 bytes
8480 bytes
G++ 2.2.2. dies on in the following way on the file included at the
end of this message:
% ~/bin/g++ -v x.c
Reading specs from /usr/gnu/version/gcc/2.2.2/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/specs
gcc version 2.2.2
/usr/gnu/version/gcc/2.2.2/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix x.c /i0/da/ub/schmidt/.trash/cca01929.i
GNU CPP version 2.2.2 (sparc)
/usr/gnu/version/gcc/2.2.2/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/cc1plus /i0/da/ub/schmidt/.trash/cca01929.i -quiet -dumpbase x.cc -version -o /i0/da/ub/schmidt/.trash/cca01929.s
GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
gcc-2.2.2: Internal compiler error: program cc1plus got fatal signal 11
----------------------------------------
extern "C"
{
struct timeval {
long tv_sec;
long tv_usec;
};
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
struct itimerval {
struct timeval it_interval;
struct timeval it_value;
};
extern "C" {
typedef int sigset_t;
typedef unsigned int speed_t;
typedef unsigned long tcflag_t;
typedef unsigned char cc_t;
typedef int pid_t;
typedef unsigned short mode_t;
typedef short nlink_t;
typedef long clock_t;
typedef long time_t;
typedef int size_t;
typedef int ptrdiff_t;
typedef unsigned short wchar_t;
struct tm {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
char *tm_zone;
long tm_gmtoff;
};
extern struct tm *__hide_gmtime (), *__hide_localtime ();
extern char *__hide_asctime (), *__hide_ctime ();
extern void __hide_tzset (), __hide_tzsetwall ();
extern int dysize();
extern time_t timelocal(), timegm();
extern char* asctime (...) ;
extern char* ctime (...) ;
double difftime (...) ;
extern struct tm* gmtime (...) ;
extern struct tm* localtime (...) ;
extern long mktime(struct tm*);
extern int strftime (...) ;
extern void tzset();
extern void tzsetwall();
extern int getitimer(int, struct itimerval*);
extern int setitimer (...) ;
extern int gettimeofday(struct timeval*, struct timezone*);
extern int settimeofday (...) ;
extern int stime (...) ;
extern int dysize(int);
long clock(void);
long time(long *);
unsigned ualarm(unsigned, unsigned);
unsigned usleep(unsigned);
void profil (...) ;
}
}
class Time_Value
{
public:
Time_Value (long sec = 0, long usec = 0);
long get_sec (void);
void set_sec (long sec);
long get_usec (void);
void set_usec (long usec);
operator timeval ();
friend Time_Value &operator + (Time_Value tv1, Time_Value tv2);
friend Time_Value &operator - (Time_Value tv1, Time_Value tv2);
friend Time_Value &operator < (Time_Value tv1, Time_Value tv2);
friend Time_Value &operator > (Time_Value tv1, Time_Value tv2);
friend Time_Value &operator == (Time_Value tv1, Time_Value tv2);
friend Time_Value &operator != (Time_Value tv1, Time_Value tv2);
private:
long tv_sec;
long tv_usec;
enum { ONE_SECOND = 1000000L };
};
Time_Value::Time_Value (long sec, long usec)
: tv_sec (sec), tv_usec (usec)
{
}
long
Time_Value::get_sec (void)
{
return this->tv_sec;
}
void
Time_Value::set_sec (long sec)
{
this->tv_sec = sec;
}
long
Time_Value::get_usec (void)
{
return this->tv_usec;
}
void
Time_Value::set_usec (long usec)
{
this->tv_usec = usec;
}
operator timeval ()
{
timeval tv;
tv.tv_sec = this->tv_sec;
tv.tv_usec = this->tv_usec;
return tv;
}
Time_Value
operator + (Time_Value src1, Time_Value src2)
{
Time_Value sum (src1.tv_sec + src2.tv_sec, src1.tv_usec + src2.tv_usec);
if (sum.tv_usec >= Time_Value::ONE_SECOND)
{
sum.tv_usec -= Time_Value::ONE_SECOND;
sum.tv_sec++;
}
else if (sum.tv_sec >= 1 && sum.tv_usec < 0)
{
sum.tv_usec += Time_Value::ONE_SECOND;
sum.tv_sec--;
}
return sum;
}
Time_Value
operator - (Time_Value src1, Time_Value src2)
{
Time_Value delta (src1.tv_sec - src2.tv_sec, src1.tv_usec - src2.tv_usec);
if (delta.tv_usec < 0)
{
delta.tv_usec += Time_Value::ONE_SECOND;
delta.tv_sec--;
}
else if (delta.tv_usec >= Time_Value::ONE_SECOND)
{
delta.tv_usec -= Time_Value::ONE_SECOND;
delta.tv_sec++;
}
return delta;
}
int
operator > (Time_Value src1, Time_Value src2)
{
if (src1.tv_sec > src2.tv_sec)
return 1;
else if (src1.tv_sec == src2.tv_sec && src1.tv_usec > src2.tv_usec)
return 1;
else
return 0;
}
int
operator < (Time_Value src1, Time_Value src2)
{
if (src1.tv_sec < src2.tv_sec)
return 1;
else if (src1.tv_sec == src2.tv_sec && src1.tv_usec < src2.tv_usec)
return 1;
else
return 0;
}
int
operator == (Time_Value src1, Time_Value src2)
{
return src1.tv_sec == src2.tv_sec && src1.tv_usec == src2.tv_usec;
}
int
operator != (Time_Value src1, Time_Value src2)
{
return !(src1 == src2);
}
extern "C" {
extern "C" {
extern struct _iobuf {
int _cnt;
unsigned char *_ptr;
unsigned char *_base;
int _bufsiz;
short _flag;
char _file;
} _iob[];
extern struct _iobuf *__hide_fopen ();
extern struct _iobuf *__hide_fdopen ();
extern struct _iobuf *__hide_freopen ();
extern struct _iobuf *__hide_popen ();
extern struct _iobuf *tmpfile();
extern long __hide_ftell ();
extern char *fgets();
extern char *gets();
extern char *__hide_sprintf ();
extern char *ctermid();
extern char *cuserid();
extern char *__hide_tempnam ();
extern char *tmpnam();
}
extern "C" {
int fclose(struct _iobuf *);
struct _iobuf * fdopen(int, const char*);
int fflush(struct _iobuf *);
int fgetc(struct _iobuf *);
char* fgets(char*, int, struct _iobuf *);
struct _iobuf * fopen(const char*, const char*);
int fprintf(struct _iobuf *, const char* ...);
int fputc(int, struct _iobuf *);
int fputs(const char*, struct _iobuf *);
int fread(void*, int , int , struct _iobuf *);
struct _iobuf * freopen(const char*, const char*, struct _iobuf *);
int fscanf(struct _iobuf *, const char* ...);
int fseek(struct _iobuf *, long, int);
long ftell(struct _iobuf *);
int fwrite(const void*, int , int , struct _iobuf *);
char* gets(char*);
int getw(struct _iobuf *);
int pclose(struct _iobuf *);
void perror(const char*);
struct _iobuf * popen(const char*, const char*);
int printf(const char* ...);
int puts(const char*);
int putw(int, struct _iobuf *);
int rewind(struct _iobuf *);
int scanf(const char* ...);
void setbuf(struct _iobuf *, char*);
void setbuffer(struct _iobuf *, char*, int);
int setlinebuf(struct _iobuf *);
int setvbuf(struct _iobuf *, char*, int, int );
int sscanf(char*, const char* ...);
struct _iobuf * tmpfile();
int ungetc(int, struct _iobuf *);
int vfprintf (...) ;
int vprintf (...) ;
char* sprintf (...) ;
char* vsprintf (...) ;
extern int _filbuf (...) ;
extern int _flsbuf (...) ;
}
extern "C" {
extern void __eprintf (const char *, const char *, int, const char *);
}
}
int
main (int argc, char *argv[])
{
Time_Value tv1;
Time_Value tv2 (10);
Time_Value tv3 (100);
Time_Value tv4 (1, 1000000);
Time_Value tv5 (2);
((void) ((tv1 == Time_Value (0)) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "Time_Value.C", 19, "tv1 == Time_Value (0)"), 0) )) ;
((void) ((tv2 < tv3) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "Time_Value.C", 20, "tv2 < tv3"), 0) )) ;
((void) ((tv2 == Time_Value (1, 1000000 * 10)) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "Time_Value.C", 21, "tv2 == Time_Value (1, 1000000 * 10)"), 0) )) ;
((void) ((tv5 == tv4) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "Time_Value.C", 22, "tv5 == tv4"), 0) )) ;
((void) ((tv1 != tv2) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "Time_Value.C", 23, "tv1 != tv2"), 0) )) ;
}
Technical Details
Message-ID:
<9208031716.aa06935@Paris.ics.uci.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!net6.ics.uci.edu!schmidtShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!net6.ics.uci.edu!schmidt From: schmidt@net6.ics.uci.edu (Douglas C. Schmidt) Subject: Fatal signal Message-ID: <9208031716.aa06935@Paris.ics.uci.edu> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Mon, 3 Aug 1992 10:16:00 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 276