aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2018-12-11 21:37:53 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-12-11 21:37:53 +0100
commit582d2481f7380441c345bf1dfe698f90f34dd6cf (patch)
treed4a98b7a3f984eb5a9776ad9a0437508358bea3e /gcc/cp/class.c
parent3c0517a6531112d2dec16d18cdabb1513d387b7a (diff)
downloadgcc-582d2481f7380441c345bf1dfe698f90f34dd6cf.zip
gcc-582d2481f7380441c345bf1dfe698f90f34dd6cf.tar.gz
gcc-582d2481f7380441c345bf1dfe698f90f34dd6cf.tar.bz2
re PR c++/87861 (ICE in output_constructor_regular_field, at varasm.c:5165)
PR c++/87861 * class.c (build_vtbl_initializer): For TARGET_VTABLE_USES_DESCRIPTORS bump index for each added word. * constexpr.c (find_array_ctor_elt): Add forward declaration. (cxx_eval_call_expression): Handle TARGET_VTABLE_USES_DESCRIPTORS vtable calls. (cxx_eval_constant_expression) <case OBJ_TYPE_REF>: Divide token by TARGET_VTABLE_USES_DESCRIPTORS if non-zero. From-SVN: r267032
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 1bcb146..fec1c5d 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -9351,7 +9351,6 @@ build_vtbl_initializer (tree binfo,
tree vcall_index;
tree fn, fn_original;
tree init = NULL_TREE;
- tree idx = size_int (jx++);
fn = BV_FN (v);
fn_original = fn;
@@ -9455,7 +9454,7 @@ build_vtbl_initializer (tree binfo,
int i;
if (init == size_zero_node)
for (i = 0; i < TARGET_VTABLE_USES_DESCRIPTORS; ++i)
- CONSTRUCTOR_APPEND_ELT (*inits, idx, init);
+ CONSTRUCTOR_APPEND_ELT (*inits, size_int (jx++), init);
else
for (i = 0; i < TARGET_VTABLE_USES_DESCRIPTORS; ++i)
{
@@ -9463,11 +9462,11 @@ build_vtbl_initializer (tree binfo,
fn, build_int_cst (NULL_TREE, i));
TREE_CONSTANT (fdesc) = 1;
- CONSTRUCTOR_APPEND_ELT (*inits, idx, fdesc);
+ CONSTRUCTOR_APPEND_ELT (*inits, size_int (jx++), fdesc);
}
}
else
- CONSTRUCTOR_APPEND_ELT (*inits, idx, init);
+ CONSTRUCTOR_APPEND_ELT (*inits, size_int (jx++), init);
}
}