From: Jason Merrill Date: Tue, 13 Jan 2004 00:01:46 +0000 (-0500) Subject: re PR c++/12815 (Code compiled with optimization behaves unexpectedly) X-Git-Tag: releases/gcc-3.4.0~1055 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b25f6e5eb2e3cf6391ec4972b3a3ea910f98d9f;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 941176d855b4..7dd1d8862a75 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2004-01-12 Jason Merrill + + 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 PR opt/10776 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index b6649ab3b483..b376f99aa218 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; }