diff options
author | Martin Liska <mliska@suse.cz> | 2017-02-17 15:36:08 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2017-02-17 14:36:08 +0000 |
commit | c6b0d21d49a2605b2c667cec37b31140133b1fd5 (patch) | |
tree | 2d644d831748550bdfe21bd8444f49d2c62f5768 /gcc/tree-ssa.c | |
parent | 830afa4b0c8f2012b91c639f18a426d18aa36af2 (diff) | |
download | gcc-c6b0d21d49a2605b2c667cec37b31140133b1fd5.zip gcc-c6b0d21d49a2605b2c667cec37b31140133b1fd5.tar.gz gcc-c6b0d21d49a2605b2c667cec37b31140133b1fd5.tar.bz2 |
Introduce ssa_defined_default_def_p function (PR tree-optimization/79529).
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.
From-SVN: r245530
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 28020b0..831fd61 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -1251,27 +1251,39 @@ tree_ssa_strip_useless_type_conversions (tree exp) 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. */ |