On Tue, Aug 09, 2016 at 12:24:03PM +0200, Jakub Jelinek wrote:
> On Tue, Aug 09, 2016 at 12:18:11PM +0200, Marek Polacek wrote:
> > > > On Wed, 27 Jul 2016, Marek Polacek wrote:
> > > > 
> > > > > And this is the rest.  Either I just adjusted a falls through comment,
> > > > > or I added __builtin_fallthrough ().  These were the cases where I was
> > > > > fairly sure that the fall through is intentional.
> > > > 
> > > > I saw one case where I think the warning is a bit over-active:
> > > > 
> > > > @@ -42072,6 +42089,7 @@ rdseed_step:
> > > >      case IX86_BUILTIN_ADDCARRYX64:
> > > >        icode = CODE_FOR_addcarrydi;
> > > >        mode0 = DImode;
> > > > +      gcc_fallthrough ();
> > > > 
> > > >      handlecarry:
> > > >        arg0 = CALL_EXPR_ARG (exp, 0); /* unsigned char c_in.  */
> > > > 
> > > > I.e. it also warns if the following label is not a case label but a 
> > > > normal
> > > > one.  I don't think this counts as a classical fall-through and it IMHO
> > > > should not be warned about nor should it be marked.
> > 
> > Ok, I'll buy that.
> > 
> > > It's probably the same underlying issue I saw with a false-positive in one
> > > of the other patches.
> > 
> > Yes.  I'll adjust the warning to not warn for non-case labels.
> 
> What about the case where you have non-case labels followed by case labels?
> I think warning for:
>   case 1:
>     something ();
>   lab:
>   case 2:
>     something_else ();
> is still desirable, so just avoid the warning for
>   case 1:
>     something ();
>   lab:
>     something_else ();
> ?

All right, done, and an umpteenth test added.  Will post the new version later.
Thanks,

        Marek

Reply via email to