Actions
Bug #440
closedNeed fresh GCC 4.6: g++ can not compile large 'switch' statement
Start date:
10/16/2013
Due date:
% Done:
100%
Estimated time:
CPU Architecture:
armeabi
Host OS:
Windows
Toolchain:
gcc-4.6
Android version:
CrystaX NDK Version:
Description
r8-crystax-1\toolchains\arm-linux-androideabi-4.6\prebuilt\windows-x86_64\bin\arm-linux-androideabi-g++.exe
When compiling large 'switch' statement error occurs: Assembler Error: branch out of range
switch (id) {
case 1: call_fn_a(); break;
case 2: call_fn_b(); break;
case 3: call_fn_c(); break;
...
case 15: call_fn_xxx(); break;
}
Workaround: split 'switch' into small parts:
switch (id) {
case 1: call_fn_a(); break;
case 2: call_fn_b(); break;
case 3: call_fn_c(); break;
...
case 7: call_fn_fff(); break;
}
switch (id) {
case 8: call_fn_ggg(); break;
...
case 15: call_fn_xxx(); break;
}
Actions