Add missing check for BUILT_IN_MD (PR 91444)
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 15 Aug 2019 09:23:06 +0000 (09:23 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 15 Aug 2019 09:23:06 +0000 (09:23 +0000)
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  <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.

From-SVN: r274524

gcc/ChangeLog
gcc/tree-vect-stmts.c

index 12c8dcd5cc9da31cae2efad72128057bfd7f5846..ae7d49ca5c80236de372006ed24fd2ad365679aa 100644 (file)
@@ -1,3 +1,10 @@
+2019-08-15  Richard Sandiford  <richard.sandiford@arm.com>
+
+       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  <richard.sandiford@arm.com>
 
        * config/aarch64/aarch64-protos.h (aarch64_sve_mode_p): Declare.
index 1e2dfe5d22dc6715ba0ca633f6ef98ca4abbc797..dd9d45a9547587d1d3499c857d60ee10642dccdf 100644 (file)
@@ -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);
     }