From: roland@gnu.ai.mit.edu (Roland McGrath)
Subject: gcc 1.40 bug
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 7 Apr 1992 20:51:29 GMT

GCC 1.40; i386 running Mach 3.0, OSF singleserver (ernst.gnu.ai.mit.edu).

On the following input, cc1 dies with SIGILL (probably an abort call),
with or without -O, with or without -g ("gcc foobar.c" is enough to do it).


# 1 "../sysdeps/i386/__longjmp.c"
# 1 "../ansidecl.h" 1
# 105 "../ansidecl.h"
# 19 "../sysdeps/i386/__longjmp.c" 2
# 1 "../errno.h" 1
# 1 "../features.h" 1
# 26 "../errno.h" 2
# 1 "../sysdeps/stub/errnos.h" 1
# 29 "../errno.h" 2
extern volatile  int errno;
# 20 "../sysdeps/i386/__longjmp.c" 2
# 1 "./setjmp.h" 1
# 1 "../features.h" 1
# 140 "../features.h"
# 26 "./setjmp.h" 2
# 1 "../sysdeps/i386/jmp_buf.h" 1
typedef struct
  {
    long int __bx, __si, __di;
    	void *  __bp;
    	void *  __sp;
    	void *  __pc;
  } __jmp_buf[1];
# 29 "./setjmp.h" 2
extern __volatile  void 	__longjmp  (	const  __jmp_buf __env, int __val) ;
extern __volatile  void 	longjmp  (	const  __jmp_buf __env, int __val) ;

extern int 	__setjmp  (__jmp_buf __env) ;

# 1 "../signal.h" 1
# 1 "../signal/signal.h" 1
# 1 "../gnu/types.h" 1
# 1 "../posix/gnu/types.h" 1
typedef unsigned char __u_char;
typedef unsigned short __u_short;
typedef unsigned int __u_int;
typedef unsigned long __u_long;
typedef struct { long val[2]; } __quad;
typedef struct { __u_long val[2]; } __u_quad;

typedef short int __dev_t;		 
typedef unsigned int __uid_t;		 
typedef unsigned int __gid_t;		 
typedef unsigned long int __ino_t;	 
typedef unsigned short int __mode_t;	 
typedef unsigned short int __nlink_t;	 
typedef long int __off_t;		 
typedef int __pid_t;			 
typedef int __ssize_t;			 


 
typedef long int __daddr_t;	 
typedef char *__caddr_t;
typedef long int __time_t;
typedef long int __swblk_t;	 


 
typedef struct
  {
    unsigned long int __bits[(256  + ((sizeof(unsigned long int) * 8)  - 1)) / (sizeof(unsigned long int) * 8) ];
  } __fd_set;

 








# 1 "../gnu/types.h" 2

# 30 "../signal/signal.h" 2

# 1 "../gnu/signal.h" 1
# 1 "../signal/gnu/signal.h" 1
 


















 


# 1 "../sysdeps/stub/signum.h" 1
 

















# 54 "../sysdeps/stub/signum.h"



# 23 "../signal/gnu/signal.h" 2







typedef int __sig_atomic_t;

 


 
typedef unsigned long int __sigset_t;








 
typedef void 	(*__sighandler_t)  (int) ;

 
struct __sigaction
  {
     
    __sighandler_t sa_handler;
    
     
    __sigset_t sa_mask;

     
    int sa_flags;
  };

 






# 1 "../gnu/signal.h" 2

# 31 "../signal/signal.h" 2










# 112 "../signal/signal.h"












# 182 "../signal/signal.h"




# 244 "../signal/signal.h"



# 1 "../signal.h" 2

# 57 "./setjmp.h" 2


 
typedef struct
  {
    __jmp_buf __jmpbuf;		 
    __sigset_t  __sigmask;		 
    unsigned int __savemask:1;	 
  } sigjmp_buf[1];

 

extern int 	sigsetjmp  (sigjmp_buf __env, int __savemask) ;

 


extern __volatile  void 	siglongjmp  (	const  sigjmp_buf __env, int __val) ;




extern __volatile  void 	_longjmp  (	const  __jmp_buf __env, int __val) ;
extern int 	_setjmp  (__jmp_buf __env) ;







# 101 "./setjmp.h"


 
typedef	__jmp_buf jmp_buf;




# 21 "../sysdeps/i386/__longjmp.c" 2

# 1 "../stdlib.h" 1
# 1 "../stdlib/stdlib.h" 1
 

















 






# 1 "../features.h" 1
 

















# 140 "../features.h"

# 26 "../stdlib/stdlib.h" 2


 



# 1 "../stddef.h" 1
 

















 





 






























 
typedef unsigned long int size_t;









 







typedef	unsigned char	wchar_t;








 
 

 

 





 












# 32 "../stdlib/stdlib.h" 2



# 1 "../errno.h" 1
 

















 



# 35 "../errno.h"

# 35 "../stdlib/stdlib.h" 2


 

# 1 "../float.h" 1
 

















 

























 
# 1 "../sysdeps/ieee754/fl.h" 1
 





















# 81 "../sysdeps/ieee754/fl.h"


 

 













