mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-09 03:00:27 +08:00
jcf-write.c (generate_bytecode_insns): Optimize binary operations with equal operands without side-effects.
* jcf-write.c (generate_bytecode_insns): Optimize binary operations with equal operands without side-effects. From-SVN: r71684
This commit is contained in:
parent
ac20c67af1
commit
87750fef00
@ -1,3 +1,8 @@
|
||||
2003-09-23 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
* jcf-write.c (generate_bytecode_insns): Optimize binary operations
|
||||
with equal operands without side-effects.
|
||||
|
||||
2003-09-22 Jeff Sturm <jsturm@one-point.com>
|
||||
|
||||
* decl.c (java_init_decl_processing): Don't emit otable decls
|
||||
|
@ -2095,10 +2095,10 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
|
||||
tree arg0 = TREE_OPERAND (exp, 0);
|
||||
tree arg1 = TREE_OPERAND (exp, 1);
|
||||
jopcode += adjust_typed_op (type, 3);
|
||||
if (arg0 == arg1 && TREE_CODE (arg0) == SAVE_EXPR)
|
||||
if (arg0 != NULL_TREE && operand_equal_p (arg0, arg1, 0))
|
||||
{
|
||||
/* fold may (e.g) convert 2*x to x+x. */
|
||||
generate_bytecode_insns (TREE_OPERAND (arg0, 0), target, state);
|
||||
generate_bytecode_insns (arg0, target, state);
|
||||
emit_dup (TYPE_PRECISION (TREE_TYPE (arg0)) > 32 ? 2 : 1, 0, state);
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user