2017-05-05 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/80632
+ * tree-switch-conversion.c (struct switch_conv_info): Add target_vop
+ field.
+ (build_arrays): Initialize it for virtual phis.
+ (fix_phi_nodes): Use it for virtual phis.
+
PR tree-optimization/80558
* tree-vrp.c (extract_range_from_binary_expr_1): Optimize
[x, y] op z into [x op, y op z] for op & or | if conditions
2017-05-05 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/80632
+ * gcc.dg/pr80632.c: New test.
+
PR tree-optimization/80558
* gcc.dg/tree-ssa/vrp115.c: New test.
switch expression is out of range. */
tree *target_outbound_names;
+ /* VOP SSA_NAME. */
+ tree target_vop;
+
/* The first load statement that loads a temporary from a new static array.
*/
gimple *arr_ref_first;
gphi *phi = gpi.phi ();
if (!virtual_operand_p (gimple_phi_result (phi)))
build_one_array (swtch, i++, arr_index_type, phi, tidx, info);
+ else
+ {
+ edge e;
+ edge_iterator ei;
+ FOR_EACH_EDGE (e, ei, info->switch_bb->succs)
+ {
+ if (e->dest == info->final_bb)
+ break;
+ if (!info->default_case_nonstandard
+ || e->dest != info->default_bb)
+ {
+ e = single_succ_edge (e->dest);
+ break;
+ }
+ }
+ gcc_assert (e && e->dest == info->final_bb);
+ info->target_vop = PHI_ARG_DEF_FROM_EDGE (phi, e);
+ }
}
}
gphi *phi = gsi.phi ();
tree inbound, outbound;
if (virtual_operand_p (gimple_phi_result (phi)))
- inbound = outbound = gimple_vop (cfun);
+ inbound = outbound = info->target_vop;
else
{
inbound = info->target_inbound_names[i];