Menu

#4045 Three mcs51 large & huge const propagation failures

closed-fixed
None
other
5
2026-07-27
2026-07-21
No

In the regression tests three tests fail with a crash in SDCCgenconstprop.cc line 1402 for mcs51 large & huge model.

/home/sdcc-builder/build/sdcc-build/orig/sdcc/support/regression/cases/../tests/gcc-torture-execute-990804-1.c:39: error 9: FATAL Compiler Internal Error in file '/home/sdcc-builder/build/sdcc-build/orig/sdcc/src/SDCCgenconstprop.cc' line number '1402' : code generator internal error 
Contact Author with source code
gmake[5]: *** [Makefile:437: gen/mcs51-large/tst_gcc-torture-execute-990804-1.rel] Fehler 1
results/mcs51-large/tst_gcc-torture-execute-990804-1.out:2:--- FAIL: cannot compile/link cases/tst_gcc-torture-execute-990804-1.c

/home/sdcc-builder/build/sdcc-build/orig/sdcc/support/regression/cases/../tests/gcc-torture-execute-divmod-1.c:14: error 9: FATAL Compiler Internal Error in file '/home/sdcc-builder/build/sdcc-build/orig/sdcc/src/SDCCgenconstprop.cc' line number '1402' : code generator internal error 
Contact Author with source code
gmake[5]: *** [Makefile:437: gen/mcs51-large/tst_gcc-torture-execute-divmod-1.rel] Fehler 1
results/mcs51-large/tst_gcc-torture-execute-divmod-1.out:2:--- FAIL: cannot compile/link cases/tst_gcc-torture-execute-divmod-1.c

cases/onebyte/onebyte_attrL_volatile_attrR_none.c:40: error 9: FATAL Compiler Internal Error in file '/home/sdcc-builder/build/sdcc-build/orig/sdcc/src/SDCCgenconstprop.cc' line number '1402' : code generator internal error 
Contact Author with source code
gmake[6]: *** [Makefile:437: gen/mcs51-large/onebyte/onebyte_attrL_volatile_attrR_none.rel] Fehler 1
results/mcs51-large/onebyte/onebyte_attrL_volatile_attrR_none.out:2:--- FAIL: cannot compile/link cases/onebyte/onebyte_attrL_volatile_attrR_none.c

Related

Patches: #506

Discussion

  • Philipp Klaus Krause

    I can reproduce the issue on my Debian GNU/Linux testing system using SDCC built from current svn trunk.

     

    Last edit: Philipp Klaus Krause 2026-07-23
  • Philipp Klaus Krause

    The quick and easy way would be to just re-disable the assertion for mcs51. The better way would be to find out why we get the corrupted iTemp usage information for mcs51 in the first place.

     
  • Philipp Klaus Krause

    Small code sample to reproduce the issue:

    int gfbyte ( void ) 
    {
     return 0;
    } 
    
    void
    f (void)
    {
     int i,k ;
    
     i = gfbyte();
    
     i = i + 1 ;
    
     if ( i == 0 ) 
         k = -0 ;
     else
         k = i + 0 ;
    
     if (i != 1)
       return;
    }
    
     
    • Philipp Klaus Krause

      This case (and gcc-torture-execute-990804-1) is fixed in [r16724]. It was an issue in deleteIfx in SDCClabel.c corrupting OP_USES.

      The other two tests still fail.

       

      Related

      Commit: [r16724]


      Last edit: Philipp Klaus Krause 2026-07-27
  • Philipp Klaus Krause

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

    Last part of the bug fixed in [r16725]. CSE could introduce iCodes not in iCodehTab.

     

    Related

    Commit: [r16725]


Log in to post a comment.