Minor cleanup in fold
Richard Kenner
kenner@vlsi1.ultra.nyu.edu
Mon Apr 14 21:10:00 GMT 2003
This improves the ordering of tests in the early part of fold.
Tested on i686-pc-linux-gnu.
2002-07-19 Olivier Hainque <hainque@act-europe.fr>
* fold-const.c (fold): Reorder tests for conditional expressions.
*** gcc/fold-const.c 8 Apr 2003 23:28:28 -0000 1.244
--- gcc/fold-const.c 11 Apr 2003 20:09:19 -0000
*************** fold (expr)
*** 5064,5067 ****
--- 5064,5075 ----
fold (build1 (code, type, integer_zero_node))));
}
+ else if (TREE_CODE_CLASS (code) == '<'
+ && TREE_CODE (arg0) == COMPOUND_EXPR)
+ return build (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0),
+ fold (build (code, type, TREE_OPERAND (arg0, 1), arg1)));
+ else if (TREE_CODE_CLASS (code) == '<'
+ && TREE_CODE (arg1) == COMPOUND_EXPR)
+ return build (COMPOUND_EXPR, type, TREE_OPERAND (arg1, 0),
+ fold (build (code, type, arg0, TREE_OPERAND (arg1, 1))));
else if (TREE_CODE_CLASS (code) == '2'
|| TREE_CODE_CLASS (code) == '<')
*************** fold (expr)
*** 5099,5110 ****
/*cond_first_p=*/1);
}
- else if (TREE_CODE_CLASS (code) == '<'
- && TREE_CODE (arg0) == COMPOUND_EXPR)
- return build (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0),
- fold (build (code, type, TREE_OPERAND (arg0, 1), arg1)));
- else if (TREE_CODE_CLASS (code) == '<'
- && TREE_CODE (arg1) == COMPOUND_EXPR)
- return build (COMPOUND_EXPR, type, TREE_OPERAND (arg1, 0),
- fold (build (code, type, arg0, TREE_OPERAND (arg1, 1))));
switch (code)
--- 5107,5110 ----
More information about the Gcc-patches
mailing list