From: hsw@columbia.sparta.com (Howard Weiss)
Subject: Re:  GCC 2.1 on ISC UNIX
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 15 Apr 1992 06:55:19 GMT

> No one can tell what is happening unless you follow the instructions
> under "how to report a bug" and send us the CPP-processed input file.

Sorry about that!

Lets try again....  I have compiled GCC 2.1 on a Gateway 2000 386/25
running Interactive UNIX version 2.2 (SysV r3.2).  The compilation was
accomplished using "configure --host=i386-isc --target=i386-isc".  The
only change I made to the Makefile was to remove any use of the POSIX
libraries on loading the first generation of the code (compiling with
the native C compiler) because I am running a older version of the
compiler and I do not have the posix libs (libposix.a).  I have
attached to this message a copy of the Makefile that was used to
compile the ntp code using GCC 1.39 on this same machine with same
version of the operating system.  I have also attached the output of
the preprocessor using the -E switch.  In compiling the ntp code -
consisting of ntp.c and ntpsubs.c - ntp.c compiles succesfully, but I
get the following message when compiling ntpsubs.c:

gcc: Internal compiler error: program cc1 got fatal signal 6.

Since my first (incomplete) message, I have found that if I compile
ntpsubs.c with the "-msoft-float" switch, I do not get the fatal
signal, the code compiles, and runs!

Howard Weiss

------------------------------------------




#######
#####	Makefile I Used to build the code with gcc - only using ntp rules
#######
#
# $Source: /usr/users/louie/ntp/RCS/Makefile,v $ $Revision: 3.4.1.7 $ $Date: 89/05/18 12:43:32 $
#
# $Log:	Makefile,v $
# Revision 3.4.1.7  89/05/18  12:43:32  louie
# Add preliminary support of NeXT machine, new floating point bug work-around
# and reference clock support.
# 
# Revision 3.4.1.6  89/05/03  15:08:06  louie
# In the Makefile, remove references to the readclock.c module.
# 
# Revision 3.4.1.5  89/04/10  15:54:19  louie
# Add dependency for ntpd.o on ntp.h so things sorta work even without doing a
# "make depend".  Trash "ci" rule.
# 
# Revision 3.4.1.4  89/04/07  18:04:14  louie
# Add definition of NOSWAP for Ultrix systems.
# 
# Revision 3.4.1.3  89/03/29  12:21:27  louie
# Don't bother to create the Version file for the distribution any longer.
# Define SUN_FLT_BUG rather than just 'sun' to get the a fix for a floating
# point problem in ntpsubs; apparantly the DECSTATION 3100 also has the
# same problem.
# 
# Revision 3.4.1.2  89/03/22  18:25:14  louie
# patch3: Use new and improved RCS headers.
# 
# Revision 3.4.1.1  89/03/20  00:01:24  louie
# patch1: Add LIBS macro to Makefile directives which link ntp, ntpdc, ntpd and
# patch1: test programs.
# patch1:  
# patch1: Add symbolic version identifier to Makefile install targets for
# patch1: proper directory name.
# 
# Revision 3.4  89/03/17  18:36:37  louie
# Latest test release.
# 
# Revision 3.3.1.1  89/03/17  18:21:17  louie
# Install new binaries only if they differ.
# 
# Revision 3.3  89/03/15  14:19:08  louie
# New baseline for next release.
# 
# Revision 3.2.1.2  89/03/15  13:42:36  louie
# Updated distribution directory.
# 
# Revision 3.2.1.1  89/03/10  11:23:21  louie
# Repair a bunch of typos in the Makefile
# 
# Revision 3.2  89/03/07  18:19:37  louie
# New version of UNIX NTP daemon and software based on the 6 March 1989 
# draft of the new NTP specification.  
# 
# Revision 3.1.1.1  89/02/15  09:09:47  louie
# Applied fixes from bug reports.  Makefile now runs the ntest program to
# verify that certain arithmetic operations are done correctly on the
# host that the code is being compiled on.
# 
# 
#
DESTDIR=
INCPATH=
LDFLAGS=
BINDIR=/usr/local/etc
LINKDIR=/etc
LIBS=-linet

