From: Per Bothner Date: Tue, 6 Apr 1999 14:27:19 +0000 (-0700) Subject: parse.y (patch_binop): Don't fold if non-constant and emiting class files. X-Git-Tag: prereleases/libgcj-0.1~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c3f7c03af325def409fd42423e73d428869eaa7;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/java/parse.c b/gcc/java/parse.c index c402f12a7c51..69f18618b724 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; }