egcs-1.1.1: fixed or forbidden register 3 (bx) was spilled for class GENERAL_REGS.

John Hughes john@Calva.COM
Wed Mar 3 09:46:00 GMT 1999


When compiling "sfdcunion" from sfio-1998 I get this error.

There is no "asm" in the function.

The compilation command is:

	gcc -v -O -fomit-frame-pointer -fpic  egcs-bug.c

The source (stripped down gcc -E output) of the function is appended to this
message.

The compiler output is:

Reading specs from
/u/local/lib/gcc-lib/i386-pc-sysv4.2uw2.1.3/egcs-2.91.60/specs
gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)

/u/local/lib/gcc-lib/i386-pc-sysv4.2uw2.1.3/egcs-2.91.60/cpp -lang-c -v -und
ef -D__GNUC__=2 -D__GNUC_MINOR__=91 -Di386 -Dunix -D__svr4__ -D__i386__ -D__
unix__ -D__svr4__ -D__i386 -D__unix -Asystem(unix) -Asystem(svr4) -Acpu(i386
) -Amachine(i386) -D__OPTIMIZE__ egc-bug.c /var/tmp/ccuTsq5p.i
GNU CPP version egcs-2.91.60 19981201 (egcs-1.1.1 release) (i386 System V
Release 4)
#include "..." search starts here:
#include <...> search starts here:
 /u/local/include
 /u/local/i386-pc-sysv4.2uw2.1.3/include
 /u/local/lib/gcc-lib/i386-pc-sysv4.2uw2.1.3/egcs-2.91.60/include
 /usr/include
End of search list.
 /u/local/lib/gcc-lib/i386-pc-sysv4.2uw2.1.3/egcs-2.91.60/cc1
