Hello SDCC team,
MSVC complains about this in tree_dec_ralloc_forget():
unsigned short int i = *(old_inst.begin());
If the list is empty, the dereference is not valid, and crashes msvc in debug mode,
which is correct, as you cannot dereference an empty list.
What is the correct fix here? Return? Default value for "i" ?
Thanks,
/pedro
I can reproduce the issue of an empty set on my Debian GNU/Linux with divuint.c from the standard library when compiling for hc08 , and on atof.c when compiling for stm8.
There is no correct fix here. I'll place a wassert(old_inst.size() == 1); before that line, once I have found and fixed why the set is empty.
Philipp
I was able to track down the bug. The tree-decomposition was not as nice as it should have been. This is thus a bug in the tree-decomposition nicifications stage. A patch fixing it is attached to this post.
Unfortunately, the fix triggers hc08 bug [#2450], so bug #2450 will have to be fixed before the patch can be applied.
Philipp
Related
Bugs:
#2450Last edit: Maarten Brock 2016-02-03
Fixed in revision [r9682].
Philipp
Last edit: Maarten Brock 2017-11-12