diff options
author | Richard Biener <rguenth@gcc.gnu.org> | 2010-07-05 13:06:07 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-07-05 13:06:07 +0000 |
commit | bdc453866cbd815b1d62d858272b8a40f8fdc9fa (patch) | |
tree | 04c9b9fa1818c750489682948c3f7dda525bc7e4 /gcc/fixed-value.c | |
parent | 989ea525bec01e16c29b69bf5194310c551d9c34 (diff) | |
download | gcc-bdc453866cbd815b1d62d858272b8a40f8fdc9fa.zip gcc-bdc453866cbd815b1d62d858272b8a40f8fdc9fa.tar.gz gcc-bdc453866cbd815b1d62d858272b8a40f8fdc9fa.tar.bz2 |
double-int.h (double_int_sub): Declare.
2010-07-05 Richard Guenther <rguenther@suse.de>
* double-int.h (double_int_sub): Declare.
* double-int.c (double_int_sub): New function.
* dwarf2out.c (field_byte_offset): Use it.
* fixed-value.c (do_fixed_add): Likewise.
(do_fixed_multiply): Likewise.
(do_fixed_divide): Likewise.
* tree-predcom.c (add_ref_to_chain): Likewise.
(determine_roots_comp): Likewise.
* tree-ssa-loop-niter.c (derive_constant_upper_bound_ops): Likewise.
From-SVN: r161835
Diffstat (limited to 'gcc/fixed-value.c')
-rw-r--r-- | gcc/fixed-value.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/fixed-value.c b/gcc/fixed-value.c index 9af431c..50dc14e 100644 --- a/gcc/fixed-value.c +++ b/gcc/fixed-value.c @@ -361,7 +361,7 @@ do_fixed_add (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a, double_int one; one.low = 1; one.high = 0; - f->data = double_int_add (f->data, double_int_neg (one)); + f->data = double_int_sub (f->data, one); } } else @@ -443,12 +443,12 @@ do_fixed_multiply (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a, temp1.high = 0; r = double_int_add (r, temp1); - /* We need to add neg(b) to r, if a < 0. */ + /* We need to subtract b from r, if a < 0. */ if (!unsigned_p && a->data.high < 0) - r = double_int_add (r, double_int_neg (b->data)); - /* We need to add neg(a) to r, if b < 0. */ + r = double_int_sub (r, b->data); + /* We need to subtract a from r, if b < 0. */ if (!unsigned_p && b->data.high < 0) - r = double_int_add (r, double_int_neg (a->data)); + r = double_int_sub (r, a->data); /* Shift right the result by FBIT. */ if (GET_MODE_FBIT (f->mode) == 2 * HOST_BITS_PER_WIDE_INT) @@ -588,7 +588,7 @@ do_fixed_divide (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a, &quo_s.low, &quo_s.high, 0); /* Try to calculate (mod - pos_b). */ - temp = double_int_add (mod, double_int_neg (pos_b)); + temp = double_int_sub (mod, pos_b); if (leftmost_mod == 1 || double_int_cmp (mod, pos_b, 1) != -1) { |