aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-affine.c
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2021-09-13 19:49:49 +0200
committerThomas Koenig <tkoenig@gcc.gnu.org>2021-09-13 19:49:49 +0200
commitb18a97e5dd0935e1c4a626c230f21457d0aad3d5 (patch)
treec1818f41af6fe780deafb6cd6a183f32085fe654 /gcc/tree-affine.c
parente76a53644c9d70e998c0d050e9a456af388c6b61 (diff)
downloadgcc-b18a97e5dd0935e1c4a626c230f21457d0aad3d5.zip
gcc-b18a97e5dd0935e1c4a626c230f21457d0aad3d5.tar.gz
gcc-b18a97e5dd0935e1c4a626c230f21457d0aad3d5.tar.bz2
Merged current trunk to branch.
Diffstat (limited to 'gcc/tree-affine.c')
-rw-r--r--gcc/tree-affine.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
index 5620e6b..a65719d 100644
--- a/gcc/tree-affine.c
+++ b/gcc/tree-affine.c
@@ -1,5 +1,5 @@
/* Operations with affine combinations of trees.
- Copyright (C) 2005-2020 Free Software Foundation, Inc.
+ Copyright (C) 2005-2021 Free Software Foundation, Inc.
This file is part of GCC.
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimplify.h"
#include "dumpfile.h"
#include "cfgexpand.h"
+#include "value-query.h"
/* Extends CST as appropriate for the affine combinations COMB. */
@@ -345,11 +346,15 @@ expr_to_aff_combination (aff_tree *comb, tree_code code, tree type,
for below case:
(T1)(X *+- CST) -> (T1)X *+- (T1)CST
if X *+- CST doesn't overflow by range information. */
+ value_range vr;
if (TYPE_UNSIGNED (itype)
&& TYPE_OVERFLOW_WRAPS (itype)
&& TREE_CODE (op1) == INTEGER_CST
- && determine_value_range (op0, &minv, &maxv) == VR_RANGE)
+ && get_range_query (cfun)->range_of_expr (vr, op0)
+ && vr.kind () == VR_RANGE)
{
+ wide_int minv = vr.lower_bound ();
+ wide_int maxv = vr.upper_bound ();
wi::overflow_type overflow = wi::OVF_NONE;
signop sign = UNSIGNED;
if (icode == PLUS_EXPR)