diff options
author | Mark Mitchell <mark@codesourcery.com> | 2002-10-14 21:19:05 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2002-10-14 21:19:05 +0000 |
commit | a3b885703b3f06403067eae7ff54f6826b6a5e08 (patch) | |
tree | 770e70e8378f7c6f20a975a6e92e056f9a8f584b /gcc/function.c | |
parent | 77631fa7edc6a2b6c4177c0f7a3b1eb454e372c3 (diff) | |
download | gcc-a3b885703b3f06403067eae7ff54f6826b6a5e08.zip gcc-a3b885703b3f06403067eae7ff54f6826b6a5e08.tar.gz gcc-a3b885703b3f06403067eae7ff54f6826b6a5e08.tar.bz2 |
re PR rtl-optimization/6631 (Miscompiled structure access)
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.
From-SVN: r58136
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/function.c b/gcc/function.c index 479ecef..0c066ed 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)); } |