0,0 → 1,50 |
From: Henrik Grubbström <grubba@grubba.org> |
Date: Thu, 29 Sep 2016 17:25:06 +0200 |
Subject: [PATCH] Compiler [optimizer]: Disabled some broken peep rules. |
Bug-Debian: https://bugs.debian.org/836673 |
Forwarded: yes |
Origin: http://pike-librarian.lysator.liu.se/index.xml?checkins=e0fcf06129c03fb51d6da6b13200232a15df7e0d |
|
These peep hole optimizer rules weren't protected against |
negation overflow. |
|
Disabled since INT32_NEG_OVERFLOW() doesn't exist in Pike 7.8. |
|
Cf Pike 7.9.5 and later commit c63deca838788875b37d48a4faa044b5d6cafa0b. |
|
Thanks to Magnus Holmgren for the report. |
|
Potential fix for [LysLysKOM 21868180] (infinite optimizer loop). |
--- |
src/peep.in | 8 ++++---- |
1 file changed, 4 insertions(+), 4 deletions(-) |
|
diff --git a/src/peep.in b/src/peep.in |
index f32f7cd..9279d77 100644 |
--- a/src/peep.in |
+++ b/src/peep.in |
@@ -36,8 +36,8 @@ CONST1 NEGATE : CONST_1 |
CONST_1 NEGATE : CONST1 |
NUMBER NEGATE : NEG_NUMBER($1a) |
NEG_NUMBER NEGATE : NUMBER ($1a) |
-NUMBER [(-$1a) > 0] : NEG_NUMBER (-$1a) |
-NEG_NUMBER [(-$1a) >= 0] : NUMBER (-$1a) |
+// NUMBER [(-$1a) > 0] : NEG_NUMBER (-$1a) |
+// NEG_NUMBER [(-$1a) >= 0] : NUMBER (-$1a) |
NEGATE NEGATE : |
COMPL COMPL : |
NEGATE CONST_1 ADD_INTS : COMPL |
@@ -238,8 +238,8 @@ CONST_1 INDEX: NEG_INT_INDEX (1) |
CONST1 INDEX: POS_INT_INDEX (1) |
NUMBER INDEX: POS_INT_INDEX ($1a) |
NEG_NUMBER INDEX: NEG_INT_INDEX ($1a) |
-POS_INT_INDEX [$1a < 0]: NEG_INT_INDEX (-$1a) |
-NEG_INT_INDEX [-$1a >= 0]: POS_INT_INDEX (-$1a) |
+// POS_INT_INDEX [$1a < 0]: NEG_INT_INDEX (-$1a) |
+// NEG_INT_INDEX [-$1a >= 0]: POS_INT_INDEX (-$1a) |
|
BRANCH_WHEN_ZERO BRANCH LABEL ($1a): BRANCH_WHEN_NON_ZERO($2a) LABEL($1a) |
BRANCH_WHEN_NON_ZERO BRANCH LABEL ($1a): BRANCH_WHEN_ZERO($2a) LABEL($1a) |
-- |
2.9.3 |
|