This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/30368] New: wrong result
- From: "lidaobing at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jan 2007 14:21:41 -0000
- Subject: [Bug c/30368] New: wrong result
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
for the following example[1], it should exit with 0, but under gcc-4.0 gcc-4.1
gcc-4.2 and all optimize level(-O0, -O1, -O2, -O3), it exit with 1;
check gcc versions in [2]
[1]
/* begin */
struct A { int b; };
int main(int argc, char **argv)
{
struct A* a = 0;
if (&a->b) return 1;
return 0;
}
/* end */
[2]
gcc version 4.0.4 20060904 (prerelease) (Debian 4.0.3-7)
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
gcc version 4.2.0 20061003 (experimental) (Debian 4.2-20061003-1)
--
Summary: wrong result
Product: gcc
Version: 4.0.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lidaobing at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30368