On Fri, Dec 16, 2016 at 2:03 PM, Bernd Schmidt <bschm...@redhat.com> wrote: > On 12/16/2016 12:49 PM, Marek Polacek wrote: > >> But as this testcase shows, this breaks when the default label shares a >> label >> with another case. On this testcase, when we reach the switch, we know >> that >> argc is either 1, 2, or 3. So by the time we reach vrp2, the IR will have >> been optimized to >> >> switch (argc) { >> default: >> case 3: >> // argc will be considered 1 despite the case 3 >> break; >> case 2: >> ... >> } > > > Shouldn't we just remove the "case 3:" from the switch in this case? Would > that fix things?
We probably should indeed. But can we rely on this? Richard. > > Bernd