aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-manip.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2018-06-20 14:44:45 +0000
committerTom de Vries <vries@gcc.gnu.org>2018-06-20 14:44:45 +0000
commit60f02f902170249d3a7fe763c10c1aa9375b1150 (patch)
tree971fa6dd2d0a467da27355696207dbf891ae4fa3 /gcc/tree-ssa-loop-manip.c
parentd53e8ef490e59839909b536b1cf1d8aaaecfe43f (diff)
downloadgcc-60f02f902170249d3a7fe763c10c1aa9375b1150.zip
gcc-60f02f902170249d3a7fe763c10c1aa9375b1150.tar.gz
gcc-60f02f902170249d3a7fe763c10c1aa9375b1150.tar.bz2
Generate correctly typed compare in canonicalize_loop_ivs
2018-06-20 Tom de Vries <tdevries@suse.de> PR tree-optimization/86097 * tree-ssa-loop-manip.c (canonicalize_loop_ivs): Also convert *nit to iv type if signedness of iv type is not the same as that of *nit. * gcc.dg/autopar/pr86097.c: New test. From-SVN: r261804
Diffstat (limited to 'gcc/tree-ssa-loop-manip.c')
-rw-r--r--gcc/tree-ssa-loop-manip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index bf425af..5acee6c 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -1542,7 +1542,8 @@ canonicalize_loop_ivs (struct loop *loop, tree *nit, bool bump_in_latch)
precision = GET_MODE_PRECISION (mode);
type = build_nonstandard_integer_type (precision, unsigned_p);
- if (original_precision != precision)
+ if (original_precision != precision
+ || TYPE_UNSIGNED (TREE_TYPE (*nit)) != unsigned_p)
{
*nit = fold_convert (type, *nit);
*nit = force_gimple_operand (*nit, &stmts, true, NULL_TREE);