ARM: Extremely inefficient code generated for Case BooleanExpression of
Original Reporter info from Mantis: spacetime
-
Reporter name: Igor Funa
Original Reporter info from Mantis: spacetime
- Reporter name: Igor Funa
Description:
Extremely inefficient code is generated if you use case statement with boolean expression (Case BooleanExpression of) - see Additional information.
If statement generates expected code.
Additional information:
Procedure TestCaseBool;
Var L1, L2: LongWord;
begin
L1 := 1;
// mov r1,#1
L2 := 2;
// mov r0,#2
If L1 = L2 then L2 := 0;
// cmp r1,r0
// moveq r0,#0
Case L1 = L2 of
// cmp r1,r0
// moveq r0,#1
// movne r0,#0
// cmp r0,#1
// bcc .Lj264
// subs r0,r0,#1
// beq .Lj265
// b .Lj264
//.Lj265:
True: L1 := 0;
// mov r1,#0
// b .Lj263
//.Lj264:
else L1 := 1;
// mov r1,#1
//.Lj263:
end;
end;
Mantis conversion info:
- Mantis ID: 10517
- Version: 2.2.0
- Fixed in version: 2.4.0
- Fixed in revision: 10873 (#8fe43377)
- Monitored by: » Alex_Lutovinin (Alex_Lutovinin)
- Target version: 2.4.0