Menu

#2981 SIGSEGV at for

closed-works-for-me
None
other
5
2022-04-10
2020-03-02
No

d:\Infocom\LED_clock\firmware\bug>sdcc -mmcs51 --opt-code-size --model-small --Werror --no-xinit-opt --std-sdcc99 -DPCB=PCB -DF_CPU=12000000 -c -o main.rel main.c
main.c:14: error 9: FATAL Compiler Internal Error in file '/home/sdcc-builder/build/sdcc-build/orig/sdcc/src/SDCCicode.c' line number '813' : code generator internal error
Contact Author with source code
Caught signal 11: SIGSEGV

4 Attachments

Related

Wiki: SDCC 4.3.0 Release
Wiki: SDCC-STD-UX

Discussion

  • Philipp Klaus Krause

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

    I've simplified the code sample a a bit. I see the same problem for the stm8 and z80 targets, so this doesn't seem mcs51-specific to me:

    volatile unsigned char EA;
    
    static inline void iRestore(void)
    {
    }
    
    #define A(type) for ( type,td=1; td; td = 0, iRestore() )
    #define RESTORESTATE unsigned char ea_save = EA
    
    int main(void) {
        unsigned int t;
        A(RESTORESTATE) t=0;
        return 0;
    }
    
     

    Last edit: Philipp Klaus Krause 2020-03-22
    • Philipp Klaus Krause

      Further simplification:

      static inline void iRestore(void)
      {
      }
      
      int main(void) {
          for (unsigned char td = 1; td; td = 0, iRestore());
          return 0;
      }
      
       
  • Philipp Klaus Krause

    • status: open --> closed-works-for-me
    • assigned_to: Philipp Klaus Krause
     
  • Philipp Klaus Krause

    I can't reproduce this bug in current SDCC. So I just added a regression test in [r13376].

     

    Related

    Commit: [r13376]


Log in to post a comment.

MongoDB Logo MongoDB