http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59326
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> Fix for that:
>
> Index: gcc/omp-low.c
> ===================================================================
> --- gcc/omp-low.c (revision 205484)
> +++ gcc/omp-low.c (working copy)
> @@ -11734,8 +11734,13 @@ static unsigned int
> ipa_omp_simd_clone (void)
> {
> struct cgraph_node *node;
> - FOR_EACH_FUNCTION (node)
> - expand_simd_clones (node);
> + FOR_EACH_DEFINED_FUNCTION (node)
> + {
> + if (!cgraph_function_with_gimple_body_p (node))
> + continue;
> + cgraph_get_body (node);
> + expand_simd_clones (node);
> + }
> return 0;
> }
>
>
> and now it magically works.
But then it won't handle the !node->definition cloning (it isn't actually
cloning in that case, just creating another DECL_EXTERNAL FUNCTION_DECL with
adjusted arguments). So it really needs to be FOR_EACH_FUNCTION, but perhaps
can avoid the cgraph_function_with_gimple_body_p/cgraph_get_body stuff if
!node->definition.