This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc miscompiles its sources (boehm-gc)
- To: gcc at gcc dot gnu dot org
- Subject: Re: gcc miscompiles its sources (boehm-gc)
- From: Martin Kahlert <martin dot kahlert at infineon dot com>
- Date: Thu, 18 Oct 2001 11:21:48 +0200
- References: <20011018103045.A2114@keksy.muc.infineon.com>
- Reply-To: martin dot kahlert at infineon dot com
Sorry to reply to my own message, but i finally found a small testcase
(i filed a gnats report, but i do not know whether it came through).
Here it is:
$ cat t.c
#include <stdio.h>
struct exclusion
{
int a1;
int array[5];
} Table;
int *f(int start)
{
return Table.array + start;
}
int main(int argc, char *argv[])
{
int *next;
if ( argc == 2 )
next = f(atoi(argv[1]));
else
next = f(0);
printf("next = %p, Table.array = %p, diff = %d\n",
next, Table.array, next-Table.array);
return 0;
}
$ gcc -O -o t t.c
$ ./t
next = 0x8049710, Table.array = 0x8049710, diff = 2
seems to be wrong a bit.
Bye,
Martin.
--
The early bird catches the worm. If you want something else for
breakfast, get up later.