do a proper test for bad gcc-4.3.2

This commit is contained in:
jasonmoxham 2012-06-09 06:52:30 +00:00
parent d706c8c3b7
commit 393a060a9e

View File

@ -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],