Bug 127375 - gcc-3.4.1internal compiler error on VIA C3
gcc-3.4.1internal compiler error on VIA C3
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
: 128368 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-07-07 08:55 EDT by John Eckerdal
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-02 21:30:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
the cc-out file generated by gcc (82.17 KB, text/plain)
2004-07-07 08:56 EDT, John Eckerdal
no flags Details
The source code gcc tries to compile (8.79 KB, text/plain)
2004-07-07 08:56 EDT, John Eckerdal
no flags Details

  None (edit)
Description John Eckerdal 2004-07-07 08:55:43 EDT
From Bugzilla Helper:
User-Agent: Opera/7.50 (Windows NT 5.0; U)  [en]

Description of problem:
When trying to compile Linux 2.6.7 from source I get an internal 
compiler error while trying to do:
make menuconfig

[root:/usr/src/linux] make menuconfig
  HOSTCC  scripts/basic/fixdep
scripts/basic/fixdep.c: In function `parse_config_file':
scripts/basic/fixdep.c:239: internal compiler error: Illegal 
instruction
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccQxU7Cz.out file, please attach 
this to your bugreport.
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2


This is on a VIA C3 CPU. /proc/cpuinfo:
processor       : 0
vendor_id       : CentaurHauls
cpu family      : 6
model           : 7
model name      : VIA Ezra
stepping        : 8
cpu MHz         : 800.091
cache size      : 64 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu de tsc msr cx8 mtrr pge mmx 3dnow
bogomips        : 1576.96

This is just an example. Every "larger" project I have tried to 
compail fails in the same way making it impossible to use this 
release to compile anything useful.

I have reproduced this on two different VIA C3 motherboards to try 
rule out potential hardware problems. gcc-3.3.3 works fine compiling 
the same code. So I doubt there is something flaky with the hardware.



Version-Release number of selected component (if applicable):
gcc-3.4.1-1.i386

How reproducible:
Always

Steps to Reproduce:
1. In the Linux source code directory type make menuconfig
2. Compilation fails with internal compiler error
3.
    

Actual Results:  Received an internal compiler error.

Expected Results:  Successful compilation

Additional info:
Comment 1 John Eckerdal 2004-07-07 08:56:16 EDT
Created attachment 101680 [details]
the cc-out file generated by gcc
Comment 2 John Eckerdal 2004-07-07 08:56:40 EDT
Created attachment 101681 [details]
The source code gcc tries to compile
Comment 3 John Eckerdal 2004-07-07 08:58:08 EDT
Since the compiler is an "internal compiler error: Illegal 
instruction" might this be related to the fact that the VIA C3 lacks 
certain instructions and gcc have been compiled for i686?
Comment 4 Jakub Jelinek 2004-07-07 10:24:51 EDT
To my knowledge there are no i686 instructions in cc1 binary
(just quickly skimmed objdump -dr /usr/libexec/gcc/i386-redhat-linux/3.4.1/cc1 ).
The testcase you provided compiles just fine with gcc-3.4.1-2 on P4.
Given that I don't have any VIA CPUs, can you first try to reproduce
it with gcc-3.4.1-2 and if you still see the bug, run
/usr/libexec/gcc/i386-redhat-linux/3.4.1/cc1 -quiet -O2 -Wall -Wstrict-prototypes -fomit-frame-pointer -frandom-seed=0 ccQxU7Cz.out
under debugger and see on which instruction it died?
Thanks.
Comment 5 John Eckerdal 2004-07-07 11:54:28 EDT
I am not that good at gdb so I may have made a mistake here but...
This is still 3.4.1-1 (I did not find 3.4.1-2).

Starting program: /usr/libexec/gcc/i386-redhat-linux/3.4.1/cc1 -quiet 
-O2 -Wall -Wstrict-prototypes -fomit-frame-pointer -frandom-seed=0 
/tmp/ccQxU7Cz.out
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGILL, Illegal instruction.
0x082bde5c in ?? ()
(gdb) bt
#0  0x082bde5c in ?? ()
#1  0x00000074 in ?? ()
#2  0x00000000 in ?? ()
#3  0x00000000 in ?? ()
#4  0x00000000 in ?? ()
#5  0x00000000 in ?? ()
#6  0x00000001 in ?? ()
#7  0xbffff8c8 in ?? ()
#8  0x081fbeab in ?? ()
#9  0x4030ce20 in ?? ()
#10 0xbffff890 in ?? ()
#11 0x00000001 in ?? ()
#12 0x00000001 in ?? ()
[stack is a lot deeper]

(gdb) x/i 0x082bde5c
0x82bde5c <error+1894796>:      prefetcht0 0x20(%eax)

I have no idea if this is the correct way to check this, but
let's assume for a short while that it is correct.

VIA C3 implements a prefetch instruction from the 3Dnow! instruction 
set. SSE instructions (not available on the C3 version in my 
computer) also has prefetch instructions. I am not sure if they are 
compatible, if they are not then this may be the problem?

Comment 6 John Eckerdal 2004-07-07 12:00:49 EDT
Ok, so I disassembled the cc1 binary. The prefetch instructions occur 
twise:

 82bde5c:       0f 18 48 20             prefetcht0 0x20(%eax)
 82bde60:       0f 18 48 40             prefetcht0 0x40(%eax)

These map to the SSE prefetch instructions, however what I found 
googling was that the 3Dnow! prefetch is 0fh 0d xx xx, so these two 
instructions are illegal on the VIA C3 CPU I have.
Comment 7 Jakub Jelinek 2004-07-07 13:04:47 EDT
Oh, I see now, thanks.  Was looking mainly for cmov insns.
Curious why nobody noticed this bug for more than 2.5 years...
http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00619.html
Comment 8 John Eckerdal 2004-07-16 06:45:05 EDT
With gcc-3.4.1-4 (which includes the fix according to the changelog) 
the compiler works again.
I tried several projects and did not find any problems (with the 
compiler or the executable). So this issue should be solved now.
Comment 9 Jakub Jelinek 2004-07-22 04:41:33 EDT
*** Bug 128368 has been marked as a duplicate of this bug. ***
Comment 10 Jay Turner 2004-08-02 21:30:11 EDT
An errata has been issued which should help the problem 
described in this bug report. This report is therefore being 
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, 
please follow the link below. You may reopen this bug report 
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2004-385.html

Note You need to log in before you can comment on or make changes to this bug.