# 46 "../float.h" 2









# 39 "../stdlib/stdlib.h" 2



 
typedef struct
  {
    int quot;	 
    int rem;	 
  } div_t;

 
typedef struct
  {
    long int quot;	 
    long int rem;	 
  } ldiv_t;


 



 





 




 
extern double 	atof  (	const  char *__nptr) ;
 
extern int 	atoi  (	const  char *__nptr) ;
 
extern long int 	atol  (	const  char *__nptr) ;

 
extern double 	strtod  (	const  char *__nptr, char **__endptr) ;
 
extern long int 	strtol  (	const  char *__nptr, char **__endptr,
			       int __base) ;
 
extern unsigned long int 	strtoul  (	const  char *__nptr,
					 char **__endptr, int __base) ;








 
extern int 	rand  (	void ) ;
 
extern void 	srand  (unsigned int __seed) ;

 



 
extern long int 	__random  (	void ) ;
 
extern void 	__srandom  (unsigned int __seed) ;

 



extern 	void *  	__initstate  (unsigned int __seed, 	void *  __statebuf,
			       size_t __statelen) ;
 

extern 	void *  	__setstate  (	void *  __statebuf) ;


extern long int 	random  (	void ) ;
extern void 	srandom  (unsigned int __seed) ;
extern 	void *  	initstate  (unsigned int __seed, 	void *  __statebuf,
			     size_t __statelen) ;
extern 	void *  	setstate  (	void *  __statebuf) ;















 
extern 	void *  	malloc  (size_t __size) ;
 

extern 	void *  	realloc  (	void *  __ptr, size_t __size) ;
 
extern 	void *  	calloc  (size_t __nmemb, size_t __size) ;
 
extern void 	free  (	void *  __ptr) ;	


 
extern void 	cfree  (	void *  __ptr) ;







# 1 "../alloca.h" 1
# 1 "../stdlib/alloca.h" 1
 



















# 1 "../features.h" 1
 

















# 140 "../features.h"

# 21 "../stdlib/alloca.h" 2



# 1 "../stddef.h" 1
 

















 





 





































# 77 "../stddef.h"




# 97 "../stddef.h"











# 24 "../stdlib/alloca.h" 2


 


 
extern 	void *  	__alloca  (size_t __size) ;
extern 	void *  	alloca  (size_t __size) ;










# 1 "../alloca.h" 2

# 160 "../stdlib/stdlib.h" 2




 
extern 	void *  	valloc  (size_t __size) ;












 
extern __volatile  void 	abort  (	void ) ;


 
extern int 	atexit  (void (*__func)(	void )) ;


 

extern int 	on_exit  (void (*__func)(int __status, 	void *  __arg),
			   	void *  __arg) ;


 


extern __volatile  void 	exit  (int __status) ;


 
extern char *	getenv  (	const  char *__name) ;


 
 

extern int 	putenv  (	const  char *__string) ;


 
extern int 	system  (	const  char *__command) ;


 
typedef int (*__compar_fn_t) (	const  	void * , 	const  	void * );





 

extern 	void *  	bsearch  (	const  	void *  __key, 	const  	void *  __base,
			   size_t __nmemb, size_t __size,
			   __compar_fn_t __compar) ;

 

extern void 	qsort  (	void *  __base, size_t __nmemb, size_t __size,
			  __compar_fn_t __compar) ;




 







 
extern __const  int 	abs  (int __x) ;
extern __const  long int 	labs  (long int __x) ;







 

 
extern __const  div_t 	div  (int __numer, int __denom) ;
extern __const  ldiv_t 	ldiv  (long int __numer, long int __denom) ;


 

extern int 	mblen  (	const  char *__s, size_t __n) ;
 

extern int 	mbtowc  (wchar_t *__pwc, 	const  char *__s, size_t __n) ;
 

extern int 	wctomb  (char *__s, wchar_t __wchar) ;






 
extern size_t 	mbstowcs  (wchar_t *__pwcs, 	const  char *__s, size_t __n) ;
 
extern size_t 	wcstombs  (char *__s, 	const  wchar_t *__pwcs, size_t __n) ;



# 1 "../stdlib.h" 2

# 22 "../sysdeps/i386/__longjmp.c" 2
















register long int ax asm ("ax") ;
register long int bx asm ("bx") ; register long int si asm ("si") ; register long int di asm ("di") ; register long int bp asm ("bp") ; register long int sp asm ("sp")  ;


 

__volatile 
void
__longjmp(
      	const  jmp_buf env 	, 
      int val) 
{
  register 	const  __typeof (env[0]) *e;
  register int v;

  e = env;
  v = val == 0 ? 1 : val;
  asm volatile ("# Tell compiler %0 and %1 are clobbered." :
		"=g" (env), "=g" (val));


  bx = (long int) e->__bx ; si = (long int) e->__si ; di = (long int) e->__di ; bp = (long int) e->__bp ; sp = (long int) e->__sp  ;

  asm volatile ("jmp %*%0" : : "g" (e->__pc), "a" (v));

   
  abort ();
}

Newsgroups: gnu.gcc.bug