@@ -3052,11 +3052,11 @@ oacc_entry_exit_ok_1 (bitmap in_loop_bbs, vec<basic_block> region_bbs,
{
use_operand_p use_p;
gimple *use_stmt;
+ struct reduction_info *red;
single_imm_use (lhs, &use_p, &use_stmt);
- if (gimple_code (use_stmt) == GIMPLE_PHI)
+ if (gimple_code (use_stmt) == GIMPLE_PHI
+ && (red = reduction_phi (reduction_list, use_stmt)))
{
- struct reduction_info *red;
- red = reduction_phi (reduction_list, use_stmt);
tree val = PHI_RESULT (red->keep_res);
if (has_single_use (val))
{
new file mode 100644
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+/* { dg-additional-options "-fno-tree-ch -fno-tree-dce -fno-tree-vrp" } */
+
+int
+main (void)
+{
+ int fa;
+
+ #pragma acc kernels
+ for (int rw = 0; rw < 1; ++rw)
+ fa = 0;
+
+ return 0;
+}
+