This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Add missing check for BUILT_IN_MD (PR 91444)
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 15 Aug 2019 10:24:30 +0100
- Subject: Add missing check for BUILT_IN_MD (PR 91444)
In this PR we were passing an ordinary non-built-in function to
targetm.vectorize.builtin_md_vectorized_function, which is only
supposed to handle BUILT_IN_MD.
Tested on aarch64-linux-gnu and spot-checked on powerpc64el-linux-gnu.
Applied as obvious (r274524).
Richard
2019-08-15 Richard Sandiford <richard.sandiford@arm.com>
gcc/
PR middle-end/91444
* tree-vect-stmts.c (vectorizable_call): Check that the function
is a BUILT_IN_MD function before passing it to
targetm.vectorize.builtin_md_vectorized_function.
Index: gcc/tree-vect-stmts.c
===================================================================
--- gcc/tree-vect-stmts.c 2019-08-05 17:46:43.029559672 +0100
+++ gcc/tree-vect-stmts.c 2019-08-15 10:22:47.468694552 +0100
@@ -3376,7 +3376,7 @@ vectorizable_call (stmt_vec_info stmt_in
if (cfn != CFN_LAST)
fndecl = targetm.vectorize.builtin_vectorized_function
(cfn, vectype_out, vectype_in);
- else if (callee)
+ else if (callee && fndecl_built_in_p (callee, BUILT_IN_MD))
fndecl = targetm.vectorize.builtin_md_vectorized_function
(callee, vectype_out, vectype_in);
}