Thread View: gnu.gcc.bug
2 messages
2 total messages
Started by Beau Paisley
Sat, 25 Jul 1992 00:16
bug in gcc2.2.2, please acknowledge.
Author: Beau Paisley
Date: Sat, 25 Jul 1992 00:16
Date: Sat, 25 Jul 1992 00:16
27 lines
950 bytes
950 bytes
We have sent this bug message 3 times. Please
acknowledge, and suggest a work-around.
/* When you execute this program it generates an illegal instruction message */
/* No syntax error is given for the illegal allocation syntax */
extern "C" void exit( int );
int test(int j)
{
return( 0 );
}
main( )
{
int n=4;
double x[n]; /* This seems to be the statement that gcc goofs up */
/* The c++ version of gcc messes it up also */
int i;
i= test(0);
exit(0);
}
Beau Paisley
apl/uw
206-367-0599
Re: bug in gcc2.2.2, please acknowledge.
Author: Colin Plumb
Date: Fri, 24 Jul 1992 23:57
Date: Fri, 24 Jul 1992 23:57
88 lines
2483 bytes
2483 bytes
In article <9207250016.AA02921@bass.noname> paisley@bass.ai.mit.EDU (Beau Paisley) writes:
>/* When you execute this program it generates an illegal instruction message */
>/* No syntax error is given for the illegal allocation syntax */
>
>extern "C" void exit( int );
>
>int test(int j)
>{
> return( 0 );
>}
>
>main( )
>{
> int n=4;
> double x[n]; /* This seems to be the statement that gcc goofs up */
> /* The c++ version of gcc messes it up also */
> int i;
> i= test(0);
>
> exit(0);
>}
To save people the trouble of flaming for a proper bug report, I have
duplicated this error on gcc 2.2.2 for a SPARC.
Reading specs from /gnu/lib/gcc-lib/sun4/2.2.2/specs
gcc version 2.2.2
/gnu/lib/gcc-lib/sun4/2.2.2/cpp -lang-c -v -undef -D__GNUC__=2 -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix /tmp/bug.c /usr/tmp/cca11767.i
GNU CPP version 2.2.2 (sparc)
/gnu/lib/gcc-lib/sun4/2.2.2/cc1 /usr/tmp/cca11767.i -quiet -dumpbase bug.c -version -o /usr/tmp/cca11767.s
GNU C version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
as -o bug.o /usr/tmp/cca11767.s
/gnu/lib/gcc-lib/sun4/2.2.2/ld -e start -dc -dp /lib/crt0.o -L/gnu/lib/gcc-lib/sun4/2.2.2 -L/gnu/lib bug.o -lgcc -lc -lgcc
The resultant a.out file dumps core with an illegal instruction error.
The assembler produced is
gcc2_compiled.:
.text
.align 4
.global _test
.proc 04
_test:
!#PROLOGUE# 0
save %sp,-112,%sp
!#PROLOGUE# 1
st %i0,[%fp+68]
mov 0,%i0
b,a L1
L1:
ret
restore
.align 4
.global _main
.proc 04
_main:
!#PROLOGUE# 0
save %sp,-144,%sp
!#PROLOGUE# 1
call ___main,0
nop
mov %sp,%l2
mov 4,%o0
st %o0,[%fp-20]
ld [%fp-20],%o0
add %o0,-1,%l0
add %l0,1,%l1
sll %l1,6,%o0
mov %o0,%l1
add %l0,1,%o1
sll %o1,3,%o0
add %sp,116,%o2
sub %o2,%sp,%o1
add %o0,%o1,%o0
sub %sp,%o0,%sp
add %sp,116,%l3
mov 0,%o0
call _test,0
nop
st %o0,[%fp-24]
mov 0,%o0
call _exit,0
nop
mov %l2,%sp
L2:
ret
restore
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads