From: partain@dcs.gla.ac.UK (partain)
Subject: gcc 2.2.2, Sun4, crashes (global registers probably)
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 10 Sep 1992 16:34:02 GMT

The attached program is almost certainly bogus, but it shouldn't crash
cc1.  I have applied one global-register-related fix (re crash "#541")
to our GCC.

Will

% gcc -v -c -O2 gcc-bug3.c
Reading specs from /usr/local/gnu/lib/gcc-lib/sun4/2.2.2/specs
gcc version 2.2.2
 /usr/local/gnu/lib/gcc-lib/sun4/2.2.2/cpp -lang-c -v -undef -D__GNUC__=2 -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix -D__OPTIMIZE__ gcc-bug3.c /usr/tmp/cca12681.i
GNU CPP version 2.2.2 (sparc)
 /usr/local/gnu/lib/gcc-lib/sun4/2.2.2/cc1 /usr/tmp/cca12681.i -quiet -dumpbase gcc-bug3.c -O2 -version -o /usr/tmp/cca12681.s
GNU C version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
gcc-bug3.c: In function `checkAStack':
gcc-bug3.c:604: internal error--unrecognizable insn:
(insn 313 302 304 (set (const:SI (plus:SI (symbol_ref:SI ("dualmodeInfo"))
               (const_int 12)))
       (reg:SI 3)) -1 (insn_list 302 (nil))
   (nil))
gcc: Internal compiler error: program cc1 got fatal signal 6

#!/bin/sh
# This is a shell archive (produced by shar 3.49)
# To extract the files from this archive, save it to a file, remove
# everything above the "!/bin/sh" line above, and type "sh file_name".
#
# made 09/10/1992 16:28 UTC by partain@tegua
# Source directory /tmp_mnt/users/fp/partain
#
# existing files will NOT be overwritten unless -c is specified
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#  21152 -rw-rw-r-- gcc-bug3.c
#
# ============= gcc-bug3.c ==============
if test -f 'gcc-bug3.c' -a X"$1" != X"-c"; then
	echo 'x - skipping gcc-bug3.c (File already exists)'
else
echo 'x - extracting gcc-bug3.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'gcc-bug3.c' &&
extern end;
extern	struct	_iobuf {
X	int	_cnt;
X	unsigned char *_ptr;
X	unsigned char *_base;
X	int	_bufsiz;
X	short	_flag;
X	char	_file;		 
} _iob[];
X		
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	*sprintf();
extern char	*ctermid();
extern char	*cuserid();
extern char	*tempnam();
extern char	*tmpnam();
extern int fprintf (struct _iobuf  *, const char*, ...) ;
extern int printf  (const char*, ...) ;
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;	 
extern unsigned int _mb_cur_max;
extern void	abort( );
extern int	abs( );
extern double	atof( );
extern int	atoi( );
extern long int	atol( );
extern char *	bsearch( 
);
extern void *	calloc( );
extern void	exit( );
extern void	free( );
extern char *	getenv( );
extern void *	malloc( );
extern int	qsort( 
);
extern int	rand( );
extern void *	realloc( );
extern int	srand( );
extern int    mbtowc( );
extern int    wctomb( );
extern size_t mbstowcs( );
extern size_t wcstombs( );
extern char *	strcat( );
extern char *	strchr( );
extern int	strcmp( );
extern char *	strcpy( );
extern size_t	strcspn( );
extern char *	strdup( );
extern size_t	strlen( );
extern char *	strncat( );
extern int	strncmp( );
extern char *	strncpy( );
extern char *	strpbrk( );
extern char *	strrchr( );
extern size_t	strspn( );
extern char *	strstr( );
extern char *	strtok( );
typedef unsigned long   StgWord;         
typedef StgWord        *StgPtr;          
typedef StgPtr         *StgPtrPtr;       
typedef long            StgInt;
typedef long            StgInteger;  
typedef unsigned char   StgChar;
typedef char           *StgStringPtr;
typedef float           StgFloat;
typedef double          StgDouble;
typedef long            StgTag;
typedef StgWord         StgInfoEntry;
typedef StgWord        *StgInfoPtr;
typedef void   *(*(*StgFunPtr)(void ))(void );
typedef StgFunPtr (StgFun)(void );
typedef StgFunPtr sfp;  
typedef struct __ud
X  { unsigned int dhi;
X    unsigned int dlo;
X  } unpacked_double;
typedef union __dt
X  { double d;
X    unpacked_double du;
X  } double_thing;
typedef unsigned int unpacked_float;
typedef union __ft
X  { float f;
X    unpacked_float fu;
X  } float_thing;
register StgPtrPtr SpA __asm__("%l0"); extern StgPtrPtr SpA_SAVE ;      
register StgPtr SpB __asm__("%l1"); extern StgPtr SpB_SAVE ;         
register StgPtr Hp __asm__("%l2"); extern StgPtr Hp_SAVE ;          
register StgPtr Node __asm__("%l3"); extern StgPtr Node_SAVE ;        
register StgPtrPtr SuA __asm__("%l4"); extern StgPtrPtr SuA_SAVE ;      
register StgPtr SuB __asm__("%l5"); extern StgPtr SuB_SAVE ;         
register StgPtr RetVecReg __asm__("%i0"); extern StgPtr RetVecReg_SAVE ;           
register StgPtr StdUpdRetVector __asm__("%i1"); extern StgPtr StdUpdRetVector_SAVE ;     
register StgPtr HpLim __asm__("%i2"); extern StgPtr HpLim_SAVE ;               
register StgWord Ret1 __asm__("%i3"); extern StgWord Ret1_SAVE ;               
register StgPtr STK_STUB __asm__("%i4"); extern StgPtr STK_STUB_SAVE ;            
register StgWord Ret2 __asm__("%i5"); extern StgWord Ret2_SAVE ;               
extern StgWord Ret3; extern StgWord Ret3_SAVE ;                 
extern StgPtr UpdReg; extern StgPtr UpdReg_SAVE ;                
extern StgWord Ret4; extern StgWord Ret4_SAVE ; 
extern StgWord Ret5; extern StgWord Ret5_SAVE ; 
extern StgWord Ret6; extern StgWord Ret6_SAVE ; 
extern StgInt TagReg; extern StgInt TagReg_SAVE ; 
extern StgWord Ret7; extern StgWord Ret7_SAVE ; ;
extern StgWord Ret8; extern StgWord Ret8_SAVE ; ;
extern StgFloat RetFloat1; extern StgFloat RetFloat1_SAVE ; ;
extern StgFloat RetFloat2; extern StgFloat RetFloat2_SAVE ; ;
extern StgFloat RetFloat3; extern StgFloat RetFloat3_SAVE ; ;
extern StgFloat RetFloat4; extern StgFloat RetFloat4_SAVE ; ;
extern StgFloat RetFloat5; extern StgFloat RetFloat5_SAVE ; ;
extern StgFloat RetFloat6; extern StgFloat RetFloat6_SAVE ; ;
extern StgFloat RetFloat7; extern StgFloat RetFloat7_SAVE ; ;
extern StgFloat RetFloat8; extern StgFloat RetFloat8_SAVE ; ;
extern StgDouble RetDouble1; extern StgDouble RetDouble1_SAVE ; ;
extern StgDouble RetDouble2; extern StgDouble RetDouble2_SAVE ; ;
extern StgDouble RetDouble3; extern StgDouble RetDouble3_SAVE ; ;
extern StgDouble RetDouble4; extern StgDouble RetDouble4_SAVE ; ;
extern int ALLOC_HEAP_ctr;
extern int ALLOC_HEAP_tot;
extern StgPtrPtr max_SpA;
extern StgPtr    max_SpB;
extern int A_STK_STUB_ctr;
extern int A_STK_REUSE_ctr;
extern int B_STK_REUSE_ctr;
extern int ALLOC_FUN_ctr;
extern int ALLOC_FUN_adm;
extern int ALLOC_FUN_gds;
extern int ALLOC_FUN_slp;
extern int ALLOC_FUN_hst[5];
extern int ALLOC_THK_ctr;
extern int ALLOC_THK_adm;
extern int ALLOC_THK_gds;
extern int ALLOC_THK_slp;
extern int ALLOC_THK_hst[5];
extern int ALLOC_CON_ctr;
extern int ALLOC_CON_adm;
extern int ALLOC_CON_gds;
extern int ALLOC_CON_slp;
extern int ALLOC_CON_hst[5];
extern int ALLOC_TUP_ctr;
extern int ALLOC_TUP_adm;
extern int ALLOC_TUP_gds;
extern int ALLOC_TUP_slp;
extern int ALLOC_TUP_hst[5];
extern int ALLOC_BH_ctr;
extern int ALLOC_BH_adm;
extern int ALLOC_BH_gds;
extern int ALLOC_BH_slp;
extern int ALLOC_BH_hst[5];
extern int ALLOC_PAP_ctr;
extern int ALLOC_PAP_adm;
extern int ALLOC_PAP_gds;
extern int ALLOC_PAP_slp;
extern int ALLOC_PAP_hst[5];
extern int ALLOC_UPD_CON_ctr;
extern int ALLOC_UPD_CON_adm;
extern int ALLOC_UPD_CON_gds;
extern int ALLOC_UPD_CON_slp;
extern int ALLOC_UPD_CON_hst[5];
extern int ALLOC_UPD_PAP_ctr;
extern int ALLOC_UPD_PAP_adm;
extern int ALLOC_UPD_PAP_gds;
extern int ALLOC_UPD_PAP_slp;
extern int ALLOC_UPD_PAP_hst[5];
extern int ENT_VIA_NODE_ctr;
extern int ENT_CON_ctr;
extern int ENT_FUN_STD_ctr;
extern int ENT_FUN_DIRECT_ctr;
extern int ENT_IND_ctr;
extern int ENT_PAP_ctr;
extern int ENT_THK_ctr;
extern int RET_NEW_IN_HEAP_ctr;
extern int RET_NEW_IN_REGS_ctr;
extern int RET_OLD_IN_HEAP_ctr;
extern int RET_OLD_IN_REGS_ctr;
extern int VEC_RETURN_ctr;
extern int ReturnInRegsNodeValid;  
extern int UPDF_OMITTED_ctr;
extern int UPDF_STD_PUSHED_ctr;
extern int UPDF_CON_PUSHED_ctr;
extern int UPDF_HOLE_PUSHED_ctr;
extern int UPDF_RCC_PUSHED_ctr;
extern int UPDF_RCC_OMITTED_ctr;
extern int UPD_AGAIN_ctr;
extern int UPD_CON_W_NODE_ctr;
extern int UPD_CON_IN_PLACE_ctr;
extern int UPD_PAP_IN_PLACE_ctr;
extern int UPD_CON_IN_NEW_ctr;
extern int UPD_PAP_IN_NEW_ctr;
extern int UPD_OLD_GEN_ctr;
extern int UPD_NEW_GEN_ctr;
extern int UPD_IN_PLACE_COPY_ctr;  
typedef unsigned char uchar;
typedef unsigned long hash_t;
extern hash_t hash_str (char *str) ;
extern hash_t hash_fixed (uchar *data, int len) ;
StgFloat	encodeFloatZh (StgInteger, StgInt) ;
StgInteger	floatSignificandZh (StgFloat) ;
StgInt		floatExponentZh (StgFloat) ;
StgDouble	encodeDoubleZh (StgInteger, StgInt) ;
StgInteger	doubleSignificandZh (StgDouble) ;
StgInt		doubleExponentZh (StgDouble) ;
extern __inline__
void
ASSIGN_DBL(p_dest, src)
X  unsigned int p_dest[];
X  double src;
{
X    double_thing y;
X    y.d = src;
X    p_dest[0] = y.du.dhi;
X    p_dest[1] = y.du.dlo;
}
extern __inline__
double
PK_DBL(p_src)
X  unsigned int p_src[];
{
X    double_thing y;
X    y.du.dhi = p_src[0];
X    y.du.dlo = p_src[1];
X    return(y.d);
}
extern __inline__
void
ASSIGN_FLT(p_dest, src)
X  unsigned int p_dest[];
X  float src;
{ 
X    float_thing y;
X    y.f = src;
X    *p_dest = y.fu;
}
extern __inline__
float
PK_FLT(p_src)
X  unsigned int p_src[];
{
X    float_thing y;
X    y.fu = *p_src;
X    return(y.f);
}
extern void  miniInterpret (StgFunPtr) ;
extern void  miniInterpret_debug ( StgFunPtr, void (*)() ) ;
extern void  miniInterpretEnd(void );
extern StgFunPtr evaluateMain(void );
extern StgFunPtr returnMain(void );
extern StgFunPtr impossible_jump_after_switch(void );
extern StgWord STK_STUB_REALLY[] ;
extern void  StackOverflow(void );  
extern void  HEAP_OVERFLOW_NodeLive (StgWord) ; 
extern void  HEAP_OVERFLOW_0PtrsLive (StgWord) ;
extern void  HEAP_OVERFLOW_1PtrsLive (StgWord) ;
extern void  HEAP_OVERFLOW_2PtrsLive (StgWord) ;
extern void  HEAP_OVERFLOW_3PtrsLive (StgWord) ;
extern void  HEAP_OVERFLOW_4PtrsLive (StgWord) ;
extern void  HEAP_OVERFLOW_5PtrsLive (StgWord) ;
extern void  HEAP_OVERFLOW_6PtrsLive (StgWord) ;
extern void  HEAP_OVERFLOW_7PtrsLive (StgWord) ;
extern void  HEAP_OVERFLOW_8PtrsLive (StgWord) ;
extern void  HEAP_OVERFLOW_Upd_0Ret_Live (StgWord) ;
extern void  HEAP_OVERFLOW_Upd_1Ret_Live (StgWord) ;
extern void  HEAP_OVERFLOW_Upd_2Ret_Live (StgWord) ;
extern void  HEAP_OVERFLOW_Upd_3Ret_Live (StgWord) ;
extern void  HEAP_OVERFLOW_Upd_4Ret_Live (StgWord) ;
extern void  HEAP_OVERFLOW_Upd_5Ret_Live (StgWord) ;
extern void  HEAP_OVERFLOW_Upd_6Ret_Live (StgWord) ;
extern void  HEAP_OVERFLOW_Upd_7Ret_Live (StgWord) ;
extern void  HEAP_OVERFLOW_Upd_8Ret_Live (StgWord) ;
extern StgInt	stg_exit (StgInt) ;
extern StgInt	_stg_rem (StgInt, StgInt) ;
typedef struct {
X    StgPtrPtr   botA;    
X    StgPtr      botB;    
} stackData;
extern stackData stackInfo;
typedef struct {
X    StgPtr hp;       
X    StgPtr hplim;    
X    StgPtrPtr spa;   
X    StgPtr spb;      
X    StgPtrPtr sua;   
X    StgPtr sub;      
X    int rootno;      
X    StgPtr *roots;   
X    int CAFno;       
X    StgPtr CAFlist;  
} smInfo;
int initSM      (int rts_argc, char **rts_argv, struct _iobuf  *statsfile) ;
int exitSM      (smInfo *sm) ;
int initStacks  (smInfo *sm) ;
int initHeap    (smInfo *sm) ;
int collectHeap (StgWord reqsize, smInfo *sm) ;
extern   StgWord CHARLIKE_closures[];
extern StgPtr INTLIKE_closures;
extern void   _Evacuate_1(void );
extern void   _Evacuate_2(void );
extern void   _Evacuate_3(void );
extern void   _Evacuate_4(void );
extern void   _Evacuate_5(void );
extern void   _Evacuate_6(void );
extern void   _Evacuate_7(void );
extern void   _Evacuate_8(void );
extern void   _Evacuate_9(void );
extern void   _Evacuate_10(void );
extern void   _Evacuate_11(void );
extern void   _Evacuate_12(void );
extern StgFunPtr _Scavenge_1_0(void );
extern StgFunPtr _Scavenge_2_0(void );
extern StgFunPtr _Scavenge_3_0(void );
extern StgFunPtr _Scavenge_4_0(void );
extern StgFunPtr _Scavenge_5_0(void );
extern StgFunPtr _Scavenge_2_1(void );  
extern StgFunPtr _Scavenge_3_1(void );  
extern StgFunPtr _Scavenge_3_2(void );  
extern StgFunPtr _Scavenge_1_1(void );
extern StgFunPtr _Scavenge_2_2(void );
extern StgFunPtr _Scavenge_3_3(void );
extern StgFunPtr _Scavenge_4_4(void );
extern StgFunPtr _Scavenge_5_5(void );
extern StgFunPtr _Scavenge_6_6(void );
extern StgFunPtr _Scavenge_7_7(void );
extern StgFunPtr _Scavenge_8_8(void );
extern StgFunPtr _Scavenge_9_9(void );
extern StgFunPtr _Scavenge_10_10(void );
extern StgFunPtr _Scavenge_11_11(void );
extern StgFunPtr _Scavenge_12_12(void );
extern void   _Evacuate_S(void );
extern StgFunPtr _Scavenge_S_N(void );
extern void   _Evacuate_Dyn(void );
extern StgFunPtr _Scavenge_Dyn(void );
extern void   _Evacuate_Tuple(void );
extern StgFunPtr _Scavenge_Tuple(void );
extern void   _Evacuate_Data(void );
extern StgFunPtr _Scavenge_Data(void );
extern void   _Evacuate_BH_MinUpd(void );
extern StgFunPtr _Scavenge_BH_MinUpd(void );
extern void   _Evacuate_BH_MinNonUpd(void );
extern StgFunPtr _Scavenge_BH_MinNonUpd(void );
extern void   _Evacuate_Static(void );
extern void   _Scavenge_Static(void );
extern void   _Evacuate_Ind(void );
extern void   _Scavenge_Ind(void );
extern void   _Evacuate_Caf(void );
extern void   _Scavenge_Caf(void );
extern void   _Evacuate_Const(void );
extern void   _Scavenge_Const(void );
extern void   _Evacuate_CharLike(void );
extern void   _Scavenge_CharLike(void );
extern void   _Evacuate_IntLike(void );
extern void   _Scavenge_IntLike(void );
extern void   _Evacuate_Upd_1(void );  
extern void   _Scavenge_Upd(void );
extern StgFunPtr _ScanNext_0(void );
extern StgFunPtr _ScanNext_1(void );
extern StgFunPtr _ScanNext_2(void );
extern StgFunPtr _ScanNext_3(void );
extern StgFunPtr _ScanNext_4(void );
extern StgFunPtr _ScanNext_5(void );
extern StgFunPtr _ScanNext_6(void );
extern StgFunPtr _ScanNext_7(void );
extern StgFunPtr _ScanNext_8(void );
extern StgFunPtr _ScanNext_9(void );
extern StgFunPtr _ScanNext_10(void );
extern StgFunPtr _ScanNext_11(void );
extern StgFunPtr _ScanNext_12(void );
extern StgFunPtr _ScanNext_n1(void );
extern StgFunPtr _ScanNext_n2(void );
extern StgFunPtr _ScanNext_S(void );
extern StgFunPtr _ScanNext_Dyn(void );
extern StgFunPtr _ScanNext_Tuple(void );
extern StgFunPtr _ScanNext_Data(void );
extern StgFunPtr _ScanNext_MinUpd(void );
extern StgFunPtr _ScanNext_MinNonUpd(void );
extern StgFunPtr _ScanNext_FillSize(void );
extern StgFunPtr _ScanLink_1_0(void );
extern StgFunPtr _ScanLink_2_0(void );
extern StgFunPtr _ScanLink_3_0(void );
extern StgFunPtr _ScanLink_4_0(void );
extern StgFunPtr _ScanLink_5_0(void );
extern StgFunPtr _ScanLink_2_1(void );  
extern StgFunPtr _ScanLink_3_1(void );  
extern StgFunPtr _ScanLink_3_2(void );  
extern StgFunPtr _ScanLink_1_1(void );
extern StgFunPtr _ScanLink_2_2(void );
extern StgFunPtr _ScanLink_3_3(void );
extern StgFunPtr _ScanLink_4_4(void );
extern StgFunPtr _ScanLink_5_5(void );
extern StgFunPtr _ScanLink_6_6(void );
extern StgFunPtr _ScanLink_7_7(void );
extern StgFunPtr _ScanLink_8_8(void );
extern StgFunPtr _ScanLink_9_9(void );
extern StgFunPtr _ScanLink_10_10(void );
extern StgFunPtr _ScanLink_11_11(void );
extern StgFunPtr _ScanLink_12_12(void );
extern StgFunPtr _ScanLink_S_N(void );
extern StgFunPtr _ScanLink_Dyn(void );
extern StgFunPtr _ScanLink_Tuple(void );
extern StgFunPtr _ScanLink_Data(void );
extern StgFunPtr _ScanLink_BH_MinUpd(void );
extern StgFunPtr _ScanLink_BH_MinNonUpd(void );
extern StgFunPtr _ScanLink_MinUpdTO1_0(void );  
extern StgFunPtr _ScanLink_MinUpdTO1_1(void );
extern StgFunPtr _ScanMove_1(void );
extern StgFunPtr _ScanMove_2(void );
extern StgFunPtr _ScanMove_3(void );
extern StgFunPtr _ScanMove_4(void );
extern StgFunPtr _ScanMove_5(void );
extern StgFunPtr _ScanMove_6(void );
extern StgFunPtr _ScanMove_7(void );
extern StgFunPtr _ScanMove_8(void );
extern StgFunPtr _ScanMove_9(void );
extern StgFunPtr _ScanMove_10(void );
extern StgFunPtr _ScanMove_11(void );
extern StgFunPtr _ScanMove_12(void );
extern StgFunPtr _ScanMove_S(void );
extern StgFunPtr _ScanMove_Dyn(void );
extern StgFunPtr _ScanMove_Tuple(void );
extern StgFunPtr _ScanMove_Data(void );
extern StgFunPtr _ScanMove_BH_MinUpd(void );
extern StgFunPtr _ScanMove_BH_MinNonUpd(void );
extern StgFunPtr _ScanMove_1TO1(void );
extern StgFunPtr _ScanMove_MinUpdTO1(void );
extern StgFunPtr _PRStart_0(void );
extern StgFunPtr _PRStart_1(void );
extern StgFunPtr _PRStart_2(void );
extern StgFunPtr _PRStart_3(void );
extern StgFunPtr _PRStart_4(void );
extern StgFunPtr _PRStart_5(void );
extern StgFunPtr _PRStart_6(void );
extern StgFunPtr _PRStart_7(void );
extern StgFunPtr _PRStart_8(void );
extern StgFunPtr _PRStart_9(void );
extern StgFunPtr _PRStart_10(void );
extern StgFunPtr _PRStart_11(void );
extern StgFunPtr _PRStart_12(void );
extern StgFunPtr _PRStart_N(void );
extern StgFunPtr _PRStart_Dyn(void );
extern StgFunPtr _PRStart_Tuple(void );
extern StgFunPtr _PRStart_Data(void );
extern StgFunPtr _PRIn_1(void );
extern StgFunPtr _PRIn_2(void );
extern StgFunPtr _PRIn_3(void );
extern StgFunPtr _PRIn_4(void );
extern StgFunPtr _PRIn_5(void );
extern StgFunPtr _PRIn_6(void );
extern StgFunPtr _PRIn_7(void );
extern StgFunPtr _PRIn_8(void );
extern StgFunPtr _PRIn_9(void );
extern StgFunPtr _PRIn_10(void );
extern StgFunPtr _PRIn_11(void );
extern StgFunPtr _PRInLast_1(void );
extern StgFunPtr _PRInLast_2(void );
extern StgFunPtr _PRInLast_3(void );
extern StgFunPtr _PRInLast_4(void );
extern StgFunPtr _PRInLast_5(void );
extern StgFunPtr _PRInLast_6(void );
extern StgFunPtr _PRInLast_7(void );
extern StgFunPtr _PRInLast_8(void );
extern StgFunPtr _PRInLast_9(void );
extern StgFunPtr _PRInLast_10(void );
extern StgFunPtr _PRInLast_11(void );
extern StgFunPtr _PRInLast_12(void );
extern StgFunPtr _PRIn_I(void );
extern StgFunPtr _PRIn_I_Dyn(void );
extern StgFunPtr _PRIn_I_Tuple(void );
extern StgFunPtr _PRIn_Error(void );
extern StgFunPtr _PRMarked(void );
extern StgFunPtr _PRMarked_Caf(void );
extern StgFunPtr _PRStart_BH(void );
extern StgFunPtr _PRStart_Ind(void );
extern StgFunPtr _PRStart_Const(void );
extern StgFunPtr _PRStart_CharLike(void );
extern StgFunPtr _PRStart_IntLike(void );
extern StgFunPtr _PRStart_Static(void );
extern StgFunPtr _Dummy_Static_entry(void );
extern StgFunPtr _Dummy_Ind_entry(void );
extern StgFunPtr _Dummy_Caf_entry(void );
extern StgFunPtr _Dummy_Fill_entry(void );
extern StgFunPtr _Dummy_Const_entry(void );
extern StgFunPtr _Dummy_CharLike_entry(void );
extern const  StgWord   StdUpdRetVector_REALLY[];
extern const  StgWord   ConUpdRetVector[];
extern const  StgWord FILL_1[];       
extern const  StgWord FILL_2[];
extern const  StgWord FILL_3[];
extern const  StgWord FILL_4[];
extern const  StgWord FILL_5[];
extern const  StgWord FILL_6[];
extern const  StgWord FILL_7[];
extern const  StgWord FILL_8[];
extern const  StgWord FILL_9[];
extern const  StgWord FILL_10[];
extern const  StgWord FILL_11[];
extern const  StgWord FILL_12[];
extern const  StgWord FILL_Gen[];
extern const  StgWord    BH_UPD_info  [];
extern const  StgWord    BH_SINGLE_info  [];
extern smInfo StorageMgrInfo;
extern const  StgWord    Caf_info  [];
extern const  StgWord      PAP_info  [];
extern           StgFunPtr UpdatePAP(void );
extern const  StgWord    Ind_info  [];
extern int   SM_word_heap_size;  
extern int   SM_min_percent_free;
extern int   SM_word_stk_size;
extern struct _iobuf  *SM_statsfile;
extern int   SM_trace;
extern int   SM_stats_summary;
extern int   SM_stats_verbose;
extern int   SM_ring_bell;
extern StgPtr heap_space;
extern StgPtr hp_start;
extern void  stat_init    (char *collector, int caf, char *comment) ;
extern void  stat_startGC (void) ;
extern void  stat_endGC   (int alloc, int resid, int caf_words, char *comment, smInfo *sm) ;
extern void  stat_exit    (int alloc) ;
extern StgFunPtr _Dummy_entry(void );
extern StgPtr xmalloc (size_t) ;
typedef struct {
X	int mode;
X	float resid_to_compact;
X	float resid_from_compact;
X	struct {
X	    StgPtr base;  
X	    StgPtr lim;   
X	    char *name;
X	} modeinfo[3];
} dualmodeData;
extern dualmodeData dualmodeInfo;
register StgPtr Scav __asm__("%g5"); 
register StgPtr Evac __asm__("%g6"); 
register StgPtr ToHp __asm__("%g7"); 
extern void   _Enter_Internal(void );
extern const  StgWord    Forward_Ref_info  [];
extern void   _Evacuate_Forward_Ref(void );
extern void   _Scavenge_Forward_Ref(void );
extern const  StgWord    Caf_Evac_Upd_info  [];
extern void   _Evacuate_Caf_Evac_Upd(void );
extern int markHeapRoots (smInfo *sm) ;
register StgPtr Mark __asm__("%g5"); 
register StgPtr MStack __asm__("%g6"); 
register StgPtr MRoot __asm__("%g7"); 
register StgPtr Scan __asm__("%g5"); 
register StgPtr New __asm__("%g6"); 
register StgPtr Temp __asm__("%g7"); 
void  checkAStack(void )
{
X    StgPtrPtr   stackptr;
X    StgPtr      closurePtr;
X    StgPtr      infoPtr;
X    int         error = 0;
X    if (SuB > SpB + 1) {
X        fprintf((&_iob[2]) , "SuB (%x) > SpB (%x)\n", SuB, SpB);
X        error = 1;
X    }
X    if (SuA < SpA) {
X        fprintf((&_iob[2]) , "SuA (%x) < SpA (%x)\n", SuA, SpA);
X        error = 1;
X    }
X    for (stackptr = SpA;
X         (  stackInfo.botA - stackptr )   >= 0;
X         stackptr = stackptr + (1) ) {
X        closurePtr = (StgPtr) *stackptr;
X        if (((closurePtr) < (StgPtr)256) ) {
X            fprintf((&_iob[2]) , "Suspect heap ptr on A stk; SpA %x, sp %x, ptr %x\n",
X                    SpA, stackptr, closurePtr);
X            error = 1;
X        } else if (((closurePtr) >= heap_space && (closurePtr) < heap_space + SM_word_heap_size)  && ! ((closurePtr) >= dualmodeInfo.modeinfo[dualmodeInfo.mode].base && (closurePtr) <= dualmodeInfo.modeinfo[dualmodeInfo.mode].lim) ) {
X            fprintf((&_iob[2]) , "Bad heap ptr on A stk; SpA %x, sp %x, ptr %x\n",
X                    SpA, stackptr, closurePtr);
X            error = 1;
X        } else {
X            infoPtr = (StgPtr) *closurePtr;
X            if (((infoPtr) < (StgPtr)256) ) {
X                fprintf((&_iob[2]) , "Suspect info ptr on A stk; SpA %x, sp %x, closure %x info %x\n",
X                    SpA, stackptr, closurePtr, infoPtr);
X                error = 1;
X            } else if ( ! ((infoPtr) < (StgPtr) &end && 0 <      ((StgInt) *(((StgPtr)(infoPtr))+1))  &&      ((StgInt) *(((StgPtr)(infoPtr))+1))  < 16) ) {
X                fprintf((&_iob[2]) , "Bad info ptr in A stk; SpA %x, sp %x, closure %x, info %x, type %d\n",
X                        SpA, stackptr, closurePtr, infoPtr,      ((StgInt) *(((StgPtr)(infoPtr))+1)) );
X                error = 1;
X            }
X        }
X    }
X    if (error) abort();
}
SHAR_EOF
chmod 0664 gcc-bug3.c ||
echo 'restore of gcc-bug3.c failed'
Wc_c="`wc -c < 'gcc-bug3.c'`"
test 21152 -eq "$Wc_c" ||
	echo 'gcc-bug3.c: original size 21152, current size' "$Wc_c"
fi
exit 0

Newsgroups: gnu.gcc.bug