From b3e401c25a949e00ea3a77a508d3a33142f139e2 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 3 Apr 1998 12:17:58 +0000 Subject: [PATCH] * decl.c (cplus_expand_expr_stmt): Strip unused INDIRECT_REFs. From-SVN: r18974 --- gcc/cp/ChangeLog | 2 ++ gcc/cp/decl.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 76101855e08e..b02f2bb02b09 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ Fri Apr 3 02:22:59 1998 Jason Merrill + * decl.c (cplus_expand_expr_stmt): Strip unused INDIRECT_REFs. + Re-implement allocation of base class subobjects. * tree.c (unshare_base_binfos): New fn. (layout_basetypes): Use it. Now handles offsets of both virtual and diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 3a75da766bc1..e8916133ed3f 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -12886,6 +12886,12 @@ cplus_expand_expr_stmt (exp) libg++ to miscompile, and tString to core dump. */ exp = build1 (CLEANUP_POINT_EXPR, TREE_TYPE (exp), exp); #endif + + /* Strip unused implicit INDIRECT_REFs of references. */ + if (TREE_CODE (exp) == INDIRECT_REF + && TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == REFERENCE_TYPE) + exp = TREE_OPERAND (exp, 0); + /* If we don't do this, we end up down inside expand_expr trying to do TYPE_MODE on the ERROR_MARK, and really go outside the bounds of the type. */ -- 2.47.3