This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
C gcc-3.0 compiler crash
- To: gcc-bugs at gcc dot gnu dot org
- Subject: C gcc-3.0 compiler crash
- From: Nicola Pero <n dot pero at mi dot flashnet dot it>
- Date: Thu, 8 Mar 2001 02:31:20 +0100 (CET)
- Reply-To: Nicola Pero <n dot pero at mi dot flashnet dot it>
Hi - while trying to build a testcase for some [obscure] Objective-C code
I have which crashes gcc-3.0, I realized the whole thing does not seem
particularly Objective-C specific, as the C compiler crashes as well.
leonardo:~/gcc-3.0/gcc/testsuite/objc/execute$ gcc nested-3.c
/tmp/ccSXG4Kj.o: In function `test_function':
/tmp/ccSXG4Kj.o(.text+0x5a): undefined reference to `nested.0'
collect2: ld returned 1 exit status
leonardo:~/gcc-3.0/gcc/testsuite/objc/execute$
leonardo:~/gcc-3.0/gcc/testsuite/objc/execute$ gcc -DVARIANT nested-3.c
nested-3.c: In function `test_function':
nested-3.c:33: Internal compiler error in assign_stack_temp_for_type, at
function.c:663
Please submit a full bug report, with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
leonardo:~/gcc-3.0/gcc/testsuite/objc/execute$
int test_function (int argument)
{
typedef struct
{
int val[argument];
} block;
inline block nested ()
{
unsigned i;
block result;
for (i = 0; i < argument; i++)
{
result.val[i] = i + 1;
}
return result;
}
#ifndef VARIANT
block result;
result = nested ();
return result.val[0];
#else /* Compile with -DVARIANT to get a different compiler crash */
return (nested ()).val[0];
#endif
}
int main (void)
{
if (test_function (5) != 1)
{
abort ();
}
return 0;
}