[egcs-19980628] Linux x86 comaprison bug persists

Hyman Rosen hymie@prolifics.com
Mon Jun 29 13:21:00 GMT 1998


The following code, compiled with -O1 or better, prints "FAILED!".
This has been broken in at least the last three snapshots.

struct fd { unsigned char a, b; } f = { 5 };
struct fd *g() { return &f; }
int h() { return -1; }
int main(int c, char **v)
{
	extern int printf(const char *, ...);
	struct fd *f = g();
	f->b = h();
	if (((f->a & 0x7f) & ~0x10) <= 2)
		printf("FAILED!\n");
	return 0;
}



More information about the Gcc-bugs mailing list