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.
This commit is contained in:
parent
7dbcb569b2
commit
a5a635fc43
@ -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);
|
||||
|
11
gcc/testsuite/gcc.target/aarch64/mgeneral-regs_7.c
Normal file
11
gcc/testsuite/gcc.target/aarch64/mgeneral-regs_7.c
Normal file
@ -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" } */
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user