Menu

#3764 "FATAL Compiler Internal Error" using minimp3

open
nobody
None
MCS51
5
2024-07-24
2024-07-23
No

The following error occurs when I include minimp3.h.

minimp3/minimp3.h:379: warning 116: left shifting more than size of object changed to zero
minimp3/minimp3.h:649: warning 116: left shifting more than size of object changed to zero
minimp3.h:876: error 9: FATAL Compiler Internal Error in file '/home/sdcc-builder/build/sdcc-build/orig/sdcc/src/SDCCopt.c' line number '312' : 0
Main.c:5: fatal error: when writing output to : Invalid argument
        5|
           | 

minimp3.h is from https://github.com/lieff/minimp3
sdcc version: 4.4.0

4 Attachments

Discussion

  • Philipp Klaus Krause

    I don't see the compiler error (after changing 8052.H to 8052.h) using sdcc from current svn trunk on Debian GNU/Linux testing:

    philipp@notebook6:/tmp$ sdcc -mmcs51 --std-c23 Main.c 
    minimp3.h:379: warning 116: left shifting more than size of object changed to zero
    minimp3.h:649: warning 116: left shifting more than size of object changed to zero
    ?ASlink-Error-Could not get 18866 consecutive bytes in internal RAM for area DSEG.
    

    Can you try with SDCC from svn trunk or a current snapshot from https://sdcc.sourceforge.net/snap.php?

    P.S.: regarding the warnings: those look like a bug in minimp3 to me: https://github.com/lieff/minimp3/issues/122

     

    Last edit: Philipp Klaus Krause 2024-07-24
    • Yongjian Wang

      Yongjian Wang - 2024-07-24

      Yes, when I use http://sourceforge.net/projects/sdcc/files/snapshot_builds/x86_64-w64-mingw32/sdcc-snapshot-x86_64-w64-mingw32-20240723-14927.zip The same error occurred while compiling on Windows.
      How can I make the compiler ignore the size of RAM? This code can be compiled normally on Keil (although the generated code is very long)

       
      • Maarten Brock

        Maarten Brock - 2024-07-24

        If you can compile and link this with Keil then you probably selected the correct memory model there. The same will have to be done for SDCC. The default small memory model will try to put all variables in data memory which is max 120 bytes and thus 18866 will never fit.
        But even with --model-large you need 836 bytes for spilling of intermediate variables in those 120 bytes.
        Going one step further using --stack-auto it still needs more than 256 bytes on stack. Even --xstack will not help you here.
        This software is way too large for an mcs51-compatible when compiled with SDCC.
        You will either have to rewrite it to make it fit using every trick in your book or just forget about it.

         

Log in to post a comment.