* typeck.c (build_binary_op): Fix pmf comparison logic.
From-SVN: r38471
This commit is contained in:
parent
0692b39c5b
commit
ebb1abc3e4
2 changed files with 26 additions and 15 deletions
|
@ -1,10 +1,10 @@
|
||||||
2000-12-22 Jason Merrill <jason@redhat.com>
|
2000-12-22 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
* typeck.c (build_binary_op): Fix pmf comparison logic.
|
||||||
|
|
||||||
* call.c (joust): Use DECL_NONSTATIC_MEMBER_FUNCTION_P, not
|
* call.c (joust): Use DECL_NONSTATIC_MEMBER_FUNCTION_P, not
|
||||||
DECL_STATIC_FUNCTION_P.
|
DECL_STATIC_FUNCTION_P.
|
||||||
|
|
||||||
* typeck.c (build_binary_op): Fix pmf comparison logic.
|
|
||||||
|
|
||||||
* semantics.c (genrtl_finish_function): Don't try to jump to
|
* semantics.c (genrtl_finish_function): Don't try to jump to
|
||||||
return_label unless it exists.
|
return_label unless it exists.
|
||||||
|
|
||||||
|
|
|
@ -3648,6 +3648,11 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
|
||||||
tree e1;
|
tree e1;
|
||||||
tree e2;
|
tree e2;
|
||||||
|
|
||||||
|
if (TREE_SIDE_EFFECTS (op0))
|
||||||
|
op0 = save_expr (op0);
|
||||||
|
if (TREE_SIDE_EFFECTS (op1))
|
||||||
|
op1 = save_expr (op1);
|
||||||
|
|
||||||
if (flag_new_abi)
|
if (flag_new_abi)
|
||||||
{
|
{
|
||||||
/* We generate:
|
/* We generate:
|
||||||
|
@ -3670,7 +3675,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
|
||||||
delta1 = build_component_ref (op1, delta_identifier,
|
delta1 = build_component_ref (op1, delta_identifier,
|
||||||
NULL_TREE, 0);
|
NULL_TREE, 0);
|
||||||
e1 = cp_build_binary_op (EQ_EXPR, delta0, delta1);
|
e1 = cp_build_binary_op (EQ_EXPR, delta0, delta1);
|
||||||
e2 = cp_build_binary_op (NE_EXPR,
|
e2 = cp_build_binary_op (EQ_EXPR,
|
||||||
pfn0,
|
pfn0,
|
||||||
cp_convert (TREE_TYPE (pfn0),
|
cp_convert (TREE_TYPE (pfn0),
|
||||||
integer_zero_node));
|
integer_zero_node));
|
||||||
|
@ -3683,13 +3688,19 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
|
||||||
/* The code we generate for the test is:
|
/* The code we generate for the test is:
|
||||||
|
|
||||||
(op0.index == op1.index
|
(op0.index == op1.index
|
||||||
&& ((op1.index != -1 && op0.delta2 == op1.delta2)
|
&& op0.delta == op1.delta
|
||||||
|| op0.pfn == op1.pfn)) */
|
&& (op1.index == -1 ? op0.pfn == op1.pfn
|
||||||
|
: op0.delta2 == op1.delta2)) */
|
||||||
|
|
||||||
tree index0 = build_component_ref (op0, index_identifier,
|
tree index0 = build_component_ref (op0, index_identifier,
|
||||||
NULL_TREE, 0);
|
NULL_TREE, 0);
|
||||||
tree index1 = save_expr (build_component_ref (op1, index_identifier,
|
tree index1
|
||||||
NULL_TREE, 0));
|
= save_expr (build_component_ref (op1, index_identifier,
|
||||||
|
NULL_TREE, 0));
|
||||||
|
tree delta0 = build_component_ref (op0, delta_identifier,
|
||||||
|
NULL_TREE, 0);
|
||||||
|
tree delta1 = build_component_ref (op1, delta_identifier,
|
||||||
|
NULL_TREE, 0);
|
||||||
tree pfn0 = PFN_FROM_PTRMEMFUNC (op0);
|
tree pfn0 = PFN_FROM_PTRMEMFUNC (op0);
|
||||||
tree pfn1 = PFN_FROM_PTRMEMFUNC (op1);
|
tree pfn1 = PFN_FROM_PTRMEMFUNC (op1);
|
||||||
tree delta20 = DELTA2_FROM_PTRMEMFUNC (op0);
|
tree delta20 = DELTA2_FROM_PTRMEMFUNC (op0);
|
||||||
|
@ -3698,17 +3709,17 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
|
||||||
tree integer_neg_one_node
|
tree integer_neg_one_node
|
||||||
= cp_build_binary_op (MINUS_EXPR, integer_zero_node,
|
= cp_build_binary_op (MINUS_EXPR, integer_zero_node,
|
||||||
integer_one_node);
|
integer_one_node);
|
||||||
e1 = cp_build_binary_op (EQ_EXPR, index0, index1);
|
e1 = cp_build_binary_op (EQ_EXPR, index1, integer_neg_one_node);
|
||||||
e2 = cp_build_binary_op (NE_EXPR, index1, integer_neg_one_node);
|
|
||||||
e2 = cp_build_binary_op (TRUTH_ANDIF_EXPR, e2,
|
|
||||||
cp_build_binary_op (EQ_EXPR,
|
|
||||||
delta20, delta21));
|
|
||||||
/* We can't use build_binary_op for this cmp because it
|
/* We can't use build_binary_op for this cmp because it
|
||||||
would get confused by the ptr to method types and
|
would get confused by the ptr to method types and
|
||||||
think we want pmfs. */
|
think we want pmfs. */
|
||||||
e3 = build (EQ_EXPR, boolean_type_node, pfn0, pfn1);
|
e2 = build (EQ_EXPR, boolean_type_node, pfn0, pfn1);
|
||||||
e2 = cp_build_binary_op (TRUTH_ORIF_EXPR, e2, e3);
|
e3 = cp_build_binary_op (EQ_EXPR, delta20, delta21);
|
||||||
e = cp_build_binary_op (TRUTH_ANDIF_EXPR, e1, e2);
|
e = build_conditional_expr (e1, e2, e3);
|
||||||
|
e1 = cp_build_binary_op (EQ_EXPR, index0, index1);
|
||||||
|
e = cp_build_binary_op (TRUTH_ANDIF_EXPR, e1, e);
|
||||||
|
e1 = cp_build_binary_op (EQ_EXPR, delta0, delta1);
|
||||||
|
e = cp_build_binary_op (TRUTH_ANDIF_EXPR, e1, e);
|
||||||
}
|
}
|
||||||
if (code == EQ_EXPR)
|
if (code == EQ_EXPR)
|
||||||
return e;
|
return e;
|
||||||
|
|
Loading…
Add table
Reference in a new issue