aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2004-01-12 19:01:46 -0500
committerJason Merrill <jason@gcc.gnu.org>2004-01-12 19:01:46 -0500
commit7b25f6e5eb2e3cf6391ec4972b3a3ea910f98d9f (patch)
treecd1f29eeebd07890f82c6f710045a6bd10c6daf4 /gcc
parentf92ed976289342eea03baf372f77026ab6052ac7 (diff)
downloadgcc-7b25f6e5eb2e3cf6391ec4972b3a3ea910f98d9f.zip
gcc-7b25f6e5eb2e3cf6391ec4972b3a3ea910f98d9f.tar.gz
gcc-7b25f6e5eb2e3cf6391ec4972b3a3ea910f98d9f.tar.bz2
re PR c++/12815 (Code compiled with optimization behaves unexpectedly)
PR c++/12815 * class.c (build_base_path): Do not mark vtable references as TREE_CONSTANT. (build_vtbl_ref_1): Likewise. From-SVN: r75770
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/class.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 941176d..7dd1d88 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-12 Jason Merrill <jason@redhat.com>
+
+ PR c++/12815
+ * class.c (build_base_path): Do not mark vtable references as
+ TREE_CONSTANT.
+ (build_vtbl_ref_1): Likewise.
+
2004-01-12 Richard Henderson <rth@redhat.com>
PR opt/10776
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index b6649ab..b376f99 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -328,7 +328,6 @@ build_base_path (enum tree_code code,
build_pointer_type (ptrdiff_type_node),
v_offset);
v_offset = build_indirect_ref (v_offset, NULL);
- TREE_CONSTANT (v_offset) = 1;
offset = convert_to_integer (ptrdiff_type_node,
size_diffop (offset,
@@ -455,7 +454,6 @@ build_vtbl_ref_1 (tree instance, tree idx)
assemble_external (vtbl);
aref = build_array_ref (vtbl, idx);
- TREE_CONSTANT (aref) |= TREE_CONSTANT (vtbl) && TREE_CONSTANT (idx);
return aref;
}