[gnu.gcc.bug] gcc 1.34 aborts with fatal signal 11 under -O option on a sun 3/260

asbhogal@UUNET.UU.NET (Amrik Bhogal) (03/09/89)

Hi,

I seem to encounter a fatal (signal 11) error in cc1 when I try to compile the 
program (tmk.E.c) shown below, using the -O option under gcc 1.34. The details 
are shown in the script below, and summarized here:
	- gcc 1.34
	- Program (tmk.E.c) compiled with 'gcc -c -O'
	- gcc installed with md -> m68k.md and tm.h -> tm-sun3.h
	- Sun 3/260 workstation, runing Sun Unix 4.2, release 3.5 (Export)

I hope you can find some time to look at it. 

Thanks.

Amrik.

---
Amrik Bhogal - University of Waterloo, EE grad studies
  {allegra,decvax,utzoo,clyde,uunet}!watmath!watvlsi!asbhogal
  asbhogal@watvlsi.waterloo.{edu,cdn}
  asbhogal@watvlsi.uwaterloo.ca
---

----------------- Script --------------------
Script started on Wed Mar  8 23:56:52 1989
vlsisun3% cd ~/sim
[vlsisun3 : /u/asbhogal/sim]% gcc -v
gcc version 1.34
[vlsisun3 : /u/asbhogal/sim]% gcc -E tmk.c >tmk.E.c
[vlsisun3 : /u/asbhogal/sim]% gcc -c -O tmk.E.c
gcc: Program cc1 got fatal signal 11.
[vlsisun3 : /u/asbhogal/sim]% 
[vlsisun3 : /u/asbhogal/sim]% cd ~/gnu/gcc
[vlsisun3 : /u/asbhogal/gnu/gcc]% cat config.status
Links are now set up for use with a sun3.
[vlsisun3 : /u/asbhogal/gnu/gcc]% 
[vlsisun3 : /u/asbhogal/gnu/gcc]% ls -l tm.h md
lrwxrwxrwx  1 asbhogal        7 Mar  2 11:54 md -> m68k.md
lrwxrwxrwx  1 asbhogal        9 Mar  2 11:54 tm.h -> tm-sun3.h
[vlsisun3 : /u/asbhogal/gnu/gcc]% 
[vlsisun3 : /u/asbhogal/gnu/gcc]% cat /etc/motd
Sun UNIX 4.2 Release 3.5EXPORT (VLSISUN3) #1: Thu Jun 30 15:52:39 EDT 1988

        System Dump Summary:
                LAST LEVEL 0 SAVE       Thu Mar  2 09:35:02 EST 1989
                LAST LEVEL 2 SAVE       Fri Mar  3 08:03:29 EST 1989
                LAST LEVEL 4 SAVE       Wed Mar  8 07:49:44 EST 1989

[vlsisun3 : /u/asbhogal/gnu/gcc]% 
[vlsisun3 : /u/asbhogal/gnu/gcc]% exit
[vlsisun3 : /u/asbhogal/gnu/gcc]% 
script done on Wed Mar  8 23:58:48 1989

---------- Program source code (tmk.E.c) -----------
# 1 "tmk.c"
 




























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




extern	struct	_iobuf {
	int	_cnt;
	unsigned char *_ptr;
	unsigned char *_base;
	int	_bufsiz;
	short	_flag;
	char	_file;		 
} _iob[];




























extern struct _iobuf 	*fopen();
extern struct _iobuf 	*fdopen();
extern struct _iobuf 	*freopen();
extern struct _iobuf 	*popen();
extern struct _iobuf 	*tmpfile();
extern long	ftell();
extern char	*fgets();
extern char	*gets();



extern char	*ctermid();
extern char	*cuserid();
extern char	*tempnam();
extern char	*tmpnam();






# 30 "tmk.c"

# 1 "/usr/include/string.h"
 

extern char
	*strcpy(),
	*strncpy(),
	*strcat(),
	*strncat(),
	*strchr(),
	*strrchr(),
	*strpbrk(),
	*strtok();
extern int
	strcmp(),
	strncmp(),
	strlen(),
	strspn(),
	strcspn();
# 31 "tmk.c"

# 1 "sim.h"
 















































 


struct ut_t {			 
    char	pl;		 
    unsigned	model:16;	 
    unsigned	watchpt:1;	 
    unsigned	breakpt:1;	 
    unsigned	tracept:1;	 
    unsigned	usechd:1;	 

    long	name_ptr;	 

