On 05/08/2017 01:20 PM, Peter Bergner wrote: > That is what the previous patch did, but as I mention above, > we generate slightly better code for some test cases (other > tests seemed to generate the same code) if we don't attempt > to handle the decision tree case. I'll note that the current > unpatched compiler already knows how to remove unreachable > case statement blocks when we expand to a decision tree.
I should be more careful with my description here. The patch does affect both unreachable case statements for both decision trees as well as jump tables, and that leads to improved code for both decision trees as well as jump tables. What I meant to say above, is that the current handling of unreachable default case statements in the unpatched compiler seems to lead to slightly better code for some test cases than attempting to handle default_label == NULL in the decision tree code. It was for that reason, I placed the code in expand_case() only in the jump table path. The fact it made the patch smaller was a bonus, since I didn't need to protect emit_case_nodes() from a NULL default_label. As I said, if you think it will help some test case I haven't tried yet, I can add that support back. Peter