aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-05-20 12:02:35 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-05-20 12:02:35 +0000
commit810c42c38d37317c80b57db0a8b6d8991e78ef50 (patch)
tree29e48744a988ebb4109a6925c23fd39ee2971651 /gcc/tree-ssa-structalias.c
parentc6b84edb6110dd2b4fb654c53c0a9979e0532ffe (diff)
downloadgcc-810c42c38d37317c80b57db0a8b6d8991e78ef50.zip
gcc-810c42c38d37317c80b57db0a8b6d8991e78ef50.tar.gz
gcc-810c42c38d37317c80b57db0a8b6d8991e78ef50.tar.bz2
tree-ssa-structalias.c (find_func_aliases): POINTER_DIFF_EXPR doesn't produce pointers.
2019-05-20 Richard Biener <rguenther@suse.de> * tree-ssa-structalias.c (find_func_aliases): POINTER_DIFF_EXPR doesn't produce pointers. {TRUNC,CEIL,FLOOR,ROUND,EXACT}_{DIV,MOD}_EXPR points to what the first operand points to. From-SVN: r271414
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 2e2b0e8..d8ff2ce6 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -4900,6 +4900,9 @@ find_func_aliases (struct function *fn, gimple *origt)
if (code == POINTER_PLUS_EXPR)
get_constraint_for_ptr_offset (gimple_assign_rhs1 (t),
gimple_assign_rhs2 (t), &rhsc);
+ else if (code == POINTER_DIFF_EXPR)
+ /* The result is not a pointer (part). */
+ ;
else if (code == BIT_AND_EXPR
&& TREE_CODE (gimple_assign_rhs2 (t)) == INTEGER_CST)
{
@@ -4908,6 +4911,17 @@ find_func_aliases (struct function *fn, gimple *origt)
get_constraint_for_ptr_offset (gimple_assign_rhs1 (t),
NULL_TREE, &rhsc);
}
+ else if (code == TRUNC_DIV_EXPR
+ || code == CEIL_DIV_EXPR
+ || code == FLOOR_DIV_EXPR
+ || code == ROUND_DIV_EXPR
+ || code == EXACT_DIV_EXPR
+ || code == TRUNC_MOD_EXPR
+ || code == CEIL_MOD_EXPR
+ || code == FLOOR_MOD_EXPR
+ || code == ROUND_MOD_EXPR)
+ /* Division and modulo transfer the pointer from the LHS. */
+ get_constraint_for_rhs (gimple_assign_rhs1 (t), &rhsc);
else if ((CONVERT_EXPR_CODE_P (code)
&& !(POINTER_TYPE_P (gimple_expr_type (t))
&& !POINTER_TYPE_P (TREE_TYPE (rhsop))))