Le jeudi 09 décembre 2010 à 15:23 -0800, Dave Pagan a écrit :
> Yes, this appears to be a known problem, but I can't tell for sure
> without a reduced test case of some sort. If you can provide a small
> example I can verify whether we've seen this before.
Ok, I've got one.
Cut the following into main.c:
=========================================================
#include <stdlib.h>
int compute(unsigned int start, unsigned char *code)
{
static void *jumps[] = { && OP_EVEN, && OP_ODD };
unsigned int i = start;
while (i > 1) {
goto *jumps[i & 1];
OP_EVEN:
i = i / 2;
continue;
OP_ODD:
i = 3 * i + 1;
continue;
}
return i;
}
int main(int argc, char **argv)
{
unsigned int n;
n = compute(0x12345, (unsigned char *) argv[0]);
/* Do something with it */
exit(n);
}
=========================================================
Then:
$ cc -xO4 -xipo=2 -xipo_archive=writeback -o main main.c
Undefined first referenced
symbol in file
.XB$BAABswhAN0$F.compute..L19 main.o
.XB$BAABswhAN0$F.compute..L20 main.o
ld: fatal: symbol referencing errors. No output written to main
Regards
Antoine.
_______________________________________________
tools-compilers mailing list
[email protected]