This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix unsafe function attributes for special functions (PR 71876)


On Thu, 21 Jul 2016, Bernd Edlinger wrote:

> On 07/21/16 13:16, Jakub Jelinek wrote:
> > On Thu, Jul 21, 2016 at 11:04:48AM +0000, Bernd Edlinger wrote:
> >>   bool
> >> +gimple_alloca_call_p (const gimple *stmt)
> >> +{
> >> +  tree fndecl;
> >> +
> >> +  if (!is_gimple_call (stmt))
> >> +    return false;
> >> +
> >> +  fndecl = gimple_call_fndecl (stmt);
> >> +  if (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
> >> +    switch (DECL_FUNCTION_CODE (fndecl))
> >> +      {
> >> +      case BUILT_IN_ALLOCA:
> >> +      case BUILT_IN_ALLOCA_WITH_ALIGN:
> >> +        return true;
> >> +      }
> >
> > This should have failed bootstrap because of -Wswitch-enum.
> > You need
> > 	default:
> > 	  break;
> > in.
> >
> >> +    switch (DECL_FUNCTION_CODE (fndecl))
> >> +      {
> >> +      case BUILT_IN_ALLOCA:
> >> +      case BUILT_IN_ALLOCA_WITH_ALIGN:
> >> +        return true;
> >
> > Likewise here.
> >
> 
> Thanks, confirmed.
> I added that now.

Ok with that change.

Thanks,
Richard.


> Bernd.
> 
> > 	Jakub
> >
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]