    unsigned	nins:16;	 
    unsigned	    :16;	 

    int		iptr;		 
    int		output;		 
    int		th1, th2, th3;	 
};

struct utinpd_t {		 
    int		index;		 
    int		weight;		 
};


 


struct nfhdr_t {		 
    int  	caps_mode;	 
    int  	nunits;		 
    int  	npins;		 
    int  	npouts;		 
    int  	iods;		 
    int  	chds;		 
    int  	ncla;		 
};

 


struct models_t {
    char 	name[6];	 
    int  	(*fn)();	 
};

 




struct class_attr_t {
    int		class;		 
    int		nattrs;		 
};

# 32 "tmk.c"



















struct 	ut_t 	*ut;
int  		ut_limit = 0;

struct utinpd_t *utinpd;
int 		utinpd_limit = 0;

char 		*utchd;
int 		utchd_limit = 0;

struct	class_attr_t	*class_attr;
int		class_attr_limit = 0;

struct _iobuf  		*net_fp;
struct _iobuf  		*ic_fp;

char		curr_unit_name[120	];

struct utinpd_t	temp_inpd[512 ];

extern int 	hinit(), hadd(), hfind();
extern		hget_name(), hend(), hprint();

extern int 	error_exit(), str2int(), print_ut(), print_ic(), dump();

extern struct	models_t model[];
extern int	model_limit;

