This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
bug with __builtin_apply on gcc > 2.7.2.3
- To: gcc-help at gcc dot gnu dot org
- Subject: bug with __builtin_apply on gcc > 2.7.2.3
- From: Mike Heffner <spock at techfour dot net>
- Date: Fri, 01 Oct 1999 22:52:08 -0400 (EDT)
Hi,
I'm using a program that uses nested __builtin_apply calls (a function called
with __builtin_apply calls another function with __builtin_apply). the program
builds and runs fine with gcc 2.7.2.3, but when i use gcc 2.8.1, it will
compile fine, but will SIGFPE(floating point exception) during runtime when it
returns from
the second function called with __builtin_apply(). i've tried to look at the
gcc code, but couldn't find anything relevant to the problem.
does anyone know how to fix this? has anyone else experienced this bug and know
a workaround(other than not using __builtin_apply)?
attached is a short program that demonstrates the problem.
thanks,
---------------------------------
Mike Heffner <spock@techfour.net>
Fredericksburg, VA
ICQ# 882073
Date: 01-Oct-99 Time: 22:49:43
---------------------------------
/* example.c - spock@techfour.net */
#include <stdio.h>
int fb(int);
int fc(int);
int fa (int a){
printf("(fa) blah = %d\n", a);
a++;
__builtin_apply( (void (*)())fb, __builtin_apply_args(), 32);
return 1;
}
int fb (int b){
printf("(fb) blah = %d\n", b);
b++;
__builtin_apply( (void (*)())fc, __builtin_apply_args(), 32);
return 1;
}
int fc(int c){
printf("(fc) blah = %d\n", c);
return 1;
/* program will crash immediately after returning from this
* function */
}
main(){
int blah=1;
fa(blah);
}
/* end example.c */