summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-14 21:19:05 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-14 21:19:05 +0000
commit25763d80f298a3ff04571a01db5d6f215a936145 (patch)
tree770e70e8378f7c6f20a975a6e92e056f9a8f584b /gcc/function.c
parentd77d25c661178a591126882260f0ee3d7d9d7fca (diff)
downloadgcc-25763d80f298a3ff04571a01db5d6f215a936145.tar.gz
PR optimization/6631
* Makefile.in (function.o): Depend on langhooks.h. * alias.c (objects_must_conflict_p): Check honor_readonly when examining TYPE_READONLY. * function.c (assign_stack_temp_for_type): Likewise. PR optimization/6631 * g++.dg/opt/const2.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58136 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 479ecef4141..0c066ed0358 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -798,7 +798,8 @@ assign_stack_temp_for_type (mode, size, keep, type)
/* If a type is specified, set the relevant flags. */
if (type != 0)
{
- RTX_UNCHANGING_P (slot) = TYPE_READONLY (type);
+ RTX_UNCHANGING_P (slot) = (lang_hooks.honor_readonly
+ && TYPE_READONLY (type));
MEM_VOLATILE_P (slot) = TYPE_VOLATILE (type);
MEM_SET_IN_STRUCT_P (slot, AGGREGATE_TYPE_P (type));
}