main(argc, argv)
int	argc;
char	*argv[];
{
    register struct ut_t *ptr;

    char	line[256];
    char	*np;
    char	net_file[80], hash_file[80], names_file[80];

    struct _iobuf 	*names_fp;

    char	th3str[128];
    char	arrow[2];

    struct 	nfhdr_t net_header;
    long	name_ptr;
    int 	level, ut_ix, iptr;

    int		rc, end;
    int 	i, j, len, temp;
    int 	ni, no;
    int 	inpn, in_ix, wt;


     
    if( argc < 3 )
	error_exit( "Usage: makenet <file> <# units> {debug}", 0  );

    sprintf(net_file, "%s%s", argv[1], ".net"  );
    sprintf(hash_file, "%s%s", argv[1], ".hash"  );
    sprintf(names_file, "%s%s", argv[1], ".names"  );

    if( (ic_fp = fopen(argv[1], "r")) == 0  )
	error_exit( "Unable to open interconnect file", argv[1] );

     
    if( (names_fp = fopen(names_file, "r")) == 0  )
	error_exit( "Unable to open .names file", names_file );

    if( (net_fp = fopen(net_file, "w")) == 0  )
	error_exit( "Unable to create .net file", net_file );

     
    temp = atoi( argv[2] );
    if( !hinit( hash_file, temp*3-1 ) )
	error_exit( "Unable to create .hash file", hash_file );

     
    ut_limit = 0;
    while( fgets(line, sizeof(line), names_fp) != 0  ) {
	line[ strlen(line) - 1] = '\0';		 
	if( (np = strchr(line,  ':')) != 0  )
	    (void) hadd( np+1, ut_limit++ );
	else
	    error_exit( "Level:Name incorrect in .names file for", line );
    }
    fclose( names_fp );

    if( temp != ut_limit )
	printf( "** Warning: #units mismatch between wc and .names **\n" );

     
    if( (ut = (struct ut_t *) calloc( ut_limit, sizeof(struct ut_t) )) == 0  )
	error_exit( "Unable to allocate ut table", 0  );


     
    if( (utinpd = (struct utinpd_t *)calloc( 40000 ,
					    sizeof(struct utinpd_t) )) == 0  )
        error_exit( "Unable to allocate utinpd", 0  );

    if( (utchd = (char *) malloc( 	10000 )) == 0  )
	error_exit( "Unable to allocate char data space", 0  );


     
    if( (class_attr = (struct class_attr_t *) calloc( 	512 ,
		       sizeof(struct class_attr_t) )) == 0  )
	error_exit( "Unable to allocate class_attr table", 0  );

     
    while( 1 ) {
	rc = get_name(curr_unit_name,sizeof(curr_unit_name), 
			   &name_ptr, &level, &ut_ix);
	if( rc == (-1)  || rc == 	-2		 )
	    break;		 
	else if( rc == 0 )
	    error_exit( "Unable to re-locate", curr_unit_name );

	ptr = &ut[ut_ix];	 

	ptr -> name_ptr = name_ptr;
	ptr -> pl = level;
	ptr -> watchpt = ptr -> breakpt = ptr -> tracept = 0;
	ptr -> output = 0;	 

	if( (rc = get_model( &temp )) == (-1)  )
	    error_exit( "Premature eof at model for", curr_unit_name );
	else if( rc == 0 ) 
	    error_exit( "Incorrect model for unit", curr_unit_name );
	ptr -> model = temp;

	if( get_int(&(ptr -> th1), " ,\t\n" ) == (-1)  )
	    error_exit( "Premature eof at th1 for", curr_unit_name );
	if( get_int(&(ptr -> th2), " ,\t\n" ) == (-1)  )
	    error_exit( "Premature eof at th2 for", curr_unit_name );

	if( get_token( th3str, sizeof(th3str), " \t\n") == (-1)  )
	    error_exit( "Premature eof at th3 for", curr_unit_name );
	if( *th3str == '"' ) {	 
	    len = strlen( th3str ) - 2;		 
	    th3str[len+1] = '\0';		 
	    if( len + utchd_limit >= 	10000  )
		error_exit( "No char data space left at", curr_unit_name );
	    ptr -> usechd = 1;
	    ptr -> th3 = utchd_limit;
	    strcpy( &utchd[utchd_limit], th3str+1 ); 	 
	    utchd_limit += len + 1;
	}
	else {
	   ptr -> usechd = 0;
	   str2int( th3str, &(ptr -> th3) );
	}

	if( ptr -> pl == 0	 )	 



	    ptr -> output = (model[ptr -> model].fn)( 0, 0 , 
			    ptr -> th1, ptr -> th2, ptr -> th3);

	if( (rc = skip_lws()) == '<' ) {  	 
	    if( (rc = get_token( arrow, sizeof(arrow), "-" )) == (-1)  )
		error_exit( "Premature eof at <- for", curr_unit_name );

	     
	    ni = 0;
	    while( get_irec( &in_ix, &inpn, &wt, &end ) ) {
		if( inpn < 512  ) {
		    temp_inpd[inpn].index = in_ix;
		    temp_inpd[inpn].weight = wt;
		}
		else
		    error_exit( "Too many inputs for", curr_unit_name );
		++ni;
		if( end )
		    break;
	    }
	    ptr -> nins = ni;
	    if( ni > 0 ) {
		if( utinpd_limit + ni > 40000  )
		    error_exit( "Out of input data space for", curr_unit_name );
		ptr -> iptr = utinpd_limit;
		memcpy( (char *)&utinpd[utinpd_limit], (char *)temp_inpd, 
			ni*sizeof(struct utinpd_t));
		utinpd_limit += ni;
	    }
	    else
		ptr -> iptr = 0;

	}
	else {
	    ptr -> nins = 0;
	    ptr -> iptr = 0;
	}
    }  


 
    if( rc == 	-2		 )
	process_init_cmds();

 
    fclose( ic_fp );

 
    for(ni = 0, ptr=ut; ni<ut_limit && ptr -> pl == 0	; ++ni,++ptr);

 
    for( no = 0, ptr = &ut[ut_limit-1], i=ut_limit-1; i>=0; --i, --ptr ) {
	hget_name( ptr -> name_ptr, curr_unit_name, sizeof(curr_unit_name) );
	if( *curr_unit_name == '$' )
	    ++no;
	else
	    break;
    }

 
    net_header.caps_mode = hfind( "$cs_empty", &name_ptr, &ut_ix );
    net_header.nunits = ut_limit-(ni+no);	 
    net_header.npins = ni;
    net_header.npouts = no;
    net_header.iods = utinpd_limit;
    net_header.chds = utchd_limit;
    net_header.ncla = class_attr_limit;
    fwrite( (char *) &net_header, sizeof(net_header), 1, net_fp );

 
    fwrite( (char *) ut, sizeof(struct ut_t), ut_limit, net_fp );

 
    fwrite( (char *) utinpd, sizeof(struct utinpd_t), utinpd_limit, net_fp );

 
    if( utchd_limit > 0 )
	fwrite( utchd, 1, utchd_limit, net_fp );

 
    if( class_attr_limit > 0 )
	fwrite( (char *) class_attr, sizeof( struct class_attr_t),
		class_attr_limit, net_fp );

 
    fclose( net_fp );

    printf( "Net generation complete for \"%s\" ($I:%d $O:%d U:%d Total:%d)\n",
	    argv[1], net_header.npins, net_header.npouts, net_header.nunits,
	    ut_limit );


    if( argc > 3 ) {
	printf( "\n------------ Unit table ---------\n" );
	dump( print_ut );
    }

    hend();
    return( 1 );
}

