#2210 gcc-torture-execute-20030714-1 fails with invalid instruction for stm8

closed-duplicate
nobody
None
sdld
5
2013-09-02
2013-09-01
Erik Petrich
No

Regression test gcc-torture-execute-20030714-1 has recently (somewhere around revision 8825) started failing for stm8 with an invalid instruction encountered during simulation. The program counter was 0x89 at the point where simulation was terminated, so execution has jumped outside of the actual code area.

Discussion

  • I didn't look into the deatils of this bug, bt bug #2198 results in similar failures, so this might be the same underlying issue.

    Philipp

     
  • Erik Petrich
    Erik Petrich
    2013-09-01

    It is definitely an assembler/linker level problem. Here is where things go wrong. The .lst file from the assembler shows:

                                    463 ; genPointerSet
      000147 A6rF7            [ 1]  464         ld      a, #<_RenderBox_isTableCell
      000149 E7 01            [ 1]  465         ld      (0x1, x), a
      00014B A6s00            [ 1]  466         ld      a, #>_RenderBox_isTableCell
      00014D F7               [ 1]  467         ld      (x), a
                                    469 ; genAddrOf
      00014E AEr00r12         [ 2]  470         ldw     x, #_g__style+0
    

    and after linking, the .rst file from the linker shows:

                                    463 ; genPointerSet
      0083B8 A6 00            [ 1]  464         ld      a, #<_RenderBox_isTableCell
      0083BA 68 E7            [ 1]  465         ld      (0x1, x), a
      0083BC 01 A6            [ 1]  466         ld      a, #>_RenderBox_isTableCell
      0083BE 00               [ 1]  467         ld      (x), a
                                    469 ; genAddrOf
      0083BF 83 F7 AE         [ 2]  470         ldw     x, #_g__style+0
    

    The map file shows RenderBox_isTableCell is at address 0x8368, so I think it's inserting a 16-bit relocation result where there should only be an 8-bit result.

     
  • Erik Petrich
    Erik Petrich
    2013-09-01

    • Category: STM8 --> sdld
     
  • Erik Petrich
    Erik Petrich
    2013-09-02

    • status: open --> closed-duplicate
     
  • Erik Petrich
    Erik Petrich
    2013-09-02

    Yes, this is exactly the same problem as bug #2198, but bug #2198 is incorrectly characterized as a byte ordering problem. I'll close this one and add some notes to #2198.