]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/12815 (Code compiled with optimization behaves unexpectedly)
authorGabriel Dos Reis <gdr@integrable-solutions.net>
Wed, 14 Jan 2004 09:05:44 +0000 (09:05 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Wed, 14 Jan 2004 09:05:44 +0000 (09:05 +0000)
Backport from mainline
2004-01-05  Mark Mitchell  <mark@codesourcery.com>

PR c++/12816
 * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
  references as constant.

From-SVN: r75851

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

index 66682f9ccecccb23c3ffb91a78e2071eefed52a7..2b88ca0304f8e84dbd5737691980cf87ff69f334 100644 (file)
@@ -1,3 +1,12 @@
+2004-01-14  Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+       Backport from mainline
+       2004-01-05  Mark Mitchell  <mark@codesourcery.com>
+       PR c++/12816
+       * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
+       references as constant. 
+       
 2004-01-11  Gabriel Dos Reis <gdr@integrable-solutions.net>
 
        PR c++/13544
index 6787269dc9ad6d9552037330d95a99a30644b50e..7640ad8047c9bc6b89a63626d4d713b5fa2ce9f3 100644 (file)
@@ -497,7 +497,7 @@ build_vtbl_ref_1 (instance, idx)
   assemble_external (vtbl);
 
   aref = build_array_ref (vtbl, idx);
-  TREE_CONSTANT (aref) = 1;
+  TREE_CONSTANT (aref) |= TREE_CONSTANT (vtbl) && TREE_CONSTANT (idx);
 
   return aref;
 }