aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index c0c89113d41..6ec0575990d 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-data-ref.h"
#include "params.h"
#include "flags.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "tree-inline.h"
#include "gmp.h"
@@ -2397,7 +2398,7 @@ derive_constant_upper_bound_ops (tree type, tree op0,
/* OP0 + CST. We need to check that
BND <= MAX (type) - CST. */
- mmax = double_int_add (max, double_int_neg (cst));
+ mmax = double_int_sub (max, cst);
if (double_int_ucmp (bnd, mmax) > 0)
return max;
@@ -2429,7 +2430,7 @@ derive_constant_upper_bound_ops (tree type, tree op0,
return max;
}
- bnd = double_int_add (bnd, double_int_neg (cst));
+ bnd = double_int_sub (bnd, cst);
}
return bnd;
@@ -2625,7 +2626,7 @@ array_at_struct_end_p (tree ref)
/* Unless the reference is through a pointer, the size of the array matches
its declaration. */
- if (!base || !INDIRECT_REF_P (base))
+ if (!base || (!INDIRECT_REF_P (base) && TREE_CODE (base) != MEM_REF))
return false;
for (;handled_component_p (ref); ref = parent)
@@ -2640,7 +2641,7 @@ array_at_struct_end_p (tree ref)
/* Unless the field is at the end of the struct, we are done. */
field = TREE_OPERAND (ref, 1);
- if (TREE_CHAIN (field))
+ if (DECL_CHAIN (field))
return false;
}
@@ -2651,7 +2652,6 @@ array_at_struct_end_p (tree ref)
Therefore, continue checking. */
}
- gcc_assert (INDIRECT_REF_P (ref));
return true;
}