Menu

#3045 STM8: FATAL Compiler Internal Error + SIGSEGV on simple loop

closed-fixed
None
other
5
2020-06-14
2020-06-09
No
void f()
{
    int x;
    int y;
    if (x <= y)
        do
            ;
        while (y++ < 10);
}

Compiling this with sdcc test.c -mz80 results in this :

test.c:5: warning 84: 'auto' variable 'x' may be used before initialization
test.c:5: warning 84: 'auto' variable 'x' may be used before initialization
test.c:5: warning 84: 'auto' variable 'y' may be used before initialization
test.c:6: warning 84: 'auto' variable 'y' may be used before initialization
test.c:8: error 9: FATAL Compiler Internal Error in file 'gen.c' line number '1688' : Symbol in register, but no register assigned. 
Contact Author with source code
Symbol iTemp1 at ic 2.
Caught signal 11: SIGSEGV

Tested with commit 11662.

Related

Bugs: #3036

Discussion

  • Gabriel Ravier

    Gabriel Ravier - 2020-06-09

    Note : This also crashes with sdcc test.c -ms08, with a Caught signal 11: SIGSEGV

     
  • Gabriel Ravier

    Gabriel Ravier - 2020-06-09

    Other extra note : This also crashes with sdcc test.c -mstm8, with this error message :

    test.c:5: warning 84: 'auto' variable 'x' may be used before initialization
    test.c:5: warning 84: 'auto' variable 'x' may be used before initialization
    test.c:5: warning 84: 'auto' variable 'y' may be used before initialization
    test.c:6: warning 84: 'auto' variable 'y' may be used before initialization
    iTemp1 -4 2 0 0 at ic 2
    Backtrace:
    sdcc[0x495b87]
    sdcc[0x6a2f3d]
    sdcc[0x6b9fa4]
    sdcc[0x6c5ae2]
    sdcc[0x67cfdf]
    sdcc[0x42ff0e]
    sdcc[0x447e4c]
    sdcc[0x40c13e]
    sdcc[0x40837c]
    /lib64/libc.so.6(__libc_start_main+0xf2)[0x7f0c8d21e042]
    sdcc[0x409efe]
    test.c:8: error 9: FATAL Compiler Internal Error in file 'gen.c' line number '1129' : Invalid stack offset. 
    Contact Author with source code
    iTemp1 -4 2 1 0 at ic 2
    Backtrace:
    sdcc[0x495b87]
    sdcc[0x6a2f3d]
    sdcc[0x6b9fa4]
    sdcc[0x6c5ae2]
    sdcc[0x67cfdf]
    sdcc[0x42ff0e]
    sdcc[0x447e4c]
    sdcc[0x40c13e]
    sdcc[0x40837c]
    /lib64/libc.so.6(__libc_start_main+0xf2)[0x7f0c8d21e042]
    sdcc[0x409efe]
    test.c:8: error 9: FATAL Compiler Internal Error in file 'gen.c' line number '1129' : Invalid stack offset. 
    Contact Author with source code
    test.c:8: error 9: FATAL Compiler Internal Error in file 'gen.c' line number '421' : code generator internal error 
    Contact Author with source code
    test.c:8: error 9: FATAL Compiler Internal Error in file 'gen.c' line number '421' : code generator internal error 
    Contact Author with source code
    iTemp1 -4 2 0 0 at ic 17
    Backtrace:
    sdcc[0x495b87]
    sdcc[0x6a2f3d]
    sdcc[0x6b616f]
    sdcc[0x6c5ae2]
    sdcc[0x67cfdf]
    sdcc[0x42ff0e]
    sdcc[0x447e4c]
    sdcc[0x40c13e]
    sdcc[0x40837c]
    /lib64/libc.so.6(__libc_start_main+0xf2)[0x7f0c8d21e042]
    sdcc[0x409efe]
    test.c:8: error 9: FATAL Compiler Internal Error in file 'gen.c' line number '1129' : Invalid stack offset. 
    Contact Author with source code
    iTemp1 -4 2 1 0 at ic 17
    Backtrace:
    sdcc[0x495b87]
    sdcc[0x6a2f3d]
    sdcc[0x6b616f]
    sdcc[0x6c5ae2]
    sdcc[0x67cfdf]
    sdcc[0x42ff0e]
    sdcc[0x447e4c]
    sdcc[0x40c13e]
    sdcc[0x40837c]
    /lib64/libc.so.6(__libc_start_main+0xf2)[0x7f0c8d21e042]
    sdcc[0x409efe]
    test.c:8: error 9: FATAL Compiler Internal Error in file 'gen.c' line number '1129' : Invalid stack offset. 
    Contact Author with source code
    test.c:8: error 9: FATAL Compiler Internal Error in file 'gen.c' line number '421' : code generator internal error 
    Contact Author with source code
    
     
  • Erik Petrich

    Erik Petrich - 2020-06-13

    Revision [r11667] fixes all of the problems, except for with the stm8 code generator internal error.

     
  • Maarten Brock

    Maarten Brock - 2020-06-13
    • summary: [z80] FATAL Compiler Internal Error + SIGSEGV on simple loop --> STM8: FATAL Compiler Internal Error + SIGSEGV on simple loop
     

    Related

    Wiki: z80

  • Erik Petrich

    Erik Petrich - 2020-06-14
    • status: open --> closed-fixed
    • assigned_to: Erik Petrich
     
  • Erik Petrich

    Erik Petrich - 2020-06-14

    Remainder of problem fixed with revision [r11670]

     

Log in to post a comment.

MongoDB Logo MongoDB