summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-25 09:00:37 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-25 09:00:37 +0000
commit5d2c3e63b62fe814537fbab9227392ed4384e191 (patch)
treecdaef3f76b7987573e0d77de853d8f8b8f7ccd5b /gcc/cp
parentc34a859dc2a425dfcf592c4c535d05cde7b5df5e (diff)
downloadgcc-5d2c3e63b62fe814537fbab9227392ed4384e191.tar.gz
cp:
PR c++/3543 * typeck.c (condition_conversion): Resolve an OFFSET_REF. * expr.c (cplus_expand_expr): An OFFSET_REF should never get here. testsuite: * g++.old-deja/g++.other/optimize4.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44340 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/expr.c7
-rw-r--r--gcc/cp/typeck.c2
3 files changed, 12 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6ae301c5c3a..9d1844dabb5 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
2001-07-25 Nathan Sidwell <nathan@codesourcery.com>
+ PR c++/3543
+ * typeck.c (condition_conversion): Resolve an OFFSET_REF.
+ * expr.c (cplus_expand_expr): An OFFSET_REF should never get here.
+
+2001-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
* class.c (build_vtbl_or_vbase_field): Remove, move into ...
(create_vtbl_ptr): ... here.
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c
index 6855160fc19..f2fe6ebf476 100644
--- a/gcc/cp/expr.c
+++ b/gcc/cp/expr.c
@@ -105,9 +105,10 @@ cplus_expand_expr (exp, target, tmode, modifier)
target, tmode, modifier);
case OFFSET_REF:
- return expand_expr (default_conversion (resolve_offset_ref (exp)),
- target, tmode, EXPAND_NORMAL);
-
+ /* Offset refs should not make it through to here. */
+ my_friendly_abort (20010724);
+ return const0_rtx;
+
case THROW_EXPR:
expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, 0);
return NULL;
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 358037332d4..a6ddcf269f7 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -4331,6 +4331,8 @@ condition_conversion (expr)
tree t;
if (processing_template_decl)
return expr;
+ if (TREE_CODE (expr) == OFFSET_REF)
+ expr = resolve_offset_ref (expr);
t = perform_implicit_conversion (boolean_type_node, expr);
t = fold (build1 (CLEANUP_POINT_EXPR, boolean_type_node, t));
return t;