aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeixin Qiao <qiaopeixin@huawei.com>2020-08-19 10:55:19 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2020-08-19 10:55:19 +0100
commita5a635fc4331b6d5f1a1e688e1153abd2ff194a5 (patch)
tree455c613912a61f70a419f2c9c967a97e9eeb4326
parent7dbcb569b2793be8748050f91ea8a089bc2623c8 (diff)
downloadgcc-a5a635fc4331b6d5f1a1e688e1153abd2ff194a5.zip
gcc-a5a635fc4331b6d5f1a1e688e1153abd2ff194a5.tar.gz
gcc-a5a635fc4331b6d5f1a1e688e1153abd2ff194a5.tar.bz2
AArch64: Remove "fndecl && TREE_PUBLIC (fndecl)" in aarch64_init_cumulative_args
This check will prevent the function type check of static funtion or calling via a funtion pointer. The function type should be checked no matter if the function has external linkage. gcc/ChangeLog: * config/aarch64/aarch64.c (aarch64_init_cumulative_args): Remove "fndecl && TREE_PUBLIC (fndecl)" check since it prevents the funtion type check when calling via a function pointer or when calling a static function. gcc/testsuite/ChangeLog: * gcc.target/aarch64/mgeneral-regs_7.c: New test.
-rw-r--r--gcc/config/aarch64/aarch64.c1
-rw-r--r--gcc/testsuite/gcc.target/aarch64/mgeneral-regs_7.c11
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index b7f5bc7..b6d7449 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -6017,7 +6017,6 @@ aarch64_init_cumulative_args (CUMULATIVE_ARGS *pcum,
if (!silent_p
&& !TARGET_FLOAT
- && fndecl && TREE_PUBLIC (fndecl)
&& fntype && fntype != error_mark_node)
{
const_tree type = TREE_TYPE (fntype);
diff --git a/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_7.c b/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_7.c
new file mode 100644
index 0000000..3998947
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_7.c
@@ -0,0 +1,11 @@
+/* { dg-options "-mgeneral-regs-only" } */
+
+typedef int v4si __attribute__ ((__vector_size__ ((16))));
+
+v4si (*foo) ();
+
+void
+f0 (v4si *ptr)
+{
+ *ptr = foo (); /* { dg-error "'-mgeneral-regs-only' is incompatible with the use of vector types" } */
+}