aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-12-18 14:21:51 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2019-12-18 13:21:51 +0000
commitc7ac9a0c7e3916f192ad41227e16238fd1fa2fbf (patch)
treee68d5f0c5a6cebf9e7164a3aff5b36fbb475d67b /gcc/tree-ssa-ccp.c
parent1ad431f95c200fe4d1eccab9cd5487087adc2bd8 (diff)
downloadgcc-c7ac9a0c7e3916f192ad41227e16238fd1fa2fbf.zip
gcc-c7ac9a0c7e3916f192ad41227e16238fd1fa2fbf.tar.gz
gcc-c7ac9a0c7e3916f192ad41227e16238fd1fa2fbf.tar.bz2
ipa-param-manipulation.h (get_original_index): Declare.
* ipa-param-manipulation.h (get_original_index): Declare. * ipa-param-manipulation.c (ipa_param_adjustments::get_original_index): New member function. * ipa-prop.c (ipcp_get_parm_bits): New function. * ipa-prop.h (ipcp_get_parm_bits): Declare. * tree-ssa-ccp.c: Include cgraph.h, alloc-pool.h, symbol-summary.h, ipa-utils.h and ipa-prop.h (get_default_value): Use ipcp_get_parm_bits. * gcc.dg/ipa/ipa-bit-cp.c: New testcase. * gcc.dg/ipa/ipa-bit-cp-1.c: New testcase. * gcc.dg/ipa/ipa-bit-cp-2.c: New testcase. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r279523
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 72e15b1..a77c036 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -146,6 +146,11 @@ along with GCC; see the file COPYING3. If not see
#include "stringpool.h"
#include "attribs.h"
#include "tree-vector-builder.h"
+#include "cgraph.h"
+#include "alloc-pool.h"
+#include "symbol-summary.h"
+#include "ipa-utils.h"
+#include "ipa-prop.h"
/* Possible lattice values. */
typedef enum
@@ -292,11 +297,26 @@ get_default_value (tree var)
if (flag_tree_bit_ccp)
{
wide_int nonzero_bits = get_nonzero_bits (var);
- if (nonzero_bits != -1)
+ tree value;
+ widest_int mask;
+
+ if (SSA_NAME_VAR (var)
+ && TREE_CODE (SSA_NAME_VAR (var)) == PARM_DECL
+ && ipcp_get_parm_bits (SSA_NAME_VAR (var), &value, &mask))
+ {
+ val.lattice_val = CONSTANT;
+ val.value = value;
+ val.mask = mask;
+ if (nonzero_bits != -1)
+ val.mask &= extend_mask (nonzero_bits,
+ TYPE_SIGN (TREE_TYPE (var)));
+ }
+ else if (nonzero_bits != -1)
{
val.lattice_val = CONSTANT;
val.value = build_zero_cst (TREE_TYPE (var));
- val.mask = extend_mask (nonzero_bits, TYPE_SIGN (TREE_TYPE (var)));
+ val.mask = extend_mask (nonzero_bits,
+ TYPE_SIGN (TREE_TYPE (var)));
}
}
}