* gcc optimizations cause compile error (SIG 6) in attached program
@ 1997-05-14 14:11 Drew Ronneberg
1997-05-14 14:49 ` Richard Henderson
0 siblings, 1 reply; 2+ messages in thread
From: Drew Ronneberg @ 1997-05-14 14:11 UTC (permalink / raw)
The following minimal program will compile fine with no optimizations, but
will fail with optimiations O, O2 and O3 with the message.
gcc: Internal compiler error: program cc1 got fatal signal 6
I have a Redhat 4.1 installization.
gcc 2.7.2.1-2
kernel 2.0.30
compiled with gcc -Wall -O -c test.c
Is this a known bug with gcc ?
Drew
drew@grieg.princeton.edu
-----program------
#define IMGSIZ 256
void write_image_bin(double **image);
void write_image_bin(double **image) {
int imageint2[IMGSIZ][IMGSIZ];
int j, k;
for (j=0;j<IMGSIZ;j++){
for(k=0;k<IMGSIZ;k++){
imageint2[k][j]=(int)image[j][k];
}
}
}
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: gcc optimizations cause compile error (SIG 6) in attached program
1997-05-14 14:11 gcc optimizations cause compile error (SIG 6) in attached program Drew Ronneberg
@ 1997-05-14 14:49 ` Richard Henderson
0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 1997-05-14 14:49 UTC (permalink / raw)
> Is this a known bug with gcc ?
Yes. The reload pass has problems with stack frames larger
than an immediate offset off the stack pointer, i.e. 32K.
While the problem is worked on, workaround by allocating big
automatic arrays with alloca instead, i.e:
#include <alloca.h>
void write_image_bin(double **image)
{
int *imageint2, j, k;
imageint2 = (int *)alloca(sizeof(int)*IMGSIZ*IMGSIZ);
for (j=0;j<IMGSIZ;j++) {
for(k=0;k<IMGSIZ;k++) {
imageint2[k*IMGSIZ+j]=(int)image[j][k];
}
}
}
r~
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1997-05-14 14:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-05-14 14:11 gcc optimizations cause compile error (SIG 6) in attached program Drew Ronneberg
1997-05-14 14:49 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox