This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[egcs-19980621 Linux i86] Comparison bug still present


The bad code generated for the following program is still present
in the latest snapshot. (A version of this code is in the test suite;
it fails there too.) When compiled with optimization, it prints "FAILED!".

I normally wouldn't pester, but I like using egcs to build my company's
product on my Linux box, both as a test of it and of the compiler, and
this bug runs afoul of a macro in our code, causing core dumps galore.

/**************************************************************************/
struct fd
{
	unsigned char a;
	unsigned char 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;
}
/**************************************************************************/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]