Branch: Tag:

2016-09-29

2016-09-29 15:25:06 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [optimizer]: Disabled some broken peep rules.

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).

36:   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:   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)