aboutsummaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>2001-11-03 10:50:04 -0500
committerRichard Kenner <kenner@gcc.gnu.org>2001-11-03 10:50:04 -0500
commit1285011e67bc94e8ed28b9711ace7445d4588254 (patch)
tree72debaad8ba738e2cb6c88c8463e497466353307 /gcc/emit-rtl.c
parent343fb4120866d610c7e233f19dfcf2b3322774ca (diff)
downloadgcc-1285011e67bc94e8ed28b9711ace7445d4588254.zip
gcc-1285011e67bc94e8ed28b9711ace7445d4588254.tar.gz
gcc-1285011e67bc94e8ed28b9711ace7445d4588254.tar.bz2
emit-rtl.c (set_mem_attributes): Set RTX_UNCHANGINGP_P if T is a constant expression.
* emit-rtl.c (set_mem_attributes): Set RTX_UNCHANGINGP_P if T is a constant expression. (set_mem_decl): New function. * expr.h (set_mem_decl): New declaration. * final.c (get_decl_from_op): Don't use ORIGINAL_REGNO if not pseudo. (output_asm_operand_names): Add tab. * reload1.c (alter_reg): Set decl of MEM from REG_DECL. From-SVN: r46733
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 992d604..6186638 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1691,8 +1691,9 @@ set_mem_attributes (ref, t, objectp)
MEM_VOLATILE_P (ref) = TYPE_VOLATILE (type);
MEM_IN_STRUCT_P (ref) = AGGREGATE_TYPE_P (type);
RTX_UNCHANGING_P (ref)
- |= (lang_hooks.honor_readonly
- && (TYPE_READONLY (type) || TREE_READONLY (t)));
+ |= ((lang_hooks.honor_readonly
+ && (TYPE_READONLY (type) || TREE_READONLY (t)))
+ || (! TYPE_P (t) && TREE_CONSTANT (t)));
/* If we are making an object of this type, or if this is a DECL, we know
that it is a scalar if the type is not an aggregate. */
@@ -1783,6 +1784,18 @@ set_mem_align (mem, align)
MEM_OFFSET (mem), MEM_SIZE (mem), align,
GET_MODE (mem));
}
+
+/* Set the decl for MEM to DECL. */
+
+void
+set_mem_decl (mem, decl)
+ rtx mem;
+ tree decl;
+{
+ MEM_ATTRS (mem)
+ = get_mem_attrs (MEM_ALIAS_SET (mem), decl, MEM_OFFSET (mem),
+ MEM_SIZE (mem), MEM_ALIGN (mem), GET_MODE (mem));
+}
/* Return a memory reference like MEMREF, but with its mode changed to MODE
and its address changed to ADDR. (VOIDmode means don't change the mode.