diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2013-11-05 13:38:00 +0100 |
---|---|---|
committer | Marc Glisse <glisse@gcc.gnu.org> | 2013-11-05 12:38:00 +0000 |
commit | 75081240d0d199603e08ca73bb99bc1045af2c4a (patch) | |
tree | 80a5e2eddacbf6218ad99eb877fff486f31fc166 /gcc/tree-ssa-alias.c | |
parent | 3ff2ca23dcf986e846691ec259da9243c636e64c (diff) | |
download | gcc-75081240d0d199603e08ca73bb99bc1045af2c4a.zip gcc-75081240d0d199603e08ca73bb99bc1045af2c4a.tar.gz gcc-75081240d0d199603e08ca73bb99bc1045af2c4a.tar.bz2 |
tree-ssa-alias.h (ranges_overlap_p): Handle negative offsets.
2013-11-05 Marc Glisse <marc.glisse@inria.fr>
gcc/
* tree-ssa-alias.h (ranges_overlap_p): Handle negative offsets.
* tree-ssa-alias.c (ao_ref_init_from_ptr_and_size): Likewise.
gcc/testsuite/
* gcc.dg/tree-ssa/alias-26.c: New file.
From-SVN: r204388
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index efc08c2..6f7e853 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -559,7 +559,7 @@ ao_ref_alias_set (ao_ref *ref) } /* Init an alias-oracle reference representation from a gimple pointer - PTR and a gimple size SIZE in bytes. If SIZE is NULL_TREE the the + PTR and a gimple size SIZE in bytes. If SIZE is NULL_TREE then the size is assumed to be unknown. The access is assumed to be only to or after of the pointer target, not before it. */ @@ -576,11 +576,11 @@ ao_ref_init_from_ptr_and_size (ao_ref *ref, tree ptr, tree size) ptr = gimple_assign_rhs1 (stmt); else if (is_gimple_assign (stmt) && gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR - && host_integerp (gimple_assign_rhs2 (stmt), 0) - && (t1 = int_cst_value (gimple_assign_rhs2 (stmt))) >= 0) + && TREE_CODE (gimple_assign_rhs2 (stmt)) == INTEGER_CST) { ptr = gimple_assign_rhs1 (stmt); - extra_offset = BITS_PER_UNIT * t1; + extra_offset = BITS_PER_UNIT + * int_cst_value (gimple_assign_rhs2 (stmt)); } } |