From 62350d6cc8c812321d45c70c7f4d0a7f26c4da6c Mon Sep 17 00:00:00 2001 From: rth Date: Thu, 26 Feb 2004 01:45:32 +0000 Subject: * 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 --- gcc/explow.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'gcc/explow.c') 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; } -- cgit v1.2.1