Bug 127375 - gcc-3.4.1internal compiler error on VIA C3
Summary: gcc-3.4.1internal compiler error on VIA C3
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
: 128368 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2004-07-07 12:55 UTC by John Eckerdal
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2004-08-03 01:30:10 UTC

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

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2004:385 normal SHIPPED_LIVE Updated gcc packages 2004-08-02 04:00:00 UTC

Description John Eckerdal 2004-07-07 12:55:43 UTC
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 
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):

How reproducible:

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

Actual Results:  Received an internal compiler error.

Expected Results:  Successful compilation

Additional info:

Comment 1 John Eckerdal 2004-07-07 12:56:16 UTC
Created attachment 101680 [details]
the cc-out file generated by gcc

Comment 2 John Eckerdal 2004-07-07 12:56:40 UTC
Created attachment 101681 [details]
The source code gcc tries to compile

Comment 3 John Eckerdal 2004-07-07 12:58:08 UTC
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 14:24:51 UTC
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?

Comment 5 John Eckerdal 2004-07-07 15:54:28 UTC
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 
(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 16:00:49 UTC
Ok, so I disassembled the cc1 binary. The prefetch instructions occur 

 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 17:04:47 UTC
Oh, I see now, thanks.  Was looking mainly for cmov insns.
Curious why nobody noticed this bug for more than 2.5 years...

Comment 8 John Eckerdal 2004-07-16 10:45:05 UTC
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 08:41:33 UTC
*** Bug 128368 has been marked as a duplicate of this bug. ***

Comment 10 Jay Turner 2004-08-03 01:30:11 UTC
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.


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