break;
case GIMPLE_SWITCH:
- val = gimple_switch_index (stmt);
+ val = gimple_switch_index (as_a <gswitch *> (stmt));
break;
default:
switch (gimple_code (stmt))
{
case GIMPLE_LABEL:
- if (DECL_NONLOCAL (gimple_label_label (stmt)))
+ if (DECL_NONLOCAL (gimple_label_label (as_a <glabel *> (stmt))))
return false;
if (optimize == 0 && gimple_location (stmt) != locus)
return false;
{
int n1 = e1->dest_idx;
int n2 = e2->dest_idx;
- gimple_stmt_iterator gsi;
+ gphi_iterator gsi;
for (gsi = gsi_start_phis (dest); !gsi_end_p (gsi); gsi_next (&gsi))
{
- gimple phi = gsi_stmt (gsi);
+ gphi *phi = gsi.phi ();
tree val1 = gimple_phi_arg_def (phi, n1);
tree val2 = gimple_phi_arg_def (phi, n2);
/* If the destination block consists of a nonlocal label or is a
EH landing pad, do not merge it. */
label = first_stmt (dest);
- if (label
- && gimple_code (label) == GIMPLE_LABEL
- && (DECL_NONLOCAL (gimple_label_label (label))
- || EH_LANDING_PAD_NR (gimple_label_label (label)) != 0))
- return false;
+ if (label)
+ if (glabel *label_stmt = dyn_cast <glabel *> (label))
+ if (DECL_NONLOCAL (gimple_label_label (label_stmt))
+ || EH_LANDING_PAD_NR (gimple_label_label (label_stmt)) != 0)
+ return false;
/* If there is an abnormal edge to basic block BB, but not into
dest, problems might occur during removal of the phi node at out
{
/* Create arguments for the phi nodes, since the edge was not
here before. */
- for (gsi = gsi_start_phis (dest);
- !gsi_end_p (gsi);
- gsi_next (&gsi))
+ for (gphi_iterator psi = gsi_start_phis (dest);
+ !gsi_end_p (psi);
+ gsi_next (&psi))
{
- gimple phi = gsi_stmt (gsi);
+ gphi *phi = psi.phi ();
source_location l = gimple_phi_arg_location_from_edge (phi, succ);
tree def = gimple_phi_arg_def (phi, succ->dest_idx);
add_phi_arg (phi, unshare_expr (def), s, l);
label = gsi_stmt (gsi);
if (is_gimple_debug (label))
break;
- decl = gimple_label_label (label);
+ decl = gimple_label_label (as_a <glabel *> (label));
if (EH_LANDING_PAD_NR (decl) != 0
|| DECL_NONLOCAL (decl)
|| FORCED_LABEL (decl)
/* If the destination block consists of a nonlocal label, do not
merge it. */
label = first_stmt (dest);
- if (label
- && gimple_code (label) == GIMPLE_LABEL
- && DECL_NONLOCAL (gimple_label_label (label)))
- return false;
+ if (label)
+ if (glabel *label_stmt = dyn_cast <glabel *> (label))
+ if (DECL_NONLOCAL (gimple_label_label (label_stmt)))
+ return false;
/* Record BB's single pred in case we need to update the father
loop's latch information later. */
while (EDGE_COUNT (bb->preds) > 0)
{
edge e = EDGE_PRED (bb, 0), s;
- gimple_stmt_iterator gsi;
+ gphi_iterator gsi;
s = find_edge (e->src, dest);
if (s)
!gsi_end_p (gsi);
gsi_next (&gsi))
{
- gimple phi = gsi_stmt (gsi);
+ gphi *phi = gsi.phi ();
tree def = gimple_phi_arg_def (phi, succ->dest_idx);
source_location locus = gimple_phi_arg_location_from_edge (phi, succ);
}
else
{
- gimple_stmt_iterator gsi;
+ gphi_iterator gsi;
unsigned int dest_idx = single_succ_edge (bb)->dest_idx;
/* BB dominates DEST. There may be many users of the PHI
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
gsi_next (&gsi))
{
- gimple phi = gsi_stmt (gsi);
+ gphi *phi = gsi.phi ();
tree result = gimple_phi_result (phi);
use_operand_p imm_use;
gimple use_stmt;