diff options
author | Richard Biener <rguenther@suse.de> | 2015-07-24 08:31:07 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-07-24 08:31:07 +0000 |
commit | 96a111a3dfb5def92156e41ea48f7677f34ce3c2 (patch) | |
tree | ea73c4893759d64987134135112562c59854df86 /gcc/fold-const.c | |
parent | 37d486ab11c0d4f1e860b6dbc46e2e94bb8f0647 (diff) | |
download | gcc-96a111a3dfb5def92156e41ea48f7677f34ce3c2.zip gcc-96a111a3dfb5def92156e41ea48f7677f34ce3c2.tar.gz gcc-96a111a3dfb5def92156e41ea48f7677f34ce3c2.tar.bz2 |
genmatch.c (add_operator): Allow SSA_NAME as predicate.
2015-07-24 Richard Biener <rguenther@suse.de>
* genmatch.c (add_operator): Allow SSA_NAME as predicate.
* fold-const.c (fold_comparison): Move parameter does not
alias &local simplification ...
* match.pd: ... as a pattern here.
From-SVN: r226140
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 886922f..54a6b13 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -8467,33 +8467,9 @@ fold_comparison (location_t loc, enum tree_code code, tree type, } } - /* A local variable can never be pointed to by - the default SSA name of an incoming parameter. */ - if ((TREE_CODE (arg0) == ADDR_EXPR - && indirect_base0 - && TREE_CODE (base0) == VAR_DECL - && auto_var_in_fn_p (base0, current_function_decl) - && !indirect_base1 - && TREE_CODE (base1) == SSA_NAME - && SSA_NAME_IS_DEFAULT_DEF (base1) - && TREE_CODE (SSA_NAME_VAR (base1)) == PARM_DECL) - || (TREE_CODE (arg1) == ADDR_EXPR - && indirect_base1 - && TREE_CODE (base1) == VAR_DECL - && auto_var_in_fn_p (base1, current_function_decl) - && !indirect_base0 - && TREE_CODE (base0) == SSA_NAME - && SSA_NAME_IS_DEFAULT_DEF (base0) - && TREE_CODE (SSA_NAME_VAR (base0)) == PARM_DECL)) - { - if (code == NE_EXPR) - return constant_boolean_node (1, type); - else if (code == EQ_EXPR) - return constant_boolean_node (0, type); - } /* If we have equivalent bases we might be able to simplify. */ - else if (indirect_base0 == indirect_base1 - && operand_equal_p (base0, base1, 0)) + if (indirect_base0 == indirect_base1 + && operand_equal_p (base0, base1, 0)) { /* We can fold this expression to a constant if the non-constant offset parts are equal. */ |