This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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).


2019-08-15  Richard Sandiford  <>

	PR middle-end/91444
	* tree-vect-stmts.c (vectorizable_call): Check that the function
	is a BUILT_IN_MD function before passing it to

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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]