diff options
author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-08 12:30:24 +0000 |
---|---|---|
committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-08 12:30:24 +0000 |
commit | ce6cd83745f681075e8674e76226510c1d928d34 (patch) | |
tree | a40e4e4be9ff9a6bd850682dfafca2001ca9643a /gcc/fixed-value.c | |
parent | 5ea5dde276499ca15ff1daf85dafadf48bb0f792 (diff) | |
download | gcc-ce6cd83745f681075e8674e76226510c1d928d34.tar.gz |
2008-12-08 Andrew Haley <aph@redhat.com>
Kamaraju Kusumanchi <raju.mailinglists@gmail.com>
* gimple.h (gimple_build_try): Fix declaration.
* builtins.c (fold_builtin_sqrt): Don't use a conditional
operator.
* fixed-value.c (do_fixed_add): Likewise.
* tree-ssa-loop-ivopts.c (iv_ca_cost): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142549 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixed-value.c')
-rw-r--r-- | gcc/fixed-value.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/fixed-value.c b/gcc/fixed-value.c index 8c8d3719044..26aaa023c84 100644 --- a/gcc/fixed-value.c +++ b/gcc/fixed-value.c @@ -291,9 +291,17 @@ do_fixed_add (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a, const FIXED_VALUE_TYPE *b, bool subtract_p, bool sat_p) { bool overflow_p = false; - double_int temp = subtract_p ? double_int_neg (b->data) : b->data; - bool unsigned_p = UNSIGNED_FIXED_POINT_MODE_P (a->mode); - int i_f_bits = GET_MODE_IBIT (a->mode) + GET_MODE_FBIT (a->mode); + bool unsigned_p; + double_int temp; + int i_f_bits; + + if (subtract_p) + temp = double_int_neg (b->data); + else + temp = b->data; + + unsigned_p = UNSIGNED_FIXED_POINT_MODE_P (a->mode); + i_f_bits = GET_MODE_IBIT (a->mode) + GET_MODE_FBIT (a->mode); f->mode = a->mode; f->data = double_int_add (a->data, temp); if (unsigned_p) /* Unsigned type. */ |