VERS=3.4

#CC=gcc -g -W -Wall
CC=gcc -g -W

INSTALL= install -c

#
# FEATURES include:
#	DEBUG	  - include DEBUG code
#	BROADCAST_NTP - experimental support for broadcast NTP
#	XADJTIME2 - experimental support for second-order clock adjustment
#		    system call.
#	SETTICKADJ - attempt to modify kernel's `tickadj' variable at run time.
#	REFCLOCK  - define if you have a reference clock attached to your
#		    machine.  (untested by UMD)
#	PSTI - define along with REFCLOCK if you have a PSTI clock attached
#		that you'd like to use a a reference clock.
#	XTAL=0 - for line freq clock, or
#	XTAL=1 	 for crystal controlled clock (default)
#	LOG_NTP=foo - to change the syslog facility.  You could specify
#		    something like -DLOG_NTP=LOG_LOCAL3 to log into the
#		    LOG_LOCAL3 syslog facility
#	NOSWAP - allow use of plock() to prevent swapping
#

#FEATURES= -DBROADCAST_NTP -DSETTICKADJ -DDEBUG
#FEATURES= -DSETTICKADJ -DDEBUG -DREFCLOCK -DPSTI
FEATURES= -DSETTICKADJ -DDEBUG -DREFCLOCK -DNO_ASM #no_asm for ISC

# for 4.3 BSD
DEFINES=

# for Sun
#DEFINES= -DSUN_FLT_BUG

# for Ultrix 2.0/2.2
# don't forget to fix the broken definition of inet_addr in netdb.h
# it should be declared as a u_long not a in_addr  (the doc is wrong also)
# VAX_COMPILER_FLT_BUG is defined for pcc which doesn't know how to 
# convert an unsigned long into a float/double
#DEFINES= -DVAX_COMPILER_FLT_BUG -DNOSWAP

#
# for a NeXT system, define these pre-processor symbols.
#DEFINES=-DSUN_FLT_BUG -DGENERIC_UNS_BUG 

CFLAGS= -O ${DEFINES} ${FEATURES} ${INCPATH}
#
# Header files
#
HDRS=	ntp.h patchlevel.h

# Source files
#
NTPDSRC= ntpd.c ntpsubs.c ntp_proto.c ntp_sock.c ntp_adjust.c read_local.c \
	read_psti.c
SRCS=	ntp.c ntpdc.c ${NTPDSRC}

# Object files
#
NTPDOBJ= ntpd.o ntpsubs.o ntp_proto.o ntp_sock.o ntp_adjust.o read_local.o \
	read_psti.o
OBJS=	ntp.o ntpdc.o ${NTPDOBJ}


DIST= README Makefile man ${SRCS} ${HDRS} ntp.conf test.c extract.pl stat.pl
PROGS=	ntp ntpd ntpdc ntest

all:	${PROGS}
	@./ntest

ntp:	ntp.o ntpsubs.o
	${CC} ${LDFLAGS} -o ntp ntp.o ntpsubs.o ${LIBS}

ntpd:	${NTPDOBJ}
	${CC} ${LDFLAGS} -o ntpd ${NTPDOBJ} ${LIBS}

ntpdc: ntpdc.o
	${CC} ${LDFLAGS} -o ntpdc ntpdc.o ${LIBS}

ntest: test.o ntpsubs.o
	${CC} ${LDFLAGS} -o ntest test.o ntpsubs.o ${LIBS}

sock_test: ntp_sock.c
	${CC} ${LDFLAGS} -DTEST -o sock_test ntp_sock.c ${LIBS}

${OBJS}:	ntp.h Makefile
ntpd.o:	patchlevel.h

install: ${DESTDIR}${BINDIR}/ntpd ${DESTDIR}${BINDIR}/ntp ${DESTDIR}${BINDIR}/ntpdc ntest
	@./ntest
#
# If you don't want a symlink to the daemon, comment out the next line
#	make ${MFLAGS} DESTDIR=${DESTDIR} install-link

${DESTDIR}${BINDIR}/ntpd:	ntpd
	${INSTALL}  ntpd ${DESTDIR}${BINDIR}/ntpd

${DESTDIR}${BINDIR}/ntp:	ntp
	${INSTALL}  ntp ${DESTDIR}${BINDIR}/ntp

${DESTDIR}${BINDIR}/ntpdc:	ntpdc
	${INSTALL}  ntpdc ${DESTDIR}${BINDIR}/ntpdc

install-man:
	cd man; make ${MFLAGS} DESTDIR=${DESTDIR} install

install-link:
	rm -f ${BINDIR}/${LINKDIR}/ntpd
	ln -s ${BINDIR}/ntpd ${DESTDIR}/${LINKDIR}/ntpd

print:
	enscript -2r -p - Makefile ${HDRS} ${SRCS} | qpr -q lps40

clean:
	@rm -f *.o *~ core ${PROGS} ntp.tar ntest sock_test
	cd man; make ${MFLAGS} DESTDIR=${DESTDIR} clean

lint:
	lint -bac ${DEFINES} ${NTPDSRC}

dist:	ntp.tar.Z
	mv ntp.tar.Z /usr/ftp/pub/ntp.${VERS}/ntp.tar.Z

test-dist:	ntp.tar.Z
	mv ntp.tar.Z /usr/ftp/pub/ntp.${VERS}/ntp-test.tar.Z

ntp.tar.Z:	${DIST}
	rm -f ntp.tar ntp.tar.Z
	tar cf ntp.tar ${DIST}
	compress  ntp.tar


depend:
	mkdep $(CFLAGS) $(SRCS)

# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY


--------------------------------------------------------------------
/***********************************************************************/
/*	Output from gcc 2.1 using the above makefile compilation args  */
/*      Used -E option.                                                */
/***********************************************************************/

# 1 "ntpsubs.c"

static char *RCSid = "$Source: /usr/users/louie/ntp/RCS/ntpsubs.c,v $ $Revision: 3.4.1.3 $ $Date: 89/05/18 18:33:50 $";


 







































# 1 "/usr/include/stdio.h" 1 3
 
 

 
 
 

#ident	"@(#)stdio.h	2.3 - 88/05/27"













 


typedef struct {

	int	_cnt;
	unsigned char	*_ptr;




	unsigned char	*_base;
	char	_flag;
	char	_file;
} FILE;

 














































extern FILE	_iob[60 ];
extern FILE	*fopen(), *fdopen(), *freopen(), *popen(), *tmpfile();
extern long	ftell();
extern void	rewind(), setbuf();
extern char	*ctermid(), *cuserid(), *fgets(), *gets(), *tempnam(), *tmpnam();
extern int	fclose(), fflush(), fread(), fwrite(), fseek(), fgetc(),
		getw(), pclose(), printf(), fprintf(), sprintf(),
		vprintf(), vfprintf(), vsprintf(), fputc(), putw(),
		puts(), fputs(), scanf(), fscanf(), sscanf(),
		setvbuf(), system(), ungetc();
extern unsigned char *_bufendtab[];






# 45 "ntpsubs.c" 2

# 1 "/usr/include/sys/types.h" 1 3
 
 

 
 
 

 
 

 
 




#ident	"@(#)types.h	2.13 - 89/07/14"


typedef	struct { int r[1]; } *	physadr;

typedef	long		daddr_t;	 
typedef	char *		caddr_t;	 
typedef	unsigned char	unchar;
typedef	unsigned short	ushort;
typedef	unsigned int	uint;
typedef	unsigned long	ulong;
typedef	ushort		ino_t;		 
typedef	short		cnt_t;		 


typedef	long		time_t;		 

