Sdcc generates wrong code for condition with conditional operator.
- result of rows 57-61 is: acc is set if param a is nonzero. Then, on 62-65, acc is compared with result of conditional expression. This works wrong for flag=1 and a>1.
int f(char a, char flag)
if (a == (flag ? 1 : 0))
Log in to post a comment.