diff options
author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-04-06 14:27:17 +0000 |
---|---|---|
committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-04-06 14:27:17 +0000 |
commit | 6fdfe55eb07ca25cd12f228760348cb2dc4971fc (patch) | |
tree | f4e55c626edd2c7e93de6a79b62840e6f8ef802a | |
parent | 3843d0114e302e6deaa2548207685a1f41d231f5 (diff) | |
download | gcc-6fdfe55eb07ca25cd12f228760348cb2dc4971fc.tar.gz |
h
* parse.y (patch_binop): Don't fold if non-constant and emiting
class files.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26214 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/java/parse.y | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 72eccbffaf3..9a343107e15 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -9370,8 +9370,12 @@ patch_binop (node, wfl_op1, wfl_op2) TREE_TYPE (node) = prom_type; TREE_SIDE_EFFECTS (node) = TREE_SIDE_EFFECTS (op1) | TREE_SIDE_EFFECTS (op2); - /* fold does not respect side-effect order as required for Java but not C. */ - if (! TREE_SIDE_EFFECTS (node)) + /* fold does not respect side-effect order as required for Java but not C. + * Also, it sometimes create SAVE_EXPRs which are bad when emitting + * bytecode. + */ + if (flag_emit_class_files ? (TREE_CONSTANT (op1) && TREE_CONSTANT (op2)) + : ! TREE_SIDE_EFFECTS (node)) node = fold (node); return node; } |