Menu

#3591 inline asm with c-loop error

closed-fixed
None
other
5
2023-05-19
2023-05-18
HYG
No

Compiling with
sdcc-sdcc -mz80 -c main.c

the file main.c:

void nothing(int n)
{
        n;
}

void
main()
{
        int i;
        i;

// comment the for-loop out
        for(i=10; i<18; i++){
                nothing(i);
        }
// comment the for-loop out


__asm
00001$:
        call _nothing
        jr 00001$
        ret
__endasm;
}

gets the error:
main.c:25: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'00001$:'

If you comment the for-loop out the error message dissapears.

It's probably a bug.
The error appears only in combination with a c-loop.

Best regards.
Harry

1 Attachments

Related

Wiki: NGI0-Entrust-SDCC

Discussion

  • HYG

    HYG - 2023-05-18

    It's a old bug.
    Have a look at:
    https://sourceforge.net/p/sdcc/bugs/2977/

    And was obviosly not fixed with: [r13121]

     
  • Philipp Klaus Krause

    Which version of sdcc did you use? On which host platform? Neither this code nor the one from [bugs:#2977] give me the error using current sdcc from svn on my Debian GNU/Linux testing system.

     

    Related

    Bugs: #2977

  • HYG

    HYG - 2023-05-19

    I' working on a Fedora 37 Workstation. It's sdcc version is 4.1.0.
    There is the same problem with the new compiled 4.2.0 version.

    Same with https://sourceforge.net/p/sdcc/bugs/2977/

     
    • Philipp Klaus Krause

      So this likely is indeed a duplicate of [bugs:#2977], which got fixed in [r13121]. The 4.2.0 release was in late March 2022, the fix in early May 2022.

       

      Related

      Bugs: #2977

  • HYG

    HYG - 2023-05-19

    Oh, o.k. Philipp, thank's a lot.
    There is no stable release with the fix.
    So I had to use the snapshot?

    Greetings Harry

     
    • Philipp Klaus Krause

      Snapshot or compile from svn trunk.
      They should be quite stable now (we haven't had any big changes recently, and are preparing for the 4.3.0 release, though there is no official release candidate yet).

       
  • Maarten Brock

    Maarten Brock - 2023-05-19
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -2,12 +2,11 @@
     sdcc-sdcc -mz80 -c main.c
    
     the file main.c:
    -
    +~~~
     void nothing(int n)
     {
             n;
     }
    -
    
     void
     main()
    @@ -29,7 +28,7 @@
             ret
     __endasm;
     }
    -
    +~~~
     gets the error:
     main.c:25: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
     &#39;00001$:&#39;
    
     
  • Philipp Klaus Krause

    • status: open --> closed-fixed
    • assigned_to: Philipp Klaus Krause
     

Log in to post a comment.

MongoDB Logo MongoDB