From ce6cd83745f681075e8674e76226510c1d928d34 Mon Sep 17 00:00:00 2001 From: aph Date: Mon, 8 Dec 2008 12:30:24 +0000 Subject: [PATCH] 2008-12-08 Andrew Haley Kamaraju Kusumanchi * 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 --- gcc/ChangeLog | 10 ++++++++++ gcc/builtins.c | 7 +++++-- gcc/fixed-value.c | 14 +++++++++++--- gcc/gimple.h | 2 +- gcc/tree-ssa-loop-ivopts.c | 5 ++++- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ed541f1..353bdd1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2008-12-08 Andrew Haley + Kamaraju Kusumanchi + + * 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. + 2008-12-08 Jakub Jelinek PR middle-end/36802 diff --git a/gcc/builtins.c b/gcc/builtins.c index 4d507cf..63ca618 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -7681,8 +7681,11 @@ fold_builtin_sqrt (tree arg, tree type) tree arg0 = CALL_EXPR_ARG (arg, 0); tree tree_root; /* The inner root was either sqrt or cbrt. */ - REAL_VALUE_TYPE dconstroot = - BUILTIN_SQRT_P (fcode) ? dconsthalf : dconst_third (); + REAL_VALUE_TYPE dconstroot; + if (BUILTIN_SQRT_P (fcode)) + dconstroot = dconsthalf; + else + dconstroot = dconst_third (); /* Adjust for the outer root. */ SET_REAL_EXP (&dconstroot, REAL_EXP (&dconstroot) - 1); diff --git a/gcc/fixed-value.c b/gcc/fixed-value.c index 8c8d371..26aaa02 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. */ diff --git a/gcc/gimple.h b/gcc/gimple.h index debba12..8f8e49b 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -793,7 +793,7 @@ gimple gimple_build_asm_vec (const char *, VEC(tree,gc) *, VEC(tree,gc) *, VEC(tree,gc) *); gimple gimple_build_catch (tree, gimple_seq); gimple gimple_build_eh_filter (tree, gimple_seq); -gimple gimple_build_try (gimple_seq, gimple_seq, unsigned int); +gimple gimple_build_try (gimple_seq, gimple_seq, enum gimple_try_flags); gimple gimple_build_wce (gimple_seq); gimple gimple_build_resx (int); gimple gimple_build_switch (unsigned, tree, tree, ...); diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index aa0472e..0059443 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -4355,7 +4355,10 @@ iv_ca_add_use (struct ivopts_data *data, struct iv_ca *ivs, static comp_cost iv_ca_cost (struct iv_ca *ivs) { - return (ivs->bad_uses ? infinite_cost : ivs->cost); + if (ivs->bad_uses) + return infinite_cost; + else + return ivs->cost; } /* Returns true if all dependences of CP are among invariants in IVS. */ -- 2.7.4