Mercurial > hg > CbC > CbC_gcc
comparison gcc/tree-phinodes.c @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | a06113de4d67 |
children | b7f97abdc517 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
229 gimple_phi_set_result (phi, make_ssa_name (var, phi)); | 229 gimple_phi_set_result (phi, make_ssa_name (var, phi)); |
230 | 230 |
231 for (i = 0; i < capacity; i++) | 231 for (i = 0; i < capacity; i++) |
232 { | 232 { |
233 use_operand_p imm; | 233 use_operand_p imm; |
234 | |
235 gimple_phi_arg_set_location (phi, i, UNKNOWN_LOCATION); | |
234 imm = gimple_phi_arg_imm_use_ptr (phi, i); | 236 imm = gimple_phi_arg_imm_use_ptr (phi, i); |
235 imm->use = gimple_phi_arg_def_ptr (phi, i); | 237 imm->use = gimple_phi_arg_def_ptr (phi, i); |
236 imm->prev = NULL; | 238 imm->prev = NULL; |
237 imm->next = NULL; | 239 imm->next = NULL; |
238 imm->loc.stmt = phi; | 240 imm->loc.stmt = phi; |
297 new_phi->gimple_phi.capacity = len; | 299 new_phi->gimple_phi.capacity = len; |
298 | 300 |
299 for (i = gimple_phi_num_args (new_phi); i < len; i++) | 301 for (i = gimple_phi_num_args (new_phi); i < len; i++) |
300 { | 302 { |
301 use_operand_p imm; | 303 use_operand_p imm; |
304 | |
305 gimple_phi_arg_set_location (new_phi, i, UNKNOWN_LOCATION); | |
302 imm = gimple_phi_arg_imm_use_ptr (new_phi, i); | 306 imm = gimple_phi_arg_imm_use_ptr (new_phi, i); |
303 imm->use = gimple_phi_arg_def_ptr (new_phi, i); | 307 imm->use = gimple_phi_arg_def_ptr (new_phi, i); |
304 imm->prev = NULL; | 308 imm->prev = NULL; |
305 imm->next = NULL; | 309 imm->next = NULL; |
306 imm->loc.stmt = new_phi; | 310 imm->loc.stmt = new_phi; |
347 } | 351 } |
348 } | 352 } |
349 | 353 |
350 /* Adds PHI to BB. */ | 354 /* Adds PHI to BB. */ |
351 | 355 |
352 void | 356 void |
353 add_phi_node_to_bb (gimple phi, basic_block bb) | 357 add_phi_node_to_bb (gimple phi, basic_block bb) |
354 { | 358 { |
355 gimple_stmt_iterator gsi; | 359 gimple_stmt_iterator gsi; |
356 /* Add the new PHI node to the list of PHI nodes for block BB. */ | 360 /* Add the new PHI node to the list of PHI nodes for block BB. */ |
357 if (phi_nodes (bb) == NULL) | 361 if (phi_nodes (bb) == NULL) |
382 argument is added at the end of the argument list. | 386 argument is added at the end of the argument list. |
383 If PHI has reached its maximum capacity, add a few slots. In this case, | 387 If PHI has reached its maximum capacity, add a few slots. In this case, |
384 PHI points to the reallocated phi node when we return. */ | 388 PHI points to the reallocated phi node when we return. */ |
385 | 389 |
386 void | 390 void |
387 add_phi_arg (gimple phi, tree def, edge e) | 391 add_phi_arg (gimple phi, tree def, edge e, source_location locus) |
388 { | 392 { |
389 basic_block bb = e->dest; | 393 basic_block bb = e->dest; |
390 | 394 |
391 gcc_assert (bb == gimple_bb (phi)); | 395 gcc_assert (bb == gimple_bb (phi)); |
392 | 396 |
405 SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def) = 1; | 409 SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def) = 1; |
406 SSA_NAME_OCCURS_IN_ABNORMAL_PHI (PHI_RESULT (phi)) = 1; | 410 SSA_NAME_OCCURS_IN_ABNORMAL_PHI (PHI_RESULT (phi)) = 1; |
407 } | 411 } |
408 | 412 |
409 SET_PHI_ARG_DEF (phi, e->dest_idx, def); | 413 SET_PHI_ARG_DEF (phi, e->dest_idx, def); |
414 gimple_phi_arg_set_location (phi, e->dest_idx, locus); | |
410 } | 415 } |
411 | 416 |
412 | 417 |
413 /* Remove the Ith argument from PHI's argument list. This routine | 418 /* Remove the Ith argument from PHI's argument list. This routine |
414 implements removal by swapping the last alternative with the | 419 implements removal by swapping the last alternative with the |
433 old_p = gimple_phi_arg_imm_use_ptr (phi, num_elem - 1); | 438 old_p = gimple_phi_arg_imm_use_ptr (phi, num_elem - 1); |
434 new_p = gimple_phi_arg_imm_use_ptr (phi, i); | 439 new_p = gimple_phi_arg_imm_use_ptr (phi, i); |
435 /* Set use on new node, and link into last element's place. */ | 440 /* Set use on new node, and link into last element's place. */ |
436 *(new_p->use) = *(old_p->use); | 441 *(new_p->use) = *(old_p->use); |
437 relink_imm_use (new_p, old_p); | 442 relink_imm_use (new_p, old_p); |
443 /* Move the location as well. */ | |
444 gimple_phi_arg_set_location (phi, i, | |
445 gimple_phi_arg_location (phi, num_elem - 1)); | |
438 } | 446 } |
439 | 447 |
440 /* Shrink the vector and return. Note that we do not have to clear | 448 /* Shrink the vector and return. Note that we do not have to clear |
441 PHI_ARG_DEF because the garbage collector will not look at those | 449 PHI_ARG_DEF because the garbage collector will not look at those |
442 elements beyond the first PHI_NUM_ARGS elements of the array. */ | 450 elements beyond the first PHI_NUM_ARGS elements of the array. */ |