Article View: gnu.g++.bug
Article #1845Ungracious exit for g++.
From: Michael Tiemann
Date: Sat, 08 Apr 1989 06:13
Date: Sat, 08 Apr 1989 06:13
31 lines
1400 bytes
1400 bytes
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
Technical Details
Message-ID:
<8904080613.AA18484@yahi.stanford.edu>Path:
arc1-ca.pugleaf.net!utzoo!telly!lethe!dptcdc!attcan!uunet!tut.cis.ohio-state.edu!YAHI.STANFORD.EDU!tiemannReferences:
<8903211537.AA27448@yahi.stanford.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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