On 11/6/19 10:02 PM, Bernhard Reutner-Fischer wrote:
Also why do you punt on duplicate conditions like in
+++ b/gcc/testsuite/gcc.dg/tree-ssa/if-to-switch-4.c
+int main(int argc, char **argv)
+{
+ if (argc == 1)
+ else if (argc == 2)
+ else if (argc == 3)
+ else if (argc == 4)
+ else if (argc == 1)
+ {
This block is dead, isn't it. Why don't you just discard it but punt?
Hello.
After I moved the pass later in optimization pipeline, such dead conditions
are already gone. What's remaining are situations like:
if (argc >= 1 && argc <= 10)
...
else if (argc >= 8 && argc <= 15)
which are overlapping intervals. I'm not planning to handle these in the first
iteration of the patch.
Martin