From 3b6cb9e37e663d2d804059fab0acf93b22e0b4e3 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 7 Apr 2017 13:20:01 +0200 Subject: [PATCH] Error message on target attribute on aarch64 target (PR target/79889). 2017-04-07 Martin Liska PR target/79889 * g++.dg/ext/mv8.C: Add aarch64* targets. 2017-04-07 Martin Liska PR target/79889 * config/aarch64/aarch64.c (aarch64_process_target_attr): Show error message instead of an ICE. From-SVN: r246760 --- gcc/ChangeLog | 6 ++++++ gcc/config/aarch64/aarch64.c | 8 ++++++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/ext/mv8.C | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6237a2ce40d..099805db137 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-04-07 Martin Liska + + PR target/79889 + * config/aarch64/aarch64.c (aarch64_process_target_attr): + Show error message instead of an ICE. + 2017-04-07 Martin Liska PR ipa/80212 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 721ced1831a..2e385c43e96 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -9530,8 +9530,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 % argument not a string"); + return false; + } size_t len = strlen (TREE_STRING_POINTER (args)); char *str_to_check = (char *) alloca (len + 1); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 43e7bec066c..8b5a5806ea0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-04-07 Martin Liska + + PR target/79889 + * g++.dg/ext/mv8.C: Add aarch64* targets. + 2017-04-07 Martin Liska PR ipa/80212 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))) -- 2.30.2