On Fri, Dec 16, 2016 at 03:16:14PM +0100, Marek Polacek wrote:
> On Fri, Dec 16, 2016 at 02:58:59PM +0100, Richard Biener wrote:
> > On Fri, Dec 16, 2016 at 2:03 PM, Bernd Schmidt wrote:
> > > On 12/16/2016 12:49 PM, Marek Polacek wrote:
> > >
> > >> But as this testcase shows, this breaks when th
On Fri, Dec 16, 2016 at 3:16 PM, Marek Polacek wrote:
> On Fri, Dec 16, 2016 at 02:58:59PM +0100, Richard Biener wrote:
>> On Fri, Dec 16, 2016 at 2:03 PM, Bernd Schmidt wrote:
>> > On 12/16/2016 12:49 PM, Marek Polacek wrote:
>> >
>> >> But as this testcase shows, this breaks when the default la
On Fri, Dec 16, 2016 at 02:58:59PM +0100, Richard Biener wrote:
> On Fri, Dec 16, 2016 at 2:03 PM, Bernd Schmidt 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 test
On Fri, Dec 16, 2016 at 2:03 PM, Bernd Schmidt 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
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
On Fri, Dec 16, 2016 at 02:00:56PM +0100, Richard Biener wrote:
> On Fri, Dec 16, 2016 at 12:49 PM, Marek Polacek wrote:
> > --- gcc/tree-vrp.c
> > +++ gcc/tree-vrp.c
> > @@ -6051,10 +6051,17 @@ find_switch_asserts (basic_block bb, gswitch *last)
> >/* Now register along the default label asse
On Fri, Dec 16, 2016 at 12:49 PM, Marek Polacek wrote:
> Starting with r238761, we register assertions for default switch labels;
> these assertions correspond to the anti-range of each case label. It
> means that we can optimize this better:
>
> switch (i) {
> case 1: case 2: case 3:
>
Starting with r238761, we register assertions for default switch labels;
these assertions correspond to the anti-range of each case label. It
means that we can optimize this better:
switch (i) {
case 1: case 2: case 3:
...
break;
default:
// i is ~[1, 3]
if (i ==