if (!maybe
&& (flag_isolate_erroneous_paths_dereference
|| flag_isolate_erroneous_paths_attribute)
- && gimple_bb (use_stmt) == bb)
+ && gimple_bb (use_stmt) == bb
+ && (duplicate || can_duplicate_block_p (bb)))
{
duplicate = isolate_path (bb, duplicate, e,
use_stmt, lhs, true);
? gimple_location (use_stmt)
: phi_arg_loc;
- if (stmt_uses_name_in_undefined_way (use_stmt, lhs, loc))
+ if (stmt_uses_name_in_undefined_way (use_stmt, lhs, loc)
+ && (duplicate || can_duplicate_block_p (bb)))
{
duplicate = isolate_path (bb, duplicate, e,
use_stmt, lhs, false);