Menu

#2793 Compiling FatFs with FF_USE_MKFS defined

closed-fixed
None
redundancy elimination
7
2019-03-21
2018-08-04
No

Compiling current FatFs R0.13b with current SDCC 3.7.1 #10498 fails when FF_USE_MKFS is defined.
I tracked the issue down to the funktion f_mkfs. The attached file contains a simplified version of ff.c, which reproduces the bug (but still needs the headers from FatFs).

1 Attachments

Related

Support Requests: #116

Discussion

  • Philipp Klaus Krause

    • Attachments has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +0,0 @@
    -ff.c (24.2 kB; text/x-csrc)
    
     
  • Philipp Klaus Krause

    • Attachments has changed:

    Diff:

    --- old
    +++ new
    @@ -0,0 +1 @@
    +ff.c (21.8 kB; text/x-csrc)
    
     
  • Philipp Klaus Krause

    • Attachments has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +0,0 @@
    -ff.c (21.8 kB; text/x-csrc)
    
     
  • Philipp Klaus Krause

    • Attachments has changed:

    Diff:

    --- old
    +++ new
    @@ -0,0 +1 @@
    +ff.c (16.4 kB; text/x-csrc)
    
     
  • Philipp Klaus Krause

    • Category: STM8 --> other
     
  • Philipp Klaus Krause

    This fails for z80, too (but apaprently not mcs51 or hc08).

    Philipp

     
    • Philipp Klaus Krause

      Actually, for mcs51 with --stack auto, there is no assertion failure at compile time, but wrong code is generated silenty.

       
  • Philipp Klaus Krause

    Apparently, the iCode at register allocation is already wrong (looking at --dump-ralloc output). It pushes an unsigned long paramter, where the mem_set() expects an unsigned int. So we push 2 more bytes of parameters than we readjust the stack after the call for.

    Philipp

     
  • Philipp Klaus Krause

    • Category: other --> redundancy elimination
     
  • Philipp Klaus Krause

    dumpraw1 is still correct, dumpcse is already wrong, so this is probably a bug in CSE.

    Philipp

     
  • Philipp Klaus Krause

    • Priority: 5 --> 6
     
  • Philipp Klaus Krause

    dumpraw1 is correct, dumpcse is alredy wrong, so this is a bug in CSE.

    Philipp

     
  • Philipp Klaus Krause

    In [r10500], I added a (disabled by #if 0 until the bug is fixed) regression test for this bug.

    Philipp

     
  • Philipp Klaus Krause

    • summary: Compiling FatFs with FF_USE_MKFS defined failsfor stm8 --> Compiling FatFs with FF_USE_MKFS defined
     
  • Philipp Klaus Krause

    • Priority: 6 --> 7
     
  • Erik Petrich

    Erik Petrich - 2019-03-21
    • status: open --> closed-fixed
    • assigned_to: Erik Petrich
     
  • Erik Petrich

    Erik Petrich - 2019-03-21

    Fixed in [r11130]

     

Log in to post a comment.

MongoDB Logo MongoDB