]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Only when peephole optimization is on
authorDale Weiler <killfieldengine@gmail.com>
Fri, 4 Oct 2013 11:02:06 +0000 (07:02 -0400)
committerDale Weiler <killfieldengine@gmail.com>
Fri, 4 Oct 2013 11:02:06 +0000 (07:02 -0400)
ast.c

diff --git a/ast.c b/ast.c
index 5ea6d93b2f51a34f06bfe42fc25627f39f4111e4..4c142039ed281b57a7df94a1b113f491c2566fd9 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -454,7 +454,7 @@ ast_binary* ast_binary_new(lex_ctx_t ctx, int op,
      * Try to fold away superfluous binary operations, such as:
      * A * 1, a + 0, etc.
      */
-    if ((fold = (ast_binary*)fold_superfluous(left, right, op))) {
+    if (OPTS_OPTIMIZATION(OPTIM_PEEPHOLE) && (fold = (ast_binary*)fold_superfluous(left, right, op))) {
         ast_binary_delete(self);
         return fold;
     }