aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-chrec.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2006-08-17 08:22:05 +0000
committerZdenek Dvorak <dvorakz@suse.cz>2006-08-17 08:22:05 +0000
commit0ad7e25cc66b9d8448676a55ff013e5e3155beab (patch)
treec20e13777a5de4b4baf2a2a1fb88f0351d8a1b0e /gcc/tree-chrec.c
parent539fc4efde2022cda48076c26f1ba611b5c85108 (diff)
PR tree-optimization/27865
* tree-vrp.c (adjust_range_with_scev): Do not use TYPE_{MIN,MAX}_VALUE for pointer types. * tree-scalar-evolution.c (fold_used_pointer_cast, pointer_offset_p, fold_used_pointer, pointer_used_p): New functions. (analyze_scalar_evolution_1): Use fold_used_pointer. * tree-chrec.c (convert_affine_scev): Convert no-op casts correctly. * tree-ssa-loop-ivopts.c (generic_type_for): Return integral type for pointers. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@116213 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-chrec.c')
-rw-r--r--gcc/tree-chrec.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index f36fc9b0291..a74a49c3972 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -1162,7 +1162,10 @@ convert_affine_scev (struct loop *loop, tree type,
-- must_check_src_overflow is true, and the range of TYPE is superset
of the range of CT -- i.e., in all cases except if CT signed and
TYPE unsigned.
- -- both CT and TYPE have the same precision and signedness. */
+ -- both CT and TYPE have the same precision and signedness, and we
+ verify instead that the source does not overflow (this may be
+ easier than verifying it for the result, as we may use the
+ information about the semantics of overflow in CT). */
if (must_check_src_overflow)
{
if (TYPE_UNSIGNED (type) && !TYPE_UNSIGNED (ct))
@@ -1172,7 +1175,10 @@ convert_affine_scev (struct loop *loop, tree type,
}
else if (TYPE_UNSIGNED (ct) == TYPE_UNSIGNED (type)
&& TYPE_PRECISION (ct) == TYPE_PRECISION (type))
- must_check_rslt_overflow = false;
+ {
+ must_check_rslt_overflow = false;
+ must_check_src_overflow = true;
+ }
else
must_check_rslt_overflow = true;
}