Simon Atanasyan <si...@atanasyan.com> writes:
> Currently GCC supports 'long_call', 'far', and 'near' attributes. The
> 'long_call' and 'far' attributes are synonyms. This patch adds support
> for the 'short_call' attribute as a synonym for `near` to make this list
> complete, consistent with other targets, and compatible with attributes
> supported by the Clang.

Sorry for the slow reply. Thanks for keeping GCC and Clang in sync.

> Tested on mipsel-linux-gnu.
> 
> 2017-08-22  Simon Atanasyan  <si...@atanasyan.com>

As you do not have a personal copyright assignment on file please can you
resubmit using your @imgtec.com address and use that address for the
changelog. There are just a couple of indentation issues below as well.

> gcc/
> 
> * config/mips/mips.c (mips_attribute_table): Add 'short_call' attribute.
> (mips_near_type_p): Add 'short_call' attribute as a synonym for 'near'.
> * doc/extend.texi (short_call): Document new function attribute.
> 
> gcc/testsuite/
> 
> * gcc.target/mips/near-far-1.c: Add check for 'short_call' attribute.
> * gcc.target/mips/near-far-2.c: Likewise.
> * gcc.target/mips/near-far-3.c: Likewise.
> * gcc.target/mips/near-far-4.c: Likewise.

There should be one tab before the lines in each entry <tab>* <filename>,
lines here should be wrapped at 74 cols.

> 
> Index: gcc/config/mips/mips.c
> ===================================================================
> --- gcc/config/mips/mips.c (revision 251219)
> +++ gcc/config/mips/mips.c (working copy)
> @@ -598,6 +598,7 @@ static const struct attribute_spec mips_attribute_
>    /* { name, min_len, max_len, decl_req, type_req, fn_type_req,
> handler,
>         om_diagnostic } */
>    { "long_call",   0, 0, false, true,  true,  NULL, false },
> +  { "short_call",  0, 0, false, true,  true,  NULL, false },
>    { "far",       0, 0, false, true,  true,  NULL, false },
>    { "near",        0, 0, false, true,  true,  NULL, false },
>    /* We would really like to treat "mips16" and "nomips16" as type
> @@ -1171,13 +1172,14 @@ mflip_mips16_use_mips16_p (tree decl)
>    return *slot;
>  }
> 
> -/* Predicates to test for presence of "near" and "far"/"long_call"
> +/* Predicates to test for presence of "near"/"short_call" and
> "far"/"long_call"
>     attributes on the given TYPE.  */
> 
>  static bool
>  mips_near_type_p (const_tree type)
>  {
> -  return lookup_attribute ("near", TYPE_ATTRIBUTES (type)) != NULL;
> +  return (lookup_attribute ("short_call", TYPE_ATTRIBUTES (type)) !=
> NULL
> +  || lookup_attribute ("near", TYPE_ATTRIBUTES (type)) != NULL);

The || here should be lined up under the 'l' of lookup_attribute above
which will be 1-tab 2-space to save you figuring out the indent rules
for GCC again. The space indents in the testcases below are fine as
they match the existing lines.

If you can repost with your @imgtec address then I'll approve that
to commit.

Thanks,
Matthew

Reply via email to