Menu

#55 unistd_getopt.c won't build for 68k with gcc 3.4.6

v1.0_(example)
open
None
5
2015-01-13
2015-01-05
Chris Young
No

The error log is as follows:

Compiling unistd_getopt.c [large_data_020:c]
/tmp/ccrQcqYy.s: Assembler messages:
/tmp/ccrQcqYy.s:36: Error: parse error -- statement cmpl (sp.0),d0' ignored /tmp/ccrQcqYy.s:58: Error: parse error -- statementmovel (sp.0),a0' ignored
/tmp/ccrQcqYy.s:86: Error: parse error -- statement addql #1,(sp.0)' ignored /tmp/ccrQcqYy.s:89: Error: parse error -- statementmovel (sp.0),a0' ignored
/tmp/ccrQcqYy.s:94: Error: parse error -- statement movel d0,(sp.0)' ignored /tmp/ccrQcqYy.s:104: Error: parse error -- statementaddl (sp.0),a0' ignored
/tmp/ccrQcqYy.s:129: Error: parse error -- statement movel d0,(sp.0)' ignored /tmp/ccrQcqYy.s:139: Error: parse error -- statementmovel d0,(sp.0)' ignored
/tmp/ccrQcqYy.s:143: Error: parse error -- statement addql #1,(sp.0)' ignored /tmp/ccrQcqYy.s:146: Error: parse error -- statementmovel (sp.0),a0' ignored
/tmp/ccrQcqYy.s:150: Error: parse error -- statement `movel d0,(sp.0)' ignored
make[2]: *** [large_data_020/libc_objs/unistd_getopt.o] Error 1

This can be fixed by changing the name of the variable "sp" in that file to something else (I used spp).

It appears this version of gcc gets confused with static variables that are named the same as registers.

Related

Bugs: #55

Discussion

  • Olaf Barthel

    Olaf Barthel - 2015-01-13

    Wow! Thank you for getting to the bottom of this. This is the strangest bug I’ve become aware of in years. Is it really only this particular file, or are other files affected as well? The name of a variable should not affect the assembly language code at all. What did you change the name of the variable to? Does the problem appear only if it’s called “sp”, or might it be the length of the name which triggers this problem?

    I haven’t compiled the library for a 68k target using a more modern GCC version. I’m still stuck with the GCC v2 which I built natively using clib2 itself. Where can I find the compiler version you used, so that I might reproduce the problem after fixing it?

     
  • Olaf Barthel

    Olaf Barthel - 2015-01-13
    • assigned_to: Olaf Barthel
     
  • Olaf Barthel

    Olaf Barthel - 2015-01-13

    Am 05.01.2015 um 13:45 schrieb Chris Young chris_y@users.sf.net:

    [bugs:#55] http://sourceforge.net/p/clib2/bugs/55 unistd_getopt.c won't build for 68k with gcc 3.4.6

    Status: open
    Group: v1.0_(example)
    Created: Mon Jan 05, 2015 12:45 PM UTC by Chris Young
    Last Updated: Mon Jan 05, 2015 12:45 PM UTC
    Owner: nobody

    The error log is as follows:

    Compiling unistd_getopt.c [large_data_020:c]
    /tmp/ccrQcqYy.s: Assembler messages:
    /tmp/ccrQcqYy.s:36: Error: parse error -- statement cmpl (sp.0),d0' ignored /tmp/ccrQcqYy.s:58: Error: parse error -- statementmovel (sp.0),a0' ignored
    /tmp/ccrQcqYy.s:86: Error: parse error -- statement addql #1,(sp.0)' ignored /tmp/ccrQcqYy.s:89: Error: parse error -- statementmovel (sp.0),a0' ignored
    /tmp/ccrQcqYy.s:94: Error: parse error -- statement movel d0,(sp.0)' ignored /tmp/ccrQcqYy.s:104: Error: parse error -- statementaddl (sp.0),a0' ignored
    /tmp/ccrQcqYy.s:129: Error: parse error -- statement movel d0,(sp.0)' ignored /tmp/ccrQcqYy.s:139: Error: parse error -- statementmovel d0,(sp.0)' ignored
    /tmp/ccrQcqYy.s:143: Error: parse error -- statement addql #1,(sp.0)' ignored /tmp/ccrQcqYy.s:146: Error: parse error -- statementmovel (sp.0),a0' ignored
    /tmp/ccrQcqYy.s:150: Error: parse error -- statement `movel d0,(sp.0)' ignored
    make[2]: *** [large_data_020/libc_objs/unistd_getopt.o] Error 1

    This can be fixed by changing the name of the variable "sp" in that file to something else (I used spp).

    It appears this version of gcc gets confused with static variables that are named the same as registers.

    Wow! Thank you for getting to the bottom of this. This is the strangest bug I’ve become aware of in years. Is it really only this particular file, or are other files affected as well? The name of a variable should not affect the assembly language code at all. What did you change the name of the variable to? Does the problem appear only if it’s called “sp”, or might it be the length of the name which triggers this problem?

    I haven’t compiled the library for a 68k target using a more modern GCC version. I’m still stuck with the GCC v2 which I built natively using clib2 itself. Where can I find the compiler version you used, so that I might reproduce the problem after fixing it?

    --
    Home: Olaf Barthel, Gneisenaustrasse 43, D-31275 Lehrte
    Net: obarthel@gmx.net

     

    Related

    Bugs: #55


Log in to post a comment.