Commit 1319e88e by Andrew Haley Committed by Andrew Haley

jcf-write.c (generate_bytecode_insns): Add MIN_EXPR and MAX_EXPR.

2003-09-16  Andrew Haley  <aph@redhat.com>

        * jcf-write.c (generate_bytecode_insns): Add MIN_EXPR and MAX_EXPR.

From-SVN: r71514
parent 53de5204
2003-09-16 Andrew Haley <aph@redhat.com>
* jcf-write.c (generate_bytecode_insns): Add MIN_EXPR and MAX_EXPR.
2003-09-17 Ranjit Mathew <rmathew@hotmail.com>
Fixes PR java/9577
......
......@@ -2413,6 +2413,23 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
case JAVA_EXC_OBJ_EXPR:
NOTE_PUSH (1); /* Pushed by exception system. */
break;
case MIN_EXPR:
case MAX_EXPR:
{
/* This copes with cases where fold() has created MIN or MAX
from a conditional expression. */
enum tree_code code = TREE_CODE (exp) == MIN_EXPR ? LT_EXPR : GT_EXPR;
tree op0 = TREE_OPERAND (exp, 0);
tree op1 = TREE_OPERAND (exp, 1);
tree x;
if (TREE_SIDE_EFFECTS (op0) || TREE_SIDE_EFFECTS (op1))
abort ();
x = build (COND_EXPR, TREE_TYPE (exp),
build (code, boolean_type_node, op0, op1),
op0, op1);
generate_bytecode_insns (x, target, state);
break;
}
case NEW_CLASS_EXPR:
{
tree class = TREE_TYPE (TREE_TYPE (exp));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment