@@ -11098,17 +11098,23 @@ ipa_simd_modify_function_body (struct cgraph_node *node,
{
case GIMPLE_RETURN:
{
- /* Replace `return foo' by `retval_array[iter] = foo'. */
tree old_retval = gimple_return_retval (stmt);
- if (!old_retval)
- break;
- stmt = gimple_build_assign (build4 (ARRAY_REF,
- TREE_TYPE (old_retval),
- retval_array, iter,
- NULL, NULL),
- old_retval);
- gsi_replace (&gsi, stmt, true);
- modified = true;
+ if (old_retval)
+ {
+ /* Replace `return foo' by `retval_array[iter] = foo'. */
+ stmt = gimple_build_assign (build4 (ARRAY_REF,
+ TREE_TYPE (old_retval),
+ retval_array, iter,
+ NULL, NULL),
+ old_retval);
+ gsi_replace (&gsi, stmt, true);
+ modified = true;
+ }
+ else
+ {
+ gsi_remove (&gsi, true);
+ continue;
+ }
break;
}
new file mode 100644
@@ -0,0 +1,12 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-fopenmp -w" } */
+
+/* ?? The -w above is to inhibit the following warning for now:
+ a.c:2:6: warning: AVX vector argument without AVX enabled changes
+ the ABI [enabled by default]. */
+
+#pragma omp declare simd notinbranch simdlen(4)
+void foo (int *a)
+{
+ *a = 555;
+}