From: Richard Sandiford Date: Thu, 15 Aug 2019 09:23:06 +0000 (+0000) Subject: Add missing check for BUILT_IN_MD (PR 91444) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eb2211e35713796c5899939d983d9e8c6d037e60;p=gcc.git 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. 2019-08-15 Richard Sandiford 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. From-SVN: r274524 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 12c8dcd5cc9..ae7d49ca5c8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +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 + targetm.vectorize.builtin_md_vectorized_function. + 2019-08-15 Richard Sandiford * config/aarch64/aarch64-protos.h (aarch64_sve_mode_p): Declare. diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 1e2dfe5d22d..dd9d45a9547 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -3376,7 +3376,7 @@ vectorizable_call (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, 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); }