🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6126

Pentium gcc 2.7.2p problems

#6126
From: Boris Gjenero
Date: Thu, 05 Dec 1996 00:00
43 lines
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  |
Technical Details
Message-ID: <32A6F0F5.34F7298A@undergrad.math.uwaterloo.ca>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,e5e62272f4ba314,start
X-Google-Attributes: gid113d02,public
From: bgjenero@undergrad.math.uwaterloo.ca (Boris Gjenero)
Subject: Pentium gcc 2.7.2p problems
Date: 1996/12/05
Message-ID: <32A6F0F5.34F7298A@undergrad.math.uwaterloo.ca>
X-Deja-AN: 202524017
sender: news@watserv3.uwaterloo.ca
content-type: text/plain; charset=us-ascii
organization: The First Frontier
x-gateway: relay7.UU.NET from bug-gcc to gnu.gcc.bug; Thu, 5 Dec 1996 12:01:46 EST
mime-version: 1.0
newsgroups: gnu.gcc.bug
x-mailer: Mozilla 3.01 (X11; I; Linux 2.0.27 i586)