typedef	int		label_t[6];
typedef	short		dev_t;		 
typedef	long		off_t;		 
typedef	unsigned long	paddr_t;	 
typedef	int		key_t;		 
typedef	unsigned char	use_t;		 
typedef	short		sysid_t;
typedef	short		index_t;
typedef	short		lock_t;		 


typedef	unsigned int	size_t;		 

typedef ushort		sel_t;		 

# 58 "/usr/include/sys/types.h" 3


 


typedef	char *		faddr_t;	 

# 82 "/usr/include/sys/types.h" 3



# 46 "ntpsubs.c" 2

# 1 "/usr/include/sys/param.h" 1 3
 
 

 
 
 

 
 

 
 


#ident	"@(#)param.h	2.3 - 88/05/27"

 



# 1 "/usr/include/sys/fs/s5param.h" 1
 
 

 
 
 

#ident	"@(#)s5param.h	2.3 - 88/05/27"

 















# 39 "/usr/include/sys/fs/s5param.h"



 













# 69 "/usr/include/sys/fs/s5param.h"


# 84 "/usr/include/sys/fs/s5param.h"



# 21 "/usr/include/sys/param.h" 2 3
















				 

 












 







 




			 
			 



 





 



















 


























 



 

# 47 "ntpsubs.c" 2

# 1 "/usr/include/sys/time.h" 1 3
 








#ident "@(#)time.h	1.1 - 88/04/18"

 



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;	 
};


# 1 "/usr/include/time.h" 1 3
 
 

 
 
 

#ident	"@(#)time.h	2.3 - 88/05/27"
 
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;
};
extern struct tm *gmtime(), *localtime();
extern char *ctime(), *asctime();
int  cftime(),  ascftime();
extern void tzset();
extern long timezone, altzone;
extern int daylight;
extern char *tzname[];
# 58 "/usr/include/sys/time.h" 2 3



# 48 "ntpsubs.c" 2

# 1 "/usr/include/sys/uio.h" 1 3
 









#ident "@(#)uio.h	1.2 - 88/04/07"

struct iovec {
	caddr_t	iov_base;
	int	iov_len;
};

struct uio {
	struct	iovec *uio_iov;
	int	uio_iovcnt;
	off_t	uio_offset;
	int	uio_segflg;
	int	uio_resid;
};

enum	uio_rw { UIO_READ, UIO_WRITE };

 






# 49 "ntpsubs.c" 2

# 1 "/usr/include/sys/socket.h" 1 3
 







# 1 "/usr/include/sys/bsdtypes.h" 1 3

 












 





#ident "@(#)bsdtypes.h	1.6 - 89/05/05"

typedef unsigned char   u_char;
typedef unsigned short  u_short;
typedef unsigned int    u_int;
typedef unsigned long   u_long;



typedef unsigned short  uid_t;
typedef unsigned short  gid_t;


typedef unsigned long   t_time;

 









typedef long	fd_mask;










typedef	struct fd_set {
	fd_mask	fds_bits[(((256 )+(( (sizeof(fd_mask) * 8		)	)-1))/( (sizeof(fd_mask) * 8		)	)) ];
} fd_set;











 










# 9 "/usr/include/sys/socket.h" 2 3


#ident "@(#)socket.h	1.1 - 88/04/06"
 



 








 











 

 











 


struct	linger {
	int	l_onoff;		 
	int	l_linger;		 
};

 




 
























 



struct sockaddr {
	u_short	sa_family;		 
	char	sa_data[14];		 
};

 



struct sockproto {
	u_short	sp_family;		 
	u_short	sp_protocol;		 
};

 






















 




 


struct msghdr {
	caddr_t	msg_name;		 
	int	msg_namelen;		 
	struct	iovec *msg_iov;		 
	int	msg_iovlen;		 
	caddr_t	msg_accrights;		 
	int	msg_accrightslen;
};






# 50 "ntpsubs.c" 2

# 1 "/usr/include/netinet/in.h" 1 3
 












#ident "@(#)in.h	2.1 - 89/04/21"
 




 















 








 






 


