summaryrefslogtreecommitdiff
path: root/gcc/graphite-clast-to-gimple.c
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2010-09-30 21:16:25 +0000
committerSebastian Pop <spop@gcc.gnu.org>2010-09-30 21:16:25 +0000
commitc606063947f1651fea14bdd558c216737e1f85b5 (patch)
treec10580cdeda26a902cf0fe64da71b16a388f97f9 /gcc/graphite-clast-to-gimple.c
parent2c2aceeb4d63c382806d1510c3691acb767bba6c (diff)
downloadgcc-c606063947f1651fea14bdd558c216737e1f85b5.tar.gz
Generate in priority signed types for integer constants.
2010-07-29 Sebastian Pop <sebastian.pop@amd.com> * graphite-clast-to-gimple.c (gcc_type_for_interval): Generate in priority signed types. From-SVN: r164772
Diffstat (limited to 'gcc/graphite-clast-to-gimple.c')
-rw-r--r--gcc/graphite-clast-to-gimple.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 73bd97144f0..88a72f1fea7 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -459,9 +459,6 @@ gcc_type_for_interval (mpz_t low, mpz_t up)
gcc_assert (mpz_cmp (low, up) <= 0);
- if (mpz_sgn (low) < 0)
- unsigned_p = false;
-
prec_up = precision_for_value (up);
prec_int = precision_for_interval (low, up);
precision = MAX (prec_up, prec_int);
@@ -472,6 +469,15 @@ gcc_type_for_interval (mpz_t low, mpz_t up)
return integer_type_node;
}
+ if (mpz_sgn (low) <= 0)
+ unsigned_p = false;
+
+ else if (precision < BITS_PER_WORD)
+ {
+ unsigned_p = false;
+ precision++;
+ }
+
mode = smallest_mode_for_size (precision, MODE_INT);
precision = GET_MODE_PRECISION (mode);
type = build_nonstandard_integer_type (precision, unsigned_p);