From: Gabriel Dos Reis Date: Wed, 14 Jan 2004 09:05:44 +0000 (+0000) Subject: re PR c++/12815 (Code compiled with optimization behaves unexpectedly) X-Git-Tag: releases/gcc-3.3.3~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=726ae3b704a68571e0329784a3cce36752ae6c21;p=thirdparty%2Fgcc.git re PR c++/12815 (Code compiled with optimization behaves unexpectedly) Backport from mainline 2004-01-05 Mark Mitchell PR c++/12816 * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable references as constant. From-SVN: r75851 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 66682f9ccecc..2b88ca0304f8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2004-01-14 Gabriel Dos Reis + + Backport from mainline + 2004-01-05 Mark Mitchell + + PR c++/12816 + * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable + references as constant. + 2004-01-11 Gabriel Dos Reis PR c++/13544 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 6787269dc9ad..7640ad8047c9 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -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; }