aboutsummaryrefslogtreecommitdiff
path: root/gcc/explow.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-02-25 17:45:32 -0800
committerRichard Henderson <rth@gcc.gnu.org>2004-02-25 17:45:32 -0800
commit4a4f95d919f9c8192b4f0b9fce30c5ebf5f8ffed (patch)
tree7d8ba2cbd41196e09164dbcd3753c2b0f9f360d4 /gcc/explow.c
parent0d593f318b033a47ef61d90ecbd85895dd811378 (diff)
downloadgcc-4a4f95d919f9c8192b4f0b9fce30c5ebf5f8ffed.zip
gcc-4a4f95d919f9c8192b4f0b9fce30c5ebf5f8ffed.tar.gz
gcc-4a4f95d919f9c8192b4f0b9fce30c5ebf5f8ffed.tar.bz2
explow.c (force_reg): Call mark_reg_pointer as appropriate.
* explow.c (force_reg): Call mark_reg_pointer as appropriate. * config/alpha/alpha.c (alpha_emit_conditional_branch): Don't use (op0-op1) == 0 if op0 is a pointer. * config/alpha/alpha.md (cmpdi): Use some_operand. (three comparison combine splits): Remove. From-SVN: r78475
Diffstat (limited to 'gcc/explow.c')
-rw-r--r--gcc/explow.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index 9e04bd8..d3f8c21 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -721,6 +721,40 @@ force_reg (enum machine_mode mode, rtx x)
&& ! rtx_equal_p (x, SET_SRC (set)))
set_unique_reg_note (insn, REG_EQUAL, x);
+ /* Let optimizers know that TEMP is a pointer, and if so, the
+ known alignment of that pointer. */
+ {
+ unsigned align = 0;
+ if (GET_CODE (x) == SYMBOL_REF)
+ {
+ align = BITS_PER_UNIT;
+ if (SYMBOL_REF_DECL (x) && DECL_P (SYMBOL_REF_DECL (x)))
+ align = DECL_ALIGN (SYMBOL_REF_DECL (x));
+ }
+ else if (GET_CODE (x) == LABEL_REF)
+ align = BITS_PER_UNIT;
+ else if (GET_CODE (x) == CONST
+ && GET_CODE (XEXP (x, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+ && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)
+ {
+ rtx s = XEXP (XEXP (x, 0), 0);
+ rtx c = XEXP (XEXP (x, 0), 1);
+ unsigned sa, ca;
+
+ sa = BITS_PER_UNIT;
+ if (SYMBOL_REF_DECL (s) && DECL_P (SYMBOL_REF_DECL (s)))
+ sa = DECL_ALIGN (SYMBOL_REF_DECL (s));
+
+ ca = exact_log2 (INTVAL (c) & -INTVAL (c)) * BITS_PER_UNIT;
+
+ align = MIN (sa, ca);
+ }
+
+ if (align)
+ mark_reg_pointer (temp, align);
+ }
+
return temp;
}