On Mon, Jan 17, 2022 at 10:36 AM Jakub Jelinek via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Fri, Jan 14, 2022 at 09:41:35AM +0100, Jan Hubicka via Gcc-patches wrote:
> > > > > > > --- a/gcc/ipa-split.c
> > > > > > > +++ b/gcc/ipa-split.c
> > > > > > > @@ -873,7 +873,7 @@ visit_bb (basic_block bb, basic_block 
> > > > > > > return_bb,
> > > > > > >         gimple *stmt = gsi_stmt (bsi);
> > > > > > >         tree op;
> > > > > > >         ssa_op_iter iter;
> > > > > > > -      tree decl;
> > > > > > > +      tree decl = NULL_TREE;
> > > > > > >
> > > > > > >         if (is_gimple_debug (stmt))
> > > > > > >          continue;
> > > > > > > @@ -927,6 +927,16 @@ visit_bb (basic_block bb, basic_block 
> > > > > > > return_bb,
> > Decl is initialized in
> >       if (gimple_code (stmt) == GIMPLE_CALL
> >           && (decl = gimple_call_fndecl (stmt)) != NULL_TREE
> >           && fndecl_built_in_p (decl, BUILT_IN_NORMAL))
> >
> > I think this is confusing. I would change it to
> >       if (gimple_code (stmt) == GIMPLE_CALL
> >           && (decl = gimple_call_fndecl (stmt)) != NULL_TREE
> >       {
> >           if (fndecl_built_in_p (decl, BUILT_IN_NORMAL))
> >           ... existing code ...
> >         if (decl && (lookup_attribute ("warning", DECL_ATTRIBUTES (decl))
> >                      || lookup_attribute ("error", DECL_ATTRIBUTES (decl))))
> >           ... your code ...
> >       }
> > OK with that change.
>
> Perhaps even
>       /* Check builtins that prevent splitting.  */
>       if (gimple_code (stmt) == GIMPLE_CALL)
>         if (tree decl = gimple_call_fndecl (stmt))
>           {
>             if (fndecl_built_in_p (decl, BUILT_IN_NORMAL))
>               ...
>             if (lookup_attribute || lookup_attribute)
>               ...
>           }
> ?

Yes that looks good, I am just finished up the patch and going to run
a full bootstrap/test to make sure I didn't mess up.
I had originally trying not to reindent the code to make it easier to
see what was being added but I think re-indentation is correct after
all.

Thanks
Andrew


>
>         Jakub
>

Reply via email to