Menu

#2051 Error 9 FATAL Compiler Internal Error

closed-fixed
8
2013-05-25
2012-06-23
No

SDCC 3.2.0 Release Candidate generates:

error 9: FATAL Compiler Internal Error in file '/home/sdcc-builder/build/sdcc-build/orig/sdcc/src/mcs51/gen.c' line number '8963' : code generator internal error
Contact Author with source code

for the code below that compiled fine with SDCC 3.1.0. I'm looking into it,but I think this must be fixed before the release.

int globals[16];

int testBug(unsigned char index)
{
return *(globals+index);
}

Discussion

  • Maarten Brock

    Maarten Brock - 2012-06-23

    This wassert was added by Philipp in #7628 to:
    genLeftShiftLiteral in mcs51/gen.c
    genRightShiftLiteral in z80/gen.c

    But I don't understand why only for LeftShift in mcs51 and only for RightShift in z80.

    And without the wassert the mcs51 generates correct code (for unsigned char index). So I was inclined to remove it again. Or move it to RightShift. But for signed char index the code is wrong.

     
  • Philipp Klaus Krause

    I had been hunting down another bug. After I finally had tracked it down, I noticed that in z80 port, in genRightShiftLiteral() in a place were there was a comment "/* I suppose that the left size >= result size */" had there been an assertion that had checked what the comment stated, I would have found the bug much earlier. So I added the assertion there. Then I noticed there was another such comment "/* I suppose that the left size >= result size */" in the cs51 port, genLeftShiftLiteral(). Adding the assertion caused no regression failures, so I thought it would be a good idea to add an assertion to check for what the comment states.

    Philipp

     
  • Maarten Brock

    Maarten Brock - 2012-06-23

    Well, the weird thing is that this comment is in both the mcs51 and the z80 port and in both genLeftShiftLiteral and genRightShiftLiteral but the assertion is only in two unrelated places.

    I suggest to remove the assertion in mcs51 now (before the release) as it breaks previously correctly generated code. Then keep this item open until the underlying problem is really fixed and the assertions can appear at all assumption comments.

     
  • Maarten Brock

    Maarten Brock - 2012-07-19
    • milestone: --> fixed
    • status: open --> closed-fixed
     
  • Maarten Brock

    Maarten Brock - 2012-07-19

    Fixed in SDCC 3.2.1 #8049.

    I've also put back the assertions in both mcs51 and z80 and both genLeftShiftLiteral and genRightShiftLiteral.

     

Log in to post a comment.