struct in_addr {
	u_long s_addr;
};

 



































 


struct sockaddr_in {
	short	sin_family;
	u_short	sin_port;
	struct	in_addr sin_addr;
	char	sin_zero[8];
};


 






# 121 "/usr/include/netinet/in.h" 3

# 184 "/usr/include/netinet/in.h" 3








u_short	ntohs(), htons();
u_long	ntohl(), htonl();


 






 






struct inetopt {
   short	len;		 
   ushort	name;		 
   ushort	level;		 
   short	fill;		 

   union inetoptval {
      short		sval;	 
      int		ival;	 
      long		lval;	 
      caddr_t	       *cval;	 
      unchar		vval[1]; 
   }		value;
};

 

















# 51 "ntpsubs.c" 2

# 1 "/usr/include/arpa/inet.h" 1 3
 







#ident "@(#)inet.h	2.1 - 89/04/21"

 



unsigned long inet_addr();
char	*inet_ntoa();
struct	in_addr inet_makeaddr();
unsigned long inet_network();
# 52 "ntpsubs.c" 2

# 1 "/usr/include/errno.h" 1 3
 
 

 
 
 

#ident	"@(#)errno.h	2.3 - 88/05/27"
 
 



# 1 "/usr/include/sys/errno.h" 1 3
 
 

 
 
 




#ident	"@(#)errno.h	2.11 - 89/06/09"

 


















































 










 























 








 









extern int errno;


# 14 "/usr/include/errno.h" 2 3

extern int errno;
# 53 "ntpsubs.c" 2

# 1 "/usr/include/syslog.h" 1 3
 







 



#ident "@(#)syslog.h	1.1 - 89/04/21"








	 












 














 





 










# 54 "ntpsubs.c" 2


# 1 "ntp.h" 1
 

 
















































































struct intf {
	int fd;
	char *name;
	struct sockaddr_in sin;
	struct sockaddr_in bcast;
	struct sockaddr_in mask;
	int uses;
	int if_flags;
};
extern struct intf addrs[];
extern int nintf;

 




 




















struct list {
	struct ntp_peer *head;
	struct ntp_peer *tail;
	int members;
};






 



































 


















 
















struct l_fixedpt {
	u_long int_part;
	u_long fraction;
};

struct s_fixedpt {
	u_short int_part;
	u_short fraction;
};

 
 




























struct ntpdata {
	u_char status;		 
	u_char stratum;		 
	u_char ppoll;		 
	int precision:8;
	struct s_fixedpt distance;
	struct s_fixedpt dispersion;
	u_long refid;
	struct l_fixedpt reftime;
	struct l_fixedpt org;
	struct l_fixedpt rec;
	struct l_fixedpt xmt;
};
 







 







 











 








 
struct ntp_peer {
	struct ntp_peer *next, *prev;
	struct sockaddr_in src;		 

	int	flags;			 









	int	sock;			 

	u_char	leap;			 
	u_char	hmode;			 
	u_char	stratum;		 
	u_char	ppoll;			 
	u_char	hpoll;			 
	short	precision;		 
	struct	s_fixedpt distance;	 
	struct	s_fixedpt dispersion;	 
	u_long	refid;			 
	struct	l_fixedpt reftime;	 
	struct	l_fixedpt org;		 
	struct	l_fixedpt rec;		 
	struct	l_fixedpt xmt;		 
	u_long	reach;			 
	u_long	valid;			 
	u_long	timer;			 
	long	stopwatch;		 
	 


	struct	filter {
		short samples;		 
		double offset[8 ];
		double delay[8 ];
	} filter;			 

	double	estdelay;		 
	double	estoffset;		 
	double	estdisp;		 

	u_long	pkt_sent;		 
	u_long 	pkt_rcvd;		 
	u_long	pkt_dropped;		 
};

 

