genericize_omp_for_stmt (stmt_p, walk_subtrees, data, func, lh);
break;
+ case STATEMENT_LIST:
+ if (TREE_SIDE_EFFECTS (stmt))
+ {
+ tree_stmt_iterator i;
+ int nondebug_stmts = 0;
+ bool clear_side_effects = true;
+ /* Genericization can clear TREE_SIDE_EFFECTS, e.g. when
+ transforming an IF_STMT into COND_EXPR. If such stmt
+ appears in a STATEMENT_LIST that contains only that
+ stmt and some DEBUG_BEGIN_STMTs, without -g where the
+ STATEMENT_LIST wouldn't be present at all the resulting
+ expression wouldn't have TREE_SIDE_EFFECTS set, so make sure
+ to clear it even on the STATEMENT_LIST in such cases. */
+ for (i = tsi_start (stmt); !tsi_end_p (i); tsi_next (&i))
+ {
+ tree t = tsi_stmt (i);
+ if (TREE_CODE (t) != DEBUG_BEGIN_STMT && nondebug_stmts < 2)
+ nondebug_stmts++;
+ walk_tree_1 (tsi_stmt_ptr (i), func, data, NULL, lh);
+ if (TREE_CODE (t) != DEBUG_BEGIN_STMT
+ && (nondebug_stmts > 1 || TREE_SIDE_EFFECTS (tsi_stmt (i))))
+ clear_side_effects = false;
+ }
+ if (clear_side_effects)
+ TREE_SIDE_EFFECTS (stmt) = 0;
+ *walk_subtrees = 0;
+ }
+ break;
+
default:
break;
}
walk_subtrees = 0;
break;
- case STATEMENT_LIST:
- if (TREE_SIDE_EFFECTS (stmt))
- {
- tree_stmt_iterator i;
- int nondebug_stmts = 0;
- bool clear_side_effects = true;
- /* Genericization can clear TREE_SIDE_EFFECTS, e.g. when
- transforming an IF_STMT into COND_EXPR. If such stmt
- appears in a STATEMENT_LIST that contains only that
- stmt and some DEBUG_BEGIN_STMTs, without -g where the
- STATEMENT_LIST wouldn't be present at all the resulting
- expression wouldn't have TREE_SIDE_EFFECTS set, so make sure
- to clear it even on the STATEMENT_LIST in such cases. */
- for (i = tsi_start (stmt); !tsi_end_p (i); tsi_next (&i))
- {
- tree t = tsi_stmt (i);
- if (TREE_CODE (t) != DEBUG_BEGIN_STMT && nondebug_stmts < 2)
- nondebug_stmts++;
- cp_walk_tree (tsi_stmt_ptr (i), cp_genericize_r, data, NULL);
- if (TREE_CODE (t) != DEBUG_BEGIN_STMT
- && (nondebug_stmts > 1 || TREE_SIDE_EFFECTS (tsi_stmt (i))))
- clear_side_effects = false;
- }
- if (clear_side_effects)
- TREE_SIDE_EFFECTS (stmt) = 0;
- *walk_subtrees = 0;
- }
- break;
-
case OMP_DISTRIBUTE:
/* Need to explicitly instantiate copy ctors on class iterators of
composite distribute parallel for. */
case OMP_SIMD:
case OMP_LOOP:
case OACC_LOOP:
+ case STATEMENT_LIST:
/* These cases are handled by shared code. */
c_genericize_control_stmt (stmt_p, walk_subtrees, data,
cp_genericize_r, cp_walk_subtrees);