This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/8746: gcc-3 miscompiles Linux kernel ppa driver onx86
- From: Carsten Haustein <chaus at rz dot uni-potsdam dot de>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 28 Feb 2003 16:36:00 -0000
- Subject: Re: optimization/8746: gcc-3 miscompiles Linux kernel ppa driver onx86
- Reply-to: Carsten Haustein <chaus at rz dot uni-potsdam dot de>
The following reply was made to PR optimization/8746; it has been noted by GNATS.
From: Carsten Haustein <chaus at rz dot uni-potsdam dot de>
To: <ebotcazou at gcc dot gnu dot org>, <chaus at rz dot uni-potsdam dot de>, <gcc-bugs at gcc dot gnu dot org>,
<gcc-prs at gcc dot gnu dot org>, <nobody at gcc dot gnu dot org>, <gcc-gnats at gcc dot gnu dot org>
Cc:
Subject: Re: optimization/8746: gcc-3 miscompiles Linux kernel ppa driver on
x86
Date: Fri, 28 Feb 2003 17:26:26 +0100 (MET)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime at docserver dot cac dot washington dot edu for more info.
---559023410-1804928587-1046449586=:26411
Content-Type: TEXT/PLAIN; charset=US-ASCII
Compile the testcase with: gcc -O -march=i{345}86 -o check check.c
Run the test with: check <number>, where <number> is an integer between 0
and 255 (without angle brackets). The program will "prove" that any number
in this range is less than 128, which is obviously wrong.
Some notes:
1. It is important to select one of the shown -march arguments. Only code
generated for i{345}86 and K6 family is affected. Code generated for i686
family, Pentium 4 and Athlon family works fine. This code uses the al
register for applying the bit-mask instead of eax and a different
representation of the immediate 0xf0.
2. There must not be a statement between the "and" operation and the
if-expression. Otherwise code is generated for both the "and" operation
and for testing the MSB, since the extra statement may affect the
cpu-flags. Such code works fine.
3. The value assigned to r must be examined in one or the other way.
Otherwise code for the "and" operation will be omitted and code for
testing the MSB will be generated, which leads to working code too.
--
Carsten Haustein
---559023410-1804928587-1046449586=:26411
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="check.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine dot GSO dot 4 dot 30 dot 0302281726260 dot 26411 at persius dot rz dot uni-potsdam dot de>
Content-Description:
Content-Disposition: attachment; filename="check.c"
I2luY2x1ZGUgPHN0ZGlvLmg+DQppbnQgbWFpbihpbnQgYXJnYywgY2hhciAq
YXJndltdKSB7DQogICB1bnNpZ25lZCBjaGFyIHIgPSAoYXRvaShhcmd2WzFd
KSkgJiAweGYwOw0KICAgaWYgKCEociAmIDB4ODApKSBwcmludGYoIiV1IDwg
MTI4XG4iLCByKTsNCiAgICAgICAgICAgICAgIGVsc2UgcHJpbnRmKCIldSA+
PSAxMjhcbiIsIHIpOw0KICAgcmV0dXJuIDA7DQp9DQo=
---559023410-1804928587-1046449586=:26411--