http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59946
Bug ID: 59946
Summary: -mpcrel -O2 produces illegal asm code
Product: gcc
Version: 4.6.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: miro.kropacek at gmail dot com
int copyNextDtaToAtari(void);
char fsnextIsForUs;
int custom_fsnext( void *sp )
{
int res;
if(!fsnextIsForUs) {
return 0;
}
res = copyNextDtaToAtari();
return res;
}
If you compile this code with:
m68k-atari-mint-gcc -m68000 -mpcrel -O2 -c example.c
you'll get:
/tmp/ccqdKUHi.s:7: Error: syntax error -- statement `cmp.b
#0,(_fsnextIsForUs:w,%pc).l' ignored
For some reason, there's that ".l" suffix which is not understood by binutils
(2.23.2). Goes away with -O0.