aboutsummaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorPeter Bergner <bergner@vnet.ibm.com>2008-04-07 12:36:59 -0500
committerPeter Bergner <bergner@gcc.gnu.org>2008-04-07 12:36:59 -0500
commit46b71b0354e0eba0e0b176a80434bb3a953aadb6 (patch)
tree1d70b0b5be2385ffac16616696a1ca2968a86039 /gcc/emit-rtl.c
parent64ef8953e3507ad5e3f356e4d65a0d7fd9d10355 (diff)
downloadgcc-46b71b0354e0eba0e0b176a80434bb3a953aadb6.zip
gcc-46b71b0354e0eba0e0b176a80434bb3a953aadb6.tar.gz
gcc-46b71b0354e0eba0e0b176a80434bb3a953aadb6.tar.bz2
PR middle-end/PR28690
PR middle-end/PR28690 * rtlanal.c: Update copyright years. (commutative_operand_precedence): Give SYMBOL_REF's the same precedence as REG_POINTER and MEM_POINTER operands. * emit-rtl.c (gen_reg_rtx_and_attrs): New function. (set_reg_attrs_from_value): Call mark_reg_pointer as appropriate. * rtl.h (gen_reg_rtx_and_attrs): Add prototype for new function. * gcse.c: Update copyright years. (pre_delete): Call gen_reg_rtx_and_attrs. (hoist_code): Likewise. (build_store_vectors): Likewise. (delete_store): Likewise. * loop-invariant.c (move_invariant_reg): Likewise. Update copyright years. From-SVN: r133985
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index fd26d01..2fe9116 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -964,11 +964,32 @@ set_reg_attrs_from_value (rtx reg, rtx x)
int offset;
offset = byte_lowpart_offset (GET_MODE (reg), GET_MODE (x));
- if (MEM_P (x) && MEM_OFFSET (x) && GET_CODE (MEM_OFFSET (x)) == CONST_INT)
- REG_ATTRS (reg)
- = get_reg_attrs (MEM_EXPR (x), INTVAL (MEM_OFFSET (x)) + offset);
- if (REG_P (x) && REG_ATTRS (x))
- update_reg_offset (reg, x, offset);
+ if (MEM_P (x))
+ {
+ if (MEM_OFFSET (x) && GET_CODE (MEM_OFFSET (x)) == CONST_INT)
+ REG_ATTRS (reg)
+ = get_reg_attrs (MEM_EXPR (x), INTVAL (MEM_OFFSET (x)) + offset);
+ if (MEM_POINTER (x))
+ mark_reg_pointer (reg, MEM_ALIGN (x));
+ }
+ else if (REG_P (x))
+ {
+ if (REG_ATTRS (x))
+ update_reg_offset (reg, x, offset);
+ if (REG_POINTER (x))
+ mark_reg_pointer (reg, REGNO_POINTER_ALIGN (REGNO (x)));
+ }
+}
+
+/* Generate a REG rtx for a new pseudo register, copying the mode
+ and attributes from X. */
+
+rtx
+gen_reg_rtx_and_attrs (rtx x)
+{
+ rtx reg = gen_reg_rtx (GET_MODE (x));
+ set_reg_attrs_from_value (reg, x);
+ return reg;
}
/* Set the register attributes for registers contained in PARM_RTX.