This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[egcs-19980621 Linux i86] Comparison bug still present
- To: egcs-bugs at cygnus dot com
- Subject: [egcs-19980621 Linux i86] Comparison bug still present
- From: Hyman Rosen <hymie at prolifics dot com>
- Date: Wed, 24 Jun 1998 15:37:12 -0400
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;
}
/**************************************************************************/