asbhogal@watvlsi.waterloo.edu (Amrik Bhogal) (03/11/89)

Hi,

I seem to encounter a fatal (signal 11) error in cc1 when I try to compile the 
program (tmk.E.c) shown below, using the -O option under gcc 1.34. The details 
are shown in the script below, and summarized here:
	- gcc 1.34
	- Program (tmk.E.c) compiled with 'gcc -c -O'
	- gcc installed with md -> m68k.md and tm.h -> tm-sun3.h
	- Sun 3/260 workstation, runing Sun Unix 4.2, release 3.5 (Export)

I hope you can find some time to look at it. 

Thanks.

Amrik.
---
Amrik Bhogal - University of Waterloo, EE grad studies
  {allegra,decvax,utzoo,clyde,uunet}!watmath!watvlsi!asbhogal
  asbhogal@watvlsi.waterloo.{edu,cdn}
  asbhogal@watvlsi.uwaterloo.ca
---


----------------- Script --------------------
Script started on Wed Mar  8 23:56:52 1989
vlsisun3% cd ~/sim
[vlsisun3 : /u/asbhogal/sim]% gcc -v
gcc version 1.34
[vlsisun3 : /u/asbhogal/sim]% gcc -E tmk.c >tmk.E.c
[vlsisun3 : /u/asbhogal/sim]% gcc -c -O tmk.E.c
gcc: Program cc1 got fatal signal 11.
[vlsisun3 : /u/asbhogal/sim]% 
[vlsisun3 : /u/asbhogal/sim]% cd ~/gnu/gcc
[vlsisun3 : /u/asbhogal/gnu/gcc]% cat config.status
Links are now set up for use with a sun3.
[vlsisun3 : /u/asbhogal/gnu/gcc]% 
[vlsisun3 : /u/asbhogal/gnu/gcc]% ls -l tm.h md
lrwxrwxrwx  1 asbhogal        7 Mar  2 11:54 md -> m68k.md
lrwxrwxrwx  1 asbhogal        9 Mar  2 11:54 tm.h -> tm-sun3.h
[vlsisun3 : /u/asbhogal/gnu/gcc]% 
[vlsisun3 : /u/asbhogal/gnu/gcc]% cat /etc/motd
Sun UNIX 4.2 Release 3.5EXPORT (VLSISUN3) #1: Thu Jun 30 15:52:39 EDT 1988

        System Dump Summary:
                LAST LEVEL 0 SAVE       Thu Mar  2 09:35:02 EST 1989
                LAST LEVEL 2 SAVE       Fri Mar  3 08:03:29 EST 1989
                LAST LEVEL 4 SAVE       Wed Mar  8 07:49:44 EST 1989

[vlsisun3 : /u/asbhogal/gnu/gcc]% 
[vlsisun3 : /u/asbhogal/gnu/gcc]% exit
[vlsisun3 : /u/asbhogal/gnu/gcc]% 
script done on Wed Mar  8 23:58:48 1989

---------- Program source code (tmk.E.c) -----------
# 1 "tmk.c"
 




























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




extern	struct	_iobuf {
	int	_cnt;
	unsigned char *_ptr;
	unsigned char *_base;
	int	_bufsiz;
	short	_flag;
	char	_file;		 
} _iob[];




























extern struct _iobuf 	*fopen();
extern struct _iobuf 	*fdopen();
extern struct _iobuf 	*freopen();
extern struct _iobuf 	*popen();
extern struct _iobuf 	*tmpfile();
extern long	ftell();
extern char	*fgets();
extern char	*gets();



extern char	*ctermid();
extern char	*cuserid();
extern char	*tempnam();
extern char	*tmpnam();






# 30 "tmk.c"

# 1 "/usr/include/string.h"
 

extern char
	*strcpy(),
	*strncpy(),
	*strcat(),
	*strncat(),
	*strchr(),
	*strrchr(),
	*strpbrk(),
	*strtok();
extern int
	strcmp(),
	strncmp(),
	strlen(),
	strspn(),
	strcspn();
# 31 "tmk.c"

# 1 "sim.h"
 















































 


struct ut_t {			 
    char	pl;		 
    unsigned	model:16;	 
    unsigned	watchpt:1;	 
    unsigned	breakpt:1;	 
    unsigned	tracept:1;	 
    unsigned	usechd:1;	 

    long	name_ptr;	 

    unsigned	nins:16;	 
    unsigned	    :16;	 

