egcs-2.91.28 bug (pgcc-2.91.28 optimization bug) (fwd)
Andy Igoshin
ai@vsu.ru
Mon May 25 05:49:00 GMT 1998
Hi!
The bug described in the below-forwarded message appeared to be
a egcs bug (we first found it in pgcc-2.91.28, and later ckecked
egcs-2.91.28). We did not check the latest egcs snapshot because
we had problems building this snapshot.
Andy
---------- Forwarded message ----------
Date: Mon, 18 May 1998 15:59:36 +0400 (MSD)
From: Andy Igoshin <ai@vsu.ru>
To: Marc Lehmann <pcg@goof.com>
Subject: pgcc-2.91.24 & pgcc-2.91.28 optimization bug
Hi!
We found this bug when compiling wu-2.4.2-academ[BETA-17] from
ftp://ftp.academ.com/pub/wu-ftpd/private/wu-ftpd-2.4.2-beta-17.tar.Z
Some investigation showed that the bug appear when compiling a file
src/ftpcmd.c (generated from src/ftpcmd.y). When one sets
optimization level -O2 and above, the generated code is buggy.
If one uses -O, all is right. Gcc-2.8.1 with -O6 also generates right
code.
The supposed place which is compiled wrongly is line 986:
--------------------------------------------------------------------
if (yyvsp[-3].Number) {
-----> if (cliaddr.s_addr == his_addr.sin_addr.s_addr
&& ntohs(cliport) > 1023) {
data_dest.sin_family = AF_INET;
data_dest.sin_addr = cliaddr;
data_dest.sin_port = cliport;
reply(200, "PORT command successful.");
} else {
memset(&data_dest, 0, sizeof(data_dest));
syslog (LOG_WARNING, "refused PORT %s,%d from %s",
inet_ntoa(cliaddr), ntohs(cliport), remotehost);
reply(500, "Illegal PORT Command");
}
}
--------------------------------------------------------------------
Andy
More information about the Gcc-bugs
mailing list