Red Hat Bugzilla – Bug 134368
Altivec compilation on PPC64 produces "Internal compiler error in extract_insn"
Last modified: 2007-11-30 17:07:04 EST
Description of problem:
Altivec compilation error on code from the gromacs molecular dynamic
I'm working on making gromacs compile with Altivec support on the
Redhat PPC 64-bit system (a IBM JS20), with Redhat AS 3. I'm
compiling the software as a 32-bit application currently.
I've isolated the troubled code to two files, that when compiled
produce the error message:
inner_altivec.c: In function `transpose_4_to_3':
inner_altivec.c:18900: unrecognizable insn:
(insn 8 6 110 (set (reg:V4SF 115)
(mem/f:V4SF (plus:SI (reg/f:SI 67 ap)
(const_int 8 [0x8])) [0 xyz3+0 S16 A128])) -1 (nil)
inner_altivec.c:18900: Internal compiler error in extract_insn, at
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/ccg7o9a8.out file, please attach
this to your bugreport.
I've placed the preprocessed file produced, as well as the .c and .h
file, and a shell script to call gcc at
Version-Release number of selected component (if applicable):
gcc-3.2.3-42 PPC (Redhat AS 3 update 3 standard compiler, with 64-bit
I've been able to isoloate the offending code, it is included in the
tar file found at http://csbl.bmb.uga.edu/~kellrott/altivec_bug.tar.gz
Steps to Reproduce:
1. Download file from http://csbl.bmb.uga.edu/~kellrott/altivec_bug.tar.gz
2. decompress and run ./test.sh
The proprocessed file is included.
This same peice of code compiles fine in Apple's branch of the gcc.
Created attachment 104808 [details]
The code seems to compile correctly against standard GCC 3.4.2 (source
compile, not a Redhat RPM).
( Although the #if !defined(__VEC__) || !defined(__ALTIVEC__)
doesn't catch in 3.4.2 like is did in 3.2.3, GCC probably added both
definitions in. Fixed this by simply commenting the line (and
including the altivec.h file by default) ).
The same code fails in gcc-3.2.3 (even with commented #if line). Can
probably assume the bug was fixed in between gcc-3.2.3 and gcc-3.4.2.
#define vector __attribute__ ((vector_size (16)))
extern int f ();
foo (vector float a, vector float b, vector float c, vector float *d)
*d = (vector float)
__builtin_altivec_vmrghw ((vector signed int) a,
(vector signed int) b);
Created attachment 105753 [details]
PR 11591 patch
This patch seems to fix this problem for me.
Should be fixed in gcc-3.2.3-47.
An advisory 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.