/var/tmp/ccuTsq5p.i -quiet -dumpbase
egc-bug.c -O -version -fomit-frame-pointer -fpic -o /var/tmp/ccUX4vyF.s
GNU C version egcs-2.91.60 19981201 (egcs-1.1.1 release)
(i386-pc-sysv4.2uw2.1.3) compiled by GNU C version egcs-2.91.60 19981201
(egcs-1.1.1 release).
egcs-bug.c: In function `unseek':
egcs-bug.c:159: fixed or forbidden register 3 (bx) was spilled for class
GENERAL_REGS.
This may be due to a compiler bug or to impossible asm
statements or clauses.

--
John Hughes <john@Calva.COM>,
        CalvaEDI SA.                            Tel: +33-1-4313-3131
        66 rue du Moulin de la Pointe,          Fax: +33-1-4313-3139
        75013 PARIS.

typedef unsigned int size_t;
typedef	unsigned char	uchar_t;
typedef	unsigned short	ushort_t;
typedef	unsigned int	uint_t;
typedef	unsigned long	ulong_t;
typedef	int	ssize_t;
typedef	unsigned short	ushort;
typedef	unsigned int	uint;
typedef	unsigned long	ulong;
typedef unsigned char	u_char;
struct timeval;
typedef char *__gnuc_va_list;
void va_end (__gnuc_va_list);
typedef __gnuc_va_list va_list;
typedef struct _sfio_s		Sfio_t;
typedef struct _sfdisc_s	Sfdisc_t;
typedef ssize_t		(*Sfread_f) (Sfio_t*, void *, size_t, Sfdisc_t*)  ;
typedef ssize_t		(*Sfwrite_f) (Sfio_t*, const void *, size_t, Sfdisc_t*)  ;
typedef long long   		(*Sfseek_f) (Sfio_t*, long long   , int, Sfdisc_t*)  ;
typedef int		(*Sfexcept_f) (Sfio_t*, int, void *, Sfdisc_t*)  ;
struct _sfdisc_s
{	Sfread_f	readf;
	Sfwrite_f	writef;
	Sfseek_f	seekf;
	Sfexcept_f	exceptf;
	Sfdisc_t*	disc;
};
struct _sfio_s
{	unsigned char*	next;
	unsigned char*	endw;
	unsigned char*	endr;
	unsigned char*	endb;
	Sfio_t*		push;
	unsigned short	flags;
	short		file;
	unsigned char*	data;
	ssize_t		size;
	ssize_t		val;
	long long   			extent;	long long   			here;	unsigned char		getr;	unsigned
char		tiny[1]; unsigned short		bits;	unsigned int		mode;	struct _sfdisc_s*
disc;	struct _sfpool_s*	pool;	void *			noop;
};
typedef struct _sffmt_s	Sffmt_t;
typedef int		(*Sffmtext_f) (Sfio_t*, void *, Sffmt_t*)  ;
typedef int		(*Sffmtevent_f) (Sfio_t*, int, void *, Sffmt_t*)  ;
struct _sffmt_s
{	long		version;
	Sffmtext_f	extf;
	Sffmtevent_f	eventf;
	char*		form;
	va_list		args;
	int		fmt;
	ssize_t		size;
	int		flags;
	int		width;
	int		precis;
	int		base;
	char*		t_str;
	ssize_t		n_str;
	void *		noop;
};
extern ssize_t		_Sfi;
typedef struct _sfpool_s	Sfpool_t;
struct _sfpool_s
{	Sfpool_t*	next;
	int		mode;
	int		s_sf;
	int		n_sf;
	Sfio_t**	sf;
	Sfio_t*		array[3];
};
typedef struct _sfrsrv_s	Sfrsrv_t;
struct _sfrsrv_s
{	Sfrsrv_t*	next;
	Sfio_t*		sf;
	ssize_t		slen;
	ssize_t		size;
	unsigned char 		data[1];
};
typedef struct _fmt_s		Fmt_t;
typedef struct _fmtpos_s	Fmtpos_t;
typedef union
{	int		i, *ip;
	long		l, *lp;
	short		h, *hp;
	unsigned int 		ui;
	unsigned long 		ul;
	ushort		uh;
	long long   	ll, *llp;
	unsigned long long   	lu;
	long double   	ld;
	double		d;
	float		f;
	char		c, *s, **sp;
	void 		*vp;
	Sffmt_t		*ft;
} Argv_t;
struct _fmt_s
{	char*		form;
	va_list		args;
	char*		oform;
	va_list		oargs;
	int		argn;
	Fmtpos_t*	fp;
	Sffmt_t*	ft;
	Sffmtevent_f	eventf;
	Fmt_t*		next;
};
struct _fmtpos_s
{	Sffmt_t	ft;
	Argv_t	argv;
	int	fmt;
	int	need[5 ];
};
typedef struct _file_s
{	Sfio_t*	f;
	long long   	lower;
} File_t;
typedef struct _union_s
{
	Sfdisc_t	disc;
	short		type;
	short		c;
	short		n;
	long long   		here;
	File_t		f[1];
} Union_t;
static long long    unseek(Sfio_t* f, long long    addr, int type, Sfdisc_t*
disc)
{
	register  Union_t*	un;
	register  int		i;
	register  long long   	extent, s;
	un = (Union_t*)disc;
	if(un->type& 1 )
		return -1L;
	if(type == 2)
	{	extent = 0;
		for(i = 0; i < un->n; ++i)
			extent += (sfsize(un->f[i].f) - un->f[i].lower);
		addr += extent;
	}
	else if(type == 1)
		addr += un->here;
	if(addr < 0)
		return -1;
	extent = 0;
	for(i = 0; i < un->n-1; ++i)
	{	s = sfsize(un->f[i].f) - un->f[i].lower;
		if(addr < extent + s)
			break;
		extent += s;
	}
	s = (addr-extent) + un->f[i].lower;
	if(sfseek(un->f[i].f,s,0) != s)
		return -1;
	un->c = i;
	un->here = addr;
	for(i += 1; i < un->n; ++i)
		sfseek(un->f[i].f,un->f[i].lower,0);
	return addr;
}
---------------------------------E O
F------------------------------------------



More information about the Gcc-bugs mailing list