It was determined that the reported ICE occurs because a NULL value is passed from vectorizable_call () to
targetm.vectorize.builtin_md_vectorized_function ( callee, vectype_out, vectype_in). This patch avoids making this call if callee equals NULL. After successful bootstrap and regression testing, with preapproval, this patch has been committed to the trunk. It it ok to backport to GCC 7 and GCC 6 (after testing on those platforms)? Thanks. gcc/ChangeLog: 2018-01-29 Richard Biener <rguent...@suse.de> Kelvin Nilsen <kel...@gcc.gnu.org> PR bootstrap/80867 * tree-vect-stmts.c (vectorizable_call): Don't call targetm.vectorize_builtin_md_vectorized_function if callee is NULL. Index: gcc/tree-vect-stmts.c =================================================================== --- gcc/tree-vect-stmts.c (revision 257105) +++ gcc/tree-vect-stmts.c (working copy) @@ -3159,7 +3159,7 @@ if (cfn != CFN_LAST) fndecl = targetm.vectorize.builtin_vectorized_function (cfn, vectype_out, vectype_in); - else + else if (callee) fndecl = targetm.vectorize.builtin_md_vectorized_function (callee, vectype_out, vectype_in); }