Line 13 isn’t signed and there is no reason for unsigned char d; to show up.
.lst and .rst are just listings for the assembly. If something does not translate into assembly or if gets optimized away, it will not show up.
.cdb is the more interesting file for tracking variables, but with optimizations enabled even this one will lack what got optimized away.

But it still optimizes, rewrites and rearranges the assembly, which can break line assignments, the more optimizations you turn off, the better your results should be:
sdcc --debug --no-peep --nooverlay --nogcse --noinvariant --nolabelopt --noloopreverse --noinduction test2.