    int		iptr;		 
    int		output;		 
    int		th1, th2, th3;	 
};

struct utinpd_t {		 
    int		index;		 
    int		weight;		 
};


 


struct nfhdr_t {		 
    int  	caps_mode;	 
    int  	nunits;		 
    int  	npins;		 
    int  	npouts;		 
    int  	iods;		 
    int  	chds;		 
    int  	ncla;		 
};

 


struct models_t {
    char 	name[6];	 
    int  	(*fn)();	 
};

 




struct class_attr_t {
    int		class;		 
    int		nattrs;		 
};

# 32 "tmk.c"



















struct 	ut_t 	*ut;
int  		ut_limit = 0;

struct utinpd_t *utinpd;
int 		utinpd_limit = 0;

char 		*utchd;
int 		utchd_limit = 0;

struct	class_attr_t	*class_attr;
int		class_attr_limit = 0;

struct _iobuf  		*net_fp;
struct _iobuf  		*ic_fp;

char		curr_unit_name[120	];

struct utinpd_t	temp_inpd[512 ];

extern int 	hinit(), hadd(), hfind();
extern		hget_name(), hend(), hprint();

extern int 	error_exit(), str2int(), print_ut(), print_ic(), dump();

extern struct	models_t model[];
extern int	model_limit;

