summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-30 17:19:02 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-30 17:19:02 +0000
commit951019127b9f3cf59989ceb74539d454d535d3b5 (patch)
tree958443e6076f37a3ff7d07d9303f5c4171944638 /gcc/tree-ssa-ccp.c
parentbedbed50ff969478b0c8878678d7c169a8a0cdaf (diff)
parent8a21d39cf1ea8183eb1e95bbb4396d97ae0dc36d (diff)
downloadgcc-951019127b9f3cf59989ceb74539d454d535d3b5.tar.gz
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@209944 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index b1e21b8b47c..99e1920a070 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -1803,6 +1803,25 @@ evaluate_stmt (gimple stmt)
val = bit_value_assume_aligned (stmt, NULL_TREE, val, false);
break;
+ case BUILT_IN_ALIGNED_ALLOC:
+ {
+ tree align = get_constant_value (gimple_call_arg (stmt, 0));
+ if (align
+ && tree_fits_uhwi_p (align))
+ {
+ unsigned HOST_WIDE_INT aligni = tree_to_uhwi (align);
+ if (aligni > 1
+ /* align must be power-of-two */
+ && (aligni & (aligni - 1)) == 0)
+ {
+ val.lattice_val = CONSTANT;
+ val.value = build_int_cst (ptr_type_node, 0);
+ val.mask = double_int::from_shwi (-aligni);
+ }
+ }
+ break;
+ }
+
default:;
}
}