]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/12815 (Code compiled with optimization behaves unexpectedly)
authorJason Merrill <jason@redhat.com>
Tue, 13 Jan 2004 00:01:46 +0000 (19:01 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 13 Jan 2004 00:01:46 +0000 (19:01 -0500)
        PR c++/12815
        * class.c (build_base_path): Do not mark vtable references as
        TREE_CONSTANT.
        (build_vtbl_ref_1): Likewise.

From-SVN: r75770

gcc/cp/ChangeLog
gcc/cp/class.c

index 941176d855b40ff35bc0ddde9db1359d3f8f0c90..7dd1d8862a7503b3ef01df02da4a53af60afb12d 100644 (file)
@@ -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
index b6649ab3b483d754c97c0b2a071dc6f0c8922a0f..b376f99aa218adb0c0bd4e0e9620d91ce7b5a962 100644 (file)
@@ -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;
 }