On 01/18/2013 01:14 PM, Jakub Jelinek wrote:
Hi!
The following testcase ICEs, because we have a n argument PHI
node referencing some BLOCK in its last gimple_phi_arg_location,
then for the containing bb the number of predecessors decreases
and thus the PHI has fewer arguments (but, nothing clears the argument
location at that point), then tree-ssa-live.c removes unused blocks
and removes the BLOCK that used to be referenced by that PHI previously
(as it is no longer referenced), then the number of predecessors
increases again, PHI nargs grows (but without resize_phi_node),
but reserve_phi_args_for_new_edge doesn't clear the phi arg location
either and nothing else sets it, so this means we refer to a dead BLOCK.
Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux
(alternatively, the location can be cleared in remove_phi_arg_num
instead). Ok for trunk?
2013-01-18 Jakub Jelinek <ja...@redhat.com>
PR tree-optimization/56029
* tree-phinodes.c (reserve_phi_args_for_new_edge): Set
gimple_phi_arg_location for the new arg to UNKNOWN_LOCATION.
* g++.dg/torture/pr56029.C: New test.
OK.
Jeff