+2015-03-05 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/65233
+ * ipa-polymorphic-call.c: Include tree-ssa-operands.h and
+ tree-into-ssa.h.
+ (walk_ssa_copies): Revert last chage. Instead do not walk
+ SSA names registered for SSA update.
+
2015-03-03 Jan Hubicka <hubicka@ucw.cz>
PR ipa/65270
#include "data-streamer.h"
#include "lto-streamer.h"
#include "streamer-hooks.h"
+#include "tree-ssa-operands.h"
+#include "tree-into-ssa.h"
/* Return true when TYPE contains an polymorphic type and thus is interesting
for devirtualization machinery. */
STRIP_NOPS (op);
while (TREE_CODE (op) == SSA_NAME
&& !SSA_NAME_IS_DEFAULT_DEF (op)
- && SSA_NAME_DEF_STMT (op)
+ /* We might be called via fold_stmt during cfgcleanup where
+ SSA form need not be up-to-date. */
+ && !name_registered_for_update_p (op)
&& (gimple_assign_single_p (SSA_NAME_DEF_STMT (op))
|| gimple_code (SSA_NAME_DEF_STMT (op)) == GIMPLE_PHI))
{
{
gimple phi = SSA_NAME_DEF_STMT (op);
- if (gimple_phi_num_args (phi) > 2
- /* We can be called while cleaning up the CFG and can
- have empty PHIs about to be removed. */
- || gimple_phi_num_args (phi) == 0)
+ if (gimple_phi_num_args (phi) > 2)
goto done;
if (gimple_phi_num_args (phi) == 1)
op = gimple_phi_arg_def (phi, 0);