Project

General

Profile

Bug #440

Need fresh GCC 4.6: g++ can not compile large 'switch' statement

Added by Dmitry Sokolov almost 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Start date:
10/16/2013
Due date:
% Done:

100%

Estimated time:
CPU Architecture:
armeabi
Host OS:
Windows
Toolchain:
gcc-4.6
Android version:
CrystaX 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;
}

#1

Updated by Dmitry Moskalchuk about 6 years ago

  • Priority changed from Low to Normal
#2

Updated by Alexander Zhukov about 6 years ago

  • Assignee set to Alexander Zhukov
#3

Updated by Dmitry Moskalchuk about 6 years ago

  • Target version set to 10.0.0
#4

Updated by Alexander Zhukov about 6 years ago

  • Status changed from Open to In Progress
#5

Updated by Alexander Zhukov about 6 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

Big switch compiles without problems now.
See tests/build/crystax-issue-440-big-switch.

Also available in: Atom PDF