[PATCH 2/3] Error message on target attribute on aarch64 target (PR target/79889).

Kyrill Tkachov kyrylo.tkachov@foss.arm.com
Tue Mar 21 09:24:00 GMT 2017


<CC-ing aarch64 maintainers/reviewers>

Hi Martin,

On 13/03/17 08:25, marxin wrote:
> gcc/testsuite/ChangeLog:
>
> 2017-03-13  Martin Liska  <mliska@suse.cz>
>
> 	* g++.dg/ext/mv8.C: Add aarch64* targets.
>
> gcc/ChangeLog:
>
> 2017-03-13  Martin Liska  <mliska@suse.cz>
>
> 	* config/aarch64/aarch64.c (aarch64_process_target_attr):
> 	Show error message instead of an ICE.

You should mention PR target/79889 in your ChangeLog
> ---
>   gcc/config/aarch64/aarch64.c   | 8 ++++++--
>   gcc/testsuite/g++.dg/ext/mv8.C | 2 +-
>   2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
> index a069427f576..3107d6b84bf 100644
> --- a/gcc/config/aarch64/aarch64.c
> +++ b/gcc/config/aarch64/aarch64.c
> @@ -9533,8 +9533,12 @@ aarch64_process_target_attr (tree args, const char* pragma_or_attr)
>   
>         return true;
>       }
> -  /* We expect to find a string to parse.  */
> -  gcc_assert (TREE_CODE (args) == STRING_CST);
> +
> +  if (TREE_CODE (args) != STRING_CST)
> +    {
> +      error ("attribute %<target%> argument not a string");
> +      return false;
> +    }
>   

Looks reasonable to me, but you'll need approval from the folks CC-ed.

Thanks,
Kyrill

>     size_t len = strlen (TREE_STRING_POINTER (args));
>     char *str_to_check = (char *) alloca (len + 1);
> diff --git a/gcc/testsuite/g++.dg/ext/mv8.C b/gcc/testsuite/g++.dg/ext/mv8.C
> index bbf90b5a328..b49ef84f392 100644
> --- a/gcc/testsuite/g++.dg/ext/mv8.C
> +++ b/gcc/testsuite/g++.dg/ext/mv8.C
> @@ -1,4 +1,4 @@
> -// { dg-do compile { target i?86-*-* x86_64-*-* powerpc*-*-* } }
> +// { dg-do compile { target i?86-*-* x86_64-*-* powerpc*-*-* aarch64*-*-* } }
>   // { dg-options "" }
>   
>   __attribute__((target (11,12)))



More information about the Gcc-patches mailing list