summaryrefslogtreecommitdiff
path: root/gcc/regclass.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-18 21:34:14 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-18 21:34:14 +0000
commitfcdc122ea79b823c0ba3f9a2079e3260cce3fda7 (patch)
tree8efd4ef27021837ed8a888f7f93fac0cede0d926 /gcc/regclass.c
parentb28b3cd223f327f5367a7009317a61de29eb7c22 (diff)
downloadgcc-fcdc122ea79b823c0ba3f9a2079e3260cce3fda7.tar.gz
* emit-rtl.c (gen_reg_rtx): Also reallocate reg_decl array.
(offset_address): New function. (free_emit_status): Free regno_decl. (init_emit): Pass proper number of elements to xcalloc. Allocate regno_decl. (mark_emit_status): Mark regno_decl values. * expr.c (highest_pow2_factor): New function. (expand_assigment): Use it and offset_address. Properly handle ptr_mode vs. Pmode in offset calculation. (store_constructor, expand_expr_unaligned): Likewise. (expand_expr, case COMPONENT_EXPR): Likewise. * expr.h (offset_address): New decl. * function.h (struct emit_status): Add regno_decl. (REGNO_DECL): New macro. * final.c (output_asm_name): Move in file and don't conditionalize on flag_print_asm_name. (output_asm_insn): Only call output_asm_name if flag_print_asm_name. Output names of operands, if known. * function.c (assign_parms): Set REGNO_DECL. * integrate.c (integrate_decl_tree): Likewise. * stmt.c (expand_decl): Likewise. * regclass.c (reg_scan_mark_refs): Propagate REGNO_DECL for copies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46337 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regclass.c')
-rw-r--r--gcc/regclass.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/regclass.c b/gcc/regclass.c
index a514bd5a4a6..826da242dc1 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -2496,6 +2496,24 @@ reg_scan_mark_refs (x, insn, note_flag, min_regno)
|| GET_CODE (XEXP (note, 0)) == LABEL_REF))))
REG_POINTER (SET_DEST (x)) = 1;
+ /* If this is setting a register from a register or from a simple
+ conversion of a register, propagate REG_DECL. */
+ if (GET_CODE (dest) == REG)
+ {
+ rtx src = SET_SRC (x);
+
+ while (GET_CODE (src) == SIGN_EXTEND
+ || GET_CODE (src) == ZERO_EXTEND
+ || GET_CODE (src) == TRUNCATE
+ || (GET_CODE (src) == SUBREG && subreg_lowpart_p (src)))
+ src = XEXP (src, 0);
+
+ if (GET_CODE (src) == REG && REGNO_DECL (REGNO (src)) == 0)
+ REGNO_DECL (REGNO (src)) = REGNO_DECL (REGNO (dest));
+ else if (GET_CODE (src) == REG && REGNO_DECL (REGNO (dest)) == 0)
+ REGNO_DECL (REGNO (dest)) = REGNO_DECL (REGNO (src));
+ }
+
/* ... fall through ... */
default: