diff options
author | Per Bothner <bothner@gcc.gnu.org> | 1999-04-06 07:27:19 -0700 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 1999-04-06 07:27:19 -0700 |
commit | 7c3f7c03af325def409fd42423e73d428869eaa7 (patch) | |
tree | 0b4960d2845a6d5f9a6c6ec8bf5ea71278fa8f71 /gcc/java/parse.c | |
parent | d1472141a50b9ba3e1f8552be2b2b69a82801087 (diff) | |
download | gcc-7c3f7c03af325def409fd42423e73d428869eaa7.zip gcc-7c3f7c03af325def409fd42423e73d428869eaa7.tar.gz gcc-7c3f7c03af325def409fd42423e73d428869eaa7.tar.bz2 |
parse.y (patch_binop): Don't fold if non-constant and emiting class files.
�
* parse.y (patch_binop): Don't fold if non-constant and emiting
class files.
From-SVN: r26215
Diffstat (limited to 'gcc/java/parse.c')
-rw-r--r-- | gcc/java/parse.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/java/parse.c b/gcc/java/parse.c index c402f12..69f1861 100644 --- a/gcc/java/parse.c +++ b/gcc/java/parse.c @@ -11971,8 +11971,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; } |