Add missing check for BUILT_IN_MD (PR 91444)
diff mbox series

Message ID mptftm2hjch.fsf@arm.com
State New
Headers show
Series
  • Add missing check for BUILT_IN_MD (PR 91444)
Related show

Commit Message

Richard Sandiford Aug. 15, 2019, 9:24 a.m. UTC
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.

Patch
diff mbox series

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