diff --git a/acinclude.m4 b/acinclude.m4 index 3ae1ec55..ff5e51d7 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -482,14 +482,25 @@ GMP_PROG_CC_WORKS_PART([$1], []) GMP_PROG_CC_WORKS_PART_MAIN([$1], [gcc-4.3.2 on 64bit is bad], [/* The following aborts with gcc-4.3.2 on a 64bit system which is an unusable compiler */ -int main(){ -#ifdef __GNUC__ -#if __GNUC__ == 4 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ == 2 -int *p; -if(sizeof(p)==8)abort(); +#if defined(__GNUC__) +int __attribute__((noinline)) +foo(int i) +{ + int *p = __builtin_malloc (4 * sizeof(int)); + *p = 0; + p[i] = 1; + return *p; +} +extern void abort (void); +int main() +{ + if (foo(0) != 1) + abort (); + return 0; +} +#else +int main(){return 0;} #endif -#endif -return 0;} ]) GMP_PROG_CC_WORKS_PART([$1], [function pointer return],