+2017-02-17 Martin Liska <mliska@suse.cz>
+
+ PR tree-optimization/79529
+ * tree-ssa-loop-unswitch.c (is_maybe_undefined): Use
+ ssa_defined_default_def_p to handle cases which are implicitly
+ defined.
+ * tree-ssa.c (ssa_defined_default_def_p): New function.
+ (ssa_undefined_value_p): Use ssa_defined_default_def_p to handle cases
+ which are implicitly defined.
+ * tree-ssa.h (ssa_defined_default_def_p): Declare.
+
2017-02-17 Richard Biener <rguenther@suse.de>
PR middle-end/79576
if (ssa_undefined_value_p (t, true))
return true;
- /* A PARM_DECL will not have an SSA_NAME_DEF_STMT. Parameters
- get their initial value from function entry. */
- if (SSA_NAME_VAR (t) && TREE_CODE (SSA_NAME_VAR (t)) == PARM_DECL)
+ if (ssa_defined_default_def_p (t))
continue;
gimple *def = SSA_NAME_DEF_STMT (t);
return exp;
}
-
-/* Return true if T, an SSA_NAME, has an undefined value. PARTIAL is what
- should be returned if the value is only partially undefined. */
+/* Return true if T, as SSA_NAME, has an implicit default defined value. */
bool
-ssa_undefined_value_p (tree t, bool partial)
+ssa_defined_default_def_p (tree t)
{
- gimple *def_stmt;
tree var = SSA_NAME_VAR (t);
if (!var)
;
/* Parameters get their initial value from the function entry. */
else if (TREE_CODE (var) == PARM_DECL)
- return false;
+ return true;
/* When returning by reference the return address is actually a hidden
parameter. */
else if (TREE_CODE (var) == RESULT_DECL && DECL_BY_REFERENCE (var))
- return false;
+ return true;
/* Hard register variables get their initial value from the ether. */
else if (VAR_P (var) && DECL_HARD_REGISTER (var))
+ return true;
+
+ return false;
+}
+
+
+/* Return true if T, an SSA_NAME, has an undefined value. PARTIAL is what
+ should be returned if the value is only partially undefined. */
+
+bool
+ssa_undefined_value_p (tree t, bool partial)
+{
+ gimple *def_stmt;
+
+ if (ssa_defined_default_def_p (t))
return false;
/* The value is undefined iff its definition statement is empty. */
extern bool tree_ssa_useless_type_conversion (tree);
extern tree tree_ssa_strip_useless_type_conversions (tree);
+
+extern bool ssa_defined_default_def_p (tree t);
extern bool ssa_undefined_value_p (tree, bool = true);
extern bool gimple_uses_undefined_value_p (gimple *);
extern void execute_update_addresses_taken (void);