Menu

#2957 Reusing old, wrong value

closed-fixed
None
other
7
2023-01-10
2019-12-09
No

For the following code:

char test(char *p, int i, char c)
{
    p[0] = c;
    p[i] = 8;
    return p[0];
}

current SDCC 3.9.5 #11483 (I didn't check older versions) will always return c. I saw this bug for all ports I tried (mcs51, z80, stm8, hc08).

Apparently, the bug is introduced in a computeDataFlow (ebbi) call.

Giving this higher than default priority, since bad code is generated silently.

Philipp

Related

Wiki: SDCC 4.3.0 Release

Discussion

  • Philipp Klaus Krause

    In [r11485], I added a (currently disabled) test for this bug.

     
  • Erik Petrich

    Erik Petrich - 2023-01-10
    • status: open --> closed-fixed
    • assigned_to: Erik Petrich
     
  • Erik Petrich

    Erik Petrich - 2023-01-10

    Fixed in [r13788]

     

    Related

    Commit: [r13788]


Log in to post a comment.

MongoDB Logo MongoDB