This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

bug with __builtin_apply on gcc > 2.7.2.3


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 */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]