diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2004-11-03 17:56:48 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2004-11-03 17:56:48 +0000 |
commit | a85a902471ec546f41cd2774c2a339354cc40a50 (patch) | |
tree | 0ab1ae9c37b6843d8a8ae3785f234a14c9dcbe20 /gcc | |
parent | c4bda9f0cf757474d9970e3e9174a76eb31b0444 (diff) | |
download | gcc-a85a902471ec546f41cd2774c2a339354cc40a50.zip gcc-a85a902471ec546f41cd2774c2a339354cc40a50.tar.gz gcc-a85a902471ec546f41cd2774c2a339354cc40a50.tar.bz2 |
tree-ssa-loop-ivopts.c (get_address_cost): Offset zero does not cause extra costs.
* tree-ssa-loop-ivopts.c (get_address_cost): Offset zero does not
cause extra costs. Generate canonical RTL.
From-SVN: r90030
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 15 |
2 files changed, 10 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0128360..accb133 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-11-03 Ulrich Weigand <uweigand@de.ibm.com> + + * tree-ssa-loop-ivopts.c (get_address_cost): Offset zero does not + cause extra costs. Generate canonical RTL. + 2004-11-02 Daniel Berlin <dberlin@dberlin.org> * lambda-code.c (lambda_compute_auxillary_space): Update comments. diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 58771cd..f457f7a 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -2485,7 +2485,8 @@ get_address_cost (bool symbol_present, bool var_present, s_offset = offset; cost = 0; - offset_p = (min_offset <= s_offset && s_offset <= max_offset); + offset_p = (s_offset != 0 + && min_offset <= s_offset && s_offset <= max_offset); ratio_p = (ratio != 1 && -MAX_RATIO <= ratio && ratio <= MAX_RATIO && TEST_BIT (valid_mult, ratio + MAX_RATIO)); @@ -2509,6 +2510,9 @@ get_address_cost (bool symbol_present, bool var_present, if (ratio_p) addr = gen_rtx_fmt_ee (MULT, Pmode, addr, GEN_INT (rat)); + if (var_present) + addr = gen_rtx_fmt_ee (PLUS, Pmode, reg1, addr); + if (symbol_present) { base = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup ("")); @@ -2517,15 +2521,6 @@ get_address_cost (bool symbol_present, bool var_present, gen_rtx_fmt_ee (PLUS, Pmode, base, GEN_INT (off))); - if (var_present) - base = gen_rtx_fmt_ee (PLUS, Pmode, reg1, base); - } - - else if (var_present) - { - base = reg1; - if (offset_p) - base = gen_rtx_fmt_ee (PLUS, Pmode, base, GEN_INT (off)); } else if (offset_p) base = GEN_INT (off); |