Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
252 | holmgren | 1 | From: Henrik Grubbström <grubba@grubba.org> |
2 | Date: Thu, 29 Sep 2016 17:25:06 +0200 |
||
3 | Subject: [PATCH] Compiler [optimizer]: Disabled some broken peep rules. |
||
4 | Bug-Debian: https://bugs.debian.org/836673 |
||
5 | Forwarded: yes |
||
6 | Origin: http://pike-librarian.lysator.liu.se/index.xml?checkins=e0fcf06129c03fb51d6da6b13200232a15df7e0d |
||
7 | |||
8 | These peep hole optimizer rules weren't protected against |
||
9 | negation overflow. |
||
10 | |||
11 | Disabled since INT32_NEG_OVERFLOW() doesn't exist in Pike 7.8. |
||
12 | |||
13 | Cf Pike 7.9.5 and later commit c63deca838788875b37d48a4faa044b5d6cafa0b. |
||
14 | |||
15 | Thanks to Magnus Holmgren for the report. |
||
16 | |||
17 | Potential fix for [LysLysKOM 21868180] (infinite optimizer loop). |
||
18 | --- |
||
19 | src/peep.in | 8 ++++---- |
||
20 | 1 file changed, 4 insertions(+), 4 deletions(-) |
||
21 | |||
22 | diff --git a/src/peep.in b/src/peep.in |
||
23 | index f32f7cd..9279d77 100644 |
||
24 | --- a/src/peep.in |
||
25 | +++ b/src/peep.in |
||
26 | @@ -36,8 +36,8 @@ CONST1 NEGATE : CONST_1 |
||
27 | CONST_1 NEGATE : CONST1 |
||
28 | NUMBER NEGATE : NEG_NUMBER($1a) |
||
29 | NEG_NUMBER NEGATE : NUMBER ($1a) |
||
30 | -NUMBER [(-$1a) > 0] : NEG_NUMBER (-$1a) |
||
31 | -NEG_NUMBER [(-$1a) >= 0] : NUMBER (-$1a) |
||
32 | +// NUMBER [(-$1a) > 0] : NEG_NUMBER (-$1a) |
||
33 | +// NEG_NUMBER [(-$1a) >= 0] : NUMBER (-$1a) |
||
34 | NEGATE NEGATE : |
||
35 | COMPL COMPL : |
||
36 | NEGATE CONST_1 ADD_INTS : COMPL |
||
37 | @@ -238,8 +238,8 @@ CONST_1 INDEX: NEG_INT_INDEX (1) |
||
38 | CONST1 INDEX: POS_INT_INDEX (1) |
||
39 | NUMBER INDEX: POS_INT_INDEX ($1a) |
||
40 | NEG_NUMBER INDEX: NEG_INT_INDEX ($1a) |
||
41 | -POS_INT_INDEX [$1a < 0]: NEG_INT_INDEX (-$1a) |
||
42 | -NEG_INT_INDEX [-$1a >= 0]: POS_INT_INDEX (-$1a) |
||
43 | +// POS_INT_INDEX [$1a < 0]: NEG_INT_INDEX (-$1a) |
||
44 | +// NEG_INT_INDEX [-$1a >= 0]: POS_INT_INDEX (-$1a) |
||
45 | |||
46 | BRANCH_WHEN_ZERO BRANCH LABEL ($1a): BRANCH_WHEN_NON_ZERO($2a) LABEL($1a) |
||
47 | BRANCH_WHEN_NON_ZERO BRANCH LABEL ($1a): BRANCH_WHEN_ZERO($2a) LABEL($1a) |
||
48 | -- |
||
49 | 2.9.3 |
||
50 |