sdcc version 4.2.0
The bug detail is in discussion [40f8feabc7]
the exact command is
sdcc -c buf-x.c --stack-auto
Discussion: 40f8feabc7
Discussion: Wrong complier with struct
This looks like [#3607] to me, which has been fixed.
Related
Bugs:
#3607Though similar it is not the same as [#3607]. Here the problem occurs in genCast.
Related
Bugs:
#3607Diff:
Related
Discussion: 40f8feabc7