From: Richard Henderson Date: Fri, 30 Jan 2004 23:37:39 +0000 (-0800) Subject: re PR c++/13693 ([tree-ssa] build failure in mipsisa64-elf) X-Git-Tag: releases/gcc-4.0.0~10520 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=59445d742771835d8a0a8f59e10ae1b19f79fff8;p=thirdparty%2Fgcc.git re PR c++/13693 ([tree-ssa] build failure in mipsisa64-elf) PR c++/13693 * method.c (use_thunk): Don't force_target_expr for void thunks. * tree.c (build_target_expr_with_type): Assert non-void type. (force_target_expr): Likewise. From-SVN: r77008 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 41bc855bb2d0..825a6e505a17 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2004-01-30 Richard Henderson + + PR c++/13693 + * method.c (use_thunk): Don't force_target_expr for void thunks. + * tree.c (build_target_expr_with_type): Assert non-void type. + (force_target_expr): Likewise. + 2004-01-30 Michael Matz * parser.c (cp_parser_labeled_statement): Accept case ranges. diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 106585571f90..6acab3a902fa 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -487,15 +487,17 @@ use_thunk (tree thunk_fndecl, bool emit_p) t = tree_cons (NULL_TREE, a, t); t = nreverse (t); t = build_call (alias, t); - t = force_target_expr (TREE_TYPE (t), t); - if (!this_adjusting) - t = thunk_adjust (t, /*this_adjusting=*/0, - fixed_offset, virtual_offset); if (VOID_TYPE_P (TREE_TYPE (t))) finish_expr_stmt (t); else - finish_return_stmt (t); + { + t = force_target_expr (TREE_TYPE (t), t); + if (!this_adjusting) + t = thunk_adjust (t, /*this_adjusting=*/0, + fixed_offset, virtual_offset); + finish_return_stmt (t); + } /* Since we want to emit the thunk, we explicitly mark its name as referenced. */ diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index bedbbe96b444..7d9812856893 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -318,6 +318,8 @@ build_target_expr_with_type (tree init, tree type) { tree slot; + my_friendly_assert (!VOID_TYPE_P (type), 20040130); + if (TREE_CODE (init) == TARGET_EXPR) return init; else if (CLASS_TYPE_P (type) && !TYPE_HAS_TRIVIAL_INIT_REF (type) @@ -342,7 +344,11 @@ build_target_expr_with_type (tree init, tree type) tree force_target_expr (tree type, tree init) { - tree slot = build_local_temp (type); + tree slot; + + my_friendly_assert (!VOID_TYPE_P (type), 20040130); + + slot = build_local_temp (type); return build_target_expr (slot, init); }