main(argc, argv)
int	argc;
char	*argv[];
{
    register struct ut_t *ptr;

    char	line[256];
    char	*np;
    char	net_file[80], hash_file[80], names_file[80];

    struct _iobuf 	*names_fp;

    char	th3str[128];
    char	arrow[2];

    struct 	nfhdr_t net_header;
    long	name_ptr;
    int 	level, ut_ix, iptr;

    int		rc, end;
    int 	i, j, len, temp;
    int 	ni, no;
    int 	inpn, in_ix, wt;


     
    if( argc < 3 )
	error_exit( "Usage: makenet <file> <# units> {debug}", 0  );

    sprintf(net_file, "%s%s", argv[1], ".net"  );
    sprintf(hash_file, "%s%s", argv[1], ".hash"  );
    sprintf(names_file, "%s%s", argv[1], ".names"  );

    if( (ic_fp = fopen(argv[1], "r")) == 0  )
	error_exit( "Unable to open interconnect file", argv[1] );

     
    if( (names_fp = fopen(names_file, "r")) == 0  )
	error_exit( "Unable to open .names file", names_file );

    if( (net_fp = fopen(net_file, "w")) == 0  )
	error_exit( "Unable to create .net file", net_file );

     
    temp = atoi( argv[2] );
    if( !hinit( hash_file, temp*3-1 ) )
	error_exit( "Unable to create .hash file", hash_file );

     
    ut_limit = 0;
    while( fgets(line, sizeof(line), names_fp) != 0  ) {
	line[ strlen(line) - 1] = '\0';		 
	if( (np = strchr(line,  ':')) != 0  )
	    (void) hadd( np+1, ut_limit++ );
	else
	    error_exit( "Level:Name incorrect in .names file for", line );
    }
    fclose( names_fp );

    if( temp != ut_limit )
	printf( "** Warning: #units mismatch between wc and .names **\n" );

     
    if( (ut = (struct ut_t *) calloc( ut_limit, sizeof(struct ut_t) )) == 0  )
	error_exit( "Unable to allocate ut table", 0  );


     
    if( (utinpd = (struct utinpd_t *)calloc( 40000 ,
					    sizeof(struct utinpd_t) )) == 0  )
        error_exit( "Unable to allocate utinpd", 0  );

    if( (utchd = (char *) malloc( 	10000 )) == 0  )
	error_exit( "Unable to allocate char data space", 0  );


     
    if( (class_attr = (struct class_attr_t *) calloc( 	512 ,
		       sizeof(struct class_attr_t) )) == 0  )
	error_exit( "Unable to allocate class_attr table", 0  );

     
    while( 1 ) {
	rc = get_name(curr_unit_name,sizeof(curr_unit_name), 
			   &name_ptr, &level, &ut_ix);
	if( rc == (-1)  || rc == 	-2		 )
	    break;		 
	else if( rc == 0 )
	    error_exit( "Unable to re-locate", curr_unit_name );

	ptr = &ut[ut_ix];	 

	ptr -> name_ptr = name_ptr;
	ptr -> pl = level;
	ptr -> watchpt = ptr -> breakpt = ptr -> tracept = 0;
	ptr -> output = 0;	 

	if( (rc = get_model( &temp )) == (-1)  )
	    error_exit( "Premature eof at model for", curr_unit_name );
	else if( rc == 0 ) 
	    error_exit( "Incorrect model for unit", curr_unit_name );
	ptr -> model = temp;

	if( get_int(&(ptr -> th1), " ,\t\n" ) == (-1)  )
	    error_exit( "Premature eof at th1 for", curr_unit_name );
	if( get_int(&(ptr -> th2), " ,\t\n" ) == (-1)  )
	    error_exit( "Premature eof at th2 for", curr_unit_name );

	if( get_token( th3str, sizeof(th3str), " \t\n") == (-1)  )
	    error_exit( "Premature eof at th3 for", curr_unit_name );
	if( *th3str == '"' ) {	 
	    len = strlen( th3str ) - 2;		 
	    th3str[len+1] = '\0';		 
	    if( len + utchd_limit >= 	10000  )
		error_exit( "No char data space left at", curr_unit_name );
	    ptr -> usechd = 1;
	    ptr -> th3 = utchd_limit;
	    strcpy( &utchd[utchd_limit], th3str+1 ); 	 
	    utchd_limit += len + 1;
	}
	else {
	   ptr -> usechd = 0;
	   str2int( th3str, &(ptr -> th3) );
	}

	if( ptr -> pl == 0	 )	 



	    ptr -> output = (model[ptr -> model].fn)( 0, 0 , 
			    ptr -> th1, ptr -> th2, ptr -> th3);

	if( (rc = skip_lws()) == '<' ) {  	 
	    if( (rc = get_token( arrow, sizeof(arrow), "-" )) == (-1)  )
		error_exit( "Premature eof at <- for", curr_unit_name );

	     
	    ni = 0;
	    while( get_irec( &in_ix, &inpn, &wt, &end ) ) {
		if( inpn < 512  ) {
		    temp_inpd[inpn].index = in_ix;
		    temp_inpd[inpn].weight = wt;
		}
		else
		    error_exit( "Too many inputs for", curr_unit_name );
		++ni;
		if( end )
		    break;
	    }
	    ptr -> nins = ni;
	    if( ni > 0 ) {
		if( utinpd_limit + ni > 40000  )
		    error_exit( "Out of input data space for", curr_unit_name );
		ptr -> iptr = utinpd_limit;
		memcpy( (char *)&utinpd[utinpd_limit], (char *)temp_inpd, 
			ni*sizeof(struct utinpd_t));
		utinpd_limit += ni;
	    }
	    else
		ptr -> iptr = 0;

	}
	else {
	    ptr -> nins = 0;
	    ptr -> iptr = 0;
	}
    }  


 
    if( rc == 	-2		 )
	process_init_cmds();

 
    fclose( ic_fp );

 
    for(ni = 0, ptr=ut; ni<ut_limit && ptr -> pl == 0	; ++ni,++ptr);

 
    for( no = 0, ptr = &ut[ut_limit-1], i=ut_limit-1; i>=0; --i, --ptr ) {
	hget_name( ptr -> name_ptr, curr_unit_name, sizeof(curr_unit_name) );
	if( *curr_unit_name == '$' )
	    ++no;
	else
	    break;
    }

 
    net_header.caps_mode = hfind( "$cs_empty", &name_ptr, &ut_ix );
    net_header.nunits = ut_limit-(ni+no);	 
    net_header.npins = ni;
    net_header.npouts = no;
    net_header.iods = utinpd_limit;
    net_header.chds = utchd_limit;
    net_header.ncla = class_attr_limit;
    fwrite( (char *) &net_header, sizeof(net_header), 1, net_fp );

 
    fwrite( (char *) ut, sizeof(struct ut_t), ut_limit, net_fp );

 
    fwrite( (char *) utinpd, sizeof(struct utinpd_t), utinpd_limit, net_fp );

 
    if( utchd_limit > 0 )
	fwrite( utchd, 1, utchd_limit, net_fp );

 
    if( class_attr_limit > 0 )
	fwrite( (char *) class_attr, sizeof( struct class_attr_t),
		class_attr_limit, net_fp );

 
    fclose( net_fp );

    printf( "Net generation complete for \"%s\" ($I:%d $O:%d U:%d Total:%d)\n",
	    argv[1], net_header.npins, net_header.npouts, net_header.nunits,
	    ut_limit );


    if( argc > 3 ) {
	printf( "\n------------ Unit table ---------\n" );
	dump( print_ut );
    }

    hend();
    return( 1 );
}