diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-26 01:45:32 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-26 01:45:32 +0000 |
commit | 62350d6cc8c812321d45c70c7f4d0a7f26c4da6c (patch) | |
tree | 7d8ba2cbd41196e09164dbcd3753c2b0f9f360d4 /gcc/explow.c | |
parent | 3f4af5aca98f37d626fcf6268e078460158f40c7 (diff) | |
download | gcc-62350d6cc8c812321d45c70c7f4d0a7f26c4da6c.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78475 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/explow.c')
-rw-r--r-- | gcc/explow.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index 9e04bd896f9..d3f8c211ea2 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; } |