struct sysdata {			 
	u_char leap;			 
	u_char stratum;			 
	short precision;		 
	struct s_fixedpt distance;	 
	struct s_fixedpt dispersion;	 
	u_long refid;			 
	struct l_fixedpt reftime;	 
	int hold;			 
	struct ntp_peer *peer;		 
	int maxpeers;			 
	u_char filler;		 
};



 




struct clockinfo {
	u_long net_address;
	u_long my_address;
	u_short port;
	u_short flags;
	u_long pkt_sent;
	u_long pkt_rcvd;
	u_long pkt_dropped;
	u_long timer;
	u_char leap;
	u_char stratum;
	u_char ppoll;
	int precision:8;

	u_char hpoll;
	u_char filler1;
	u_short reach;

	long	estdisp;			 
	long	estdelay;			 
	long	estoffset;			 
	u_long refid;
	struct l_fixedpt reftime;
	struct info_filter {
		short index;
		short filler;
		long offset[8 ];	 
		long delay[8 ];		 
	} info_filter;
};

struct ntpinfo {
	u_char version;
	u_char type;		 
	u_char count;		 
	u_char seq;		 

	u_char npkts;		 
	u_char peers;
	u_char fill3;
	u_char fill4;
};


# 56 "ntpsubs.c" 2


extern int errno;




 


double
ul_fixed_to_double(t)
	struct l_fixedpt *t;
{
	double a, b;
# 85 "ntpsubs.c"

	a = (unsigned long) ntohl(t->fraction);



	a = a / (4.294967296e9); 
	b = (unsigned long) ntohl(t->int_part);




	return (a + b);
}

 



# 136 "ntpsubs.c"


 


double
s_fixed_to_double(t)
	struct s_fixedpt *t;
{
	double a;

	if (ntohs(t->int_part) & 0x8000) {
		a = ntohs(~t->fraction & 0xFFFF);
		a = a / 65536.0;	 
		a +=  ntohs(~t->int_part & 0xFFFF);
		a = -a;
	} else {
		a = ntohs(t->fraction);
		a = a / 65536.0;	 
		a += ntohs(t->int_part);
	}
	return (a);
}

void
double_to_l_fixed(t, value)
	struct l_fixedpt *t;
	double value;
{
	double temp;

	if (value >= (double) 0.0) {
		t->int_part = value;
		temp = value - t->int_part;
		temp *= 4.294967296e9;
		t->fraction = temp;
		t->int_part = htonl(t->int_part);
		t->fraction = htonl(t->fraction);
	} else {
		value = -value;
		t->int_part = value;
		temp = value - t->int_part;
		temp *= 4.294967296e9;
		t->fraction = temp;
		t->int_part = htonl(~t->int_part);
		t->fraction = htonl(~t->fraction);
	}
}

void
double_to_s_fixed(t, value)
	struct s_fixedpt *t;
	double value;
{
	double temp;

	if (value >= (double) 0.0) {
		t->int_part = value;
		temp = value - t->int_part;
		temp *= 65536.0;
		t->fraction = temp;
		t->int_part = htons(t->int_part);
		t->fraction = htons(t->fraction);
	} else {
		value = -value;
		t->int_part = value;
		temp = value - t->int_part;
		temp *= 65536.0;
		t->fraction = temp;
		t->int_part = htons(~t->int_part);
		t->fraction = htons(~t->fraction);
	}
}
 




# 227 "ntpsubs.c"

tstamp(stampp, tvp)
	struct l_fixedpt *stampp;
	struct timeval *tvp;
{
	stampp->int_part = ntohl((u_long) (2208988800	 + tvp->tv_sec));
	stampp->fraction = ntohl((u_long) ((float) tvp->tv_usec * 4294.967295));
}


 




char *
ntoa (in_addr)
struct in_addr in_addr;
{
	static int i = 0;
	static char bufs[8][20];
	unsigned char *p = (unsigned char *) &in_addr.s_addr;

	i = (i + 1) % (sizeof bufs / sizeof bufs[0]);
	sprintf (bufs[i], "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
	return bufs[i];
}

Newsgroups: gnu.gcc.bug