summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1998-04-03 12:17:58 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1998-04-03 12:17:58 +0000
commit9b9facfb8a00de57d4ac8e427931f7df24a34309 (patch)
tree3db835b5eec1bdb109338f53bf3dc77fd46eb6aa /gcc/cp
parent005efe3a9c0a9299a83df02d8dd083147decbbfc (diff)
downloadgcc-9b9facfb8a00de57d4ac8e427931f7df24a34309.tar.gz
* decl.c (cplus_expand_expr_stmt): Strip unused INDIRECT_REFs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18974 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog2
-rw-r--r--gcc/cp/decl.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 76101855e08..b02f2bb02b0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,7 @@
Fri Apr 3 02:22:59 1998 Jason Merrill <jason@yorick.cygnus.com>
+ * 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 3a75da766bc..e8916133ed3 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. */