Thread View: gnu.gcc.bug
2 messages
2 total messages
Started by Boris Gjenero
Thu, 05 Dec 1996 00:00
Pentium gcc 2.7.2p problems
Author: Boris Gjenero
Date: Thu, 05 Dec 1996 00:00
Date: Thu, 05 Dec 1996 00:00
43 lines
2703 bytes
2703 bytes
I don't know whether the FSF cares about the Pentium optimising gcc, but
anyways, I am posting this here. If anybody knows where this
information should go instead, *please* tell me.
First of all, there is a reason why I am using 2.7.2p. It produces
binaries that are generally a few percentage points smaller and they are
faster. I haen't done that much benchmarking, but on one of my programs
(solving a really large system of linear equations using my
object-oriented rational number class) the gain is about 10% I wish
this was included in the official gcc.
However, there is one annoying and very unpredictable problem in all
Pentium optimising gcc versions I have used so far. With -O4 The
compiler tends to occasionally put a number in edx, then do a cltd to
trash edx and then divide by edx, getting a division by zero.
Basically, it is something like:
movl $50,%edx (from aforementioned program, on i2.6.3)
cltd
idivl %edx
However, this went away in 2.7.2p, but 2.7.2p breaks uae with this:
0x80637f2 <rtarea_init+31>: movl $0x64,%edx
0x80637f7 <rtarea_init+36>: cltd
0x80637f8 <rtarea_init+37>: idivl %edx,%eax
Of course, these code fragments aren't much help. I'm sorry. This bug
appears randomly and I cannot reproduce it in something simple. I
remember checking the machine definition and some other parts in i2.6.3,
and they seemed okay.
If it helps at all, this has only happened with divisions by a constant,
and
-fno-risc-const does solve the problem. Even uae works with this
switch.
The other scary thing is whether 2.7.2p has other, less fatal bugs. I
would hate to have programs behave bizzarely and then be left wondering
if it is the program or the compiler.
--
| Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca> |
| Home page: http://www.undergrad.math.uwaterloo.ca/~bgjenero/ |
| "Luke, you're going to find that many of the truths we cling to |
| depend greatly on our own point of view." - Obi-Wan Kenobi, ROTJ |
Re: Pentium gcc 2.7.2p problems
Author: Alan Shutko
Date: Thu, 05 Dec 1996 00:00
Date: Thu, 05 Dec 1996 00:00
40 lines
2573 bytes
2573 bytes
>>>>> "BG" == Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca> writes: BG> I don't know whether the FSF cares about the Pentium optimising BG> gcc, but anyways, I am posting this here. If anybody knows where BG> this information should go instead, *please* tell me. Try checking the Pentium Compiler Group web site at http://www.goof.com/pcg/ . The Pentium GCC is not currently maintained by the FSF. BG> The other scary thing is whether 2.7.2p has other, less fatal BG> bugs. I would hate to have programs behave bizzarely and then be BG> left wondering if it is the program or the compiler. According to the PGCC FAQ: Everything could be compiled with -O2 or -O3. However there are some problems which occur quite often with -O4, and -O5 or -O6 are almost unusable. (Although the pentium-gzip on sunsite was compiled with -O6 and seems to be just fine). In versions earlier than 960511, -O4 and above have indeed problems, but 960511 is somewhat slower, though, but this comes from the original gcc, too, which in version 2.8.0 maybe somewhat slower than 2.7.2. The resulting code is rarely broken, but if anything goes wrong, try with -O2 switch. The -O2 seems to produce correct code on all occasions. The -O3 seems to be as good as the -O2 switch, and in fact I use -O6 always. In the cases where I get errors, I use -O3 switch. About 99% of all my sof twares (including the kernel) are compiled with -O6 switch. A large amount of that software is compiled with -O6 -frisc. Beginning with snapshot 960816 anything up to -O6 is reliable. The optimizations that aren't reliable are not enabled by ANY -Ox statement, you have to enable them by hand. So depending on the version you have, you may not want to use it. -- Alan Shutko <ats@hubert.wustl.edu> - The Few, the Proud, the Remaining. Faith goes out through the window when beauty comes in at the door.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads