This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: linux + usemorebits: gcc error?
- From: Hugo van der Sanden <hv at crypt dot compulink dot co dot uk>
- To: gcc-bugs at gcc dot gnu dot org
- Cc: perl5-porters at perl dot org, hv at crypt0 dot demon dot co dot uk
- Date: Wed, 12 Jun 2002 21:12:48 +0100
- Subject: Re: linux + usemorebits: gcc error?
- Reply-to: hv at crypt0 dot demon dot co dot uk
Earlier I told p5p:
:Build and make test worked fine with normal options, but adding
:-Dusemorebits gave me:
: CCCMD = cc -DPERL_CORE -c -DDEBUGGING -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -g -O6 -Wall
:perlio.c: In function `PerlIORaw_pushed':
:perlio.c:1050: Unrecognizable insn:
:(insn/i 247 246 248 (set (reg:SI 85)
: (mem/s:SI (plus:SI (mult:SI (subreg:SI (reg:DI 78) 0)
: (const_int 8 [0x8]))
: (reg:SI 84)) 0)) -1 (insn_list 246 (nil))
: (expr_list:REG_DEAD (reg:SI 84)
: (nil)))
:perlio.c:1050: confused by earlier errors, bailing out
:make: *** [perlio.o] Error 1
:
:Version is perl patchlevel @17185; command was:
: ( ./Configure -des -Dprefix=/opt/ldblead -Doptimize='-g -O6' -Dusedevel -Uversiononly -Dusemorebits && make test ) 2>&1 | tee zz
The problem seems to be caused by the O3 optimiser and specific to
long longs. Here's the smallest gcc test case I could come up with:
crypt% cat subperlio.c
typedef struct { int kind; } t_1;
typedef struct { t_1 *funcs; } t_2;
typedef struct { t_2 *array; } t_3;
typedef struct s_4 {
struct s_4 *next;
int flags;
} t_4;
extern t_1 *v_1;
extern t_3 *v_3;
void f_1(t_4 *f);
void f_2(int kind);
t_1 *f_3(long long n) {
if (n < (long long)v_1->kind)
f_2(v_3->array[(int)n].funcs->kind);
return (t_1*)0;
}
t_1 *f_4(int n) {
if (n < 0)
n += v_1->kind;
return f_3((long long)n);
}
void f_5(t_4 *f) {
while (((long long)f->flags) & 1) {
if (&(f->next)) {
f_1(f);
} else {
(void)f_4(0);
}
}
}
crypt% cc -o subperlio.o subperlio.c -O2 -c
crypt% cc -o subperlio.o subperlio.c -O3 -c
subperlio.c: In function `f_5':
subperlio.c:36: Unrecognizable insn:
(insn/i 74 73 75 (set (reg:SI 58)
(mem/s:SI (plus:SI (mult:SI (subreg:SI (reg:DI 49) 0)
(const_int 4 [0x4]))
(reg:SI 57)) 4)) -1 (insn_list 73 (nil))
(expr_list:REG_DEAD (reg:SI 57)
(nil)))
subperlio.c:36: confused by earlier errors, bailing out
crypt%
Here's some system details:
crypt% gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-81)
crypt% cat /etc/redhat-release
Red Hat Linux release 7.1 (Seawolf)
crypt% cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 4
model name : AMD Athlon(tm) Processor
stepping : 2
cpu MHz : 1247.989
cache size : 256 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 vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr syscall mmxext 3dnowext 3dnow
bogomips : 2490.36
crypt%
For p5p: I'll see if I can come up with a workaround to avoid the failure,
but failing that I guess we'll need to drop to -O2 or less for perlio.c
under these conditions (ie, I guess, +perlio, +use64bitint, gcc v2.96).
Hope this helps,
Hugo van der Sanden