Path: utzoo!telly!lethe!dptcdc!attcan!uunet!tut.cis.ohio-state.edu!YAHI.STANFORD.EDU!tiemann From: tiemann@YAHI.STANFORD.EDU (Michael Tiemann) Newsgroups: gnu.g++.bug Subject: Ungracious exit for g++. Message-ID: <8904080613.AA18484@yahi.stanford.edu> Date: 8 Apr 89 06:13:13 GMT References: <8903211537.AA27448@yahi.stanford.edu> Sender: news@tut.cis.ohio-state.edu Reply-To: tiemann@lurch.stanford.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 31 This patch fixes a bug which kills the compiler in Gordon's memoizing fib function. Replace old code in cplus-cvt.c with this code: static tree build_type_conversion_1 (xtype, basetype, expr, typename, for_sure) tree xtype, basetype; tree expr; tree typename; int for_sure; { tree first_arg = expr; tree rval; if (for_sure == 0 && ! lvalue_p (expr)) first_arg = build (NOP_EXPR, TYPE_POINTER_TO (basetype), integer_zero_node); rval = build_method_call (first_arg, typename, NULL_TREE, 1, for_sure); if (rval == error_mark_node) { if (for_sure == 0) return NULL_TREE; return error_mark_node; } if (first_arg != expr) { expr = build_up_reference (build_reference_type (TREE_TYPE (expr), expr)); TREE_VALUE (TREE_OPERAND (rval, 1)) = build_unary_op (ADDR_EXPR, expr, 0); } return convert (xtype, rval); } Michael