From 3a96c3b9d8cb8983c666c367fd7f9e5c278315df Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 18 Feb 2005 07:58:40 +0100 Subject: re PR c++/19813 (wrong code with -finline-limit) PR c++/19813 * emit-rtl.c (set_mem_attributes_minus_bitpos): Add assertion that ref to be marked MEM_READONLY_P doesn't have base that needs constructing. * decl.c (start_decl_1): Clear TREE_READONLY flag if its type has TYPE_NEEDS_CONSTRUCTING. (complete_vars): Likewise. From-SVN: r95217 --- gcc/emit-rtl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/emit-rtl.c') diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 46d9183..37bd665 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1533,7 +1533,12 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, if (base && DECL_P (base) && TREE_READONLY (base) && (TREE_STATIC (base) || DECL_EXTERNAL (base))) - MEM_READONLY_P (ref) = 1; + { + tree base_type = TREE_TYPE (base); + gcc_assert (!(base_type && TYPE_NEEDS_CONSTRUCTING (base_type)) + || DECL_ARTIFICIAL (base)); + MEM_READONLY_P (ref) = 1; + } if (TREE_THIS_VOLATILE (t)) MEM_VOLATILE_P (ref) = 1; -- cgit v1.1