Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

c++ switch() statement crash on mac os x in 64-bit mode.

DevidO
Beginner
382 Views
Hi,

the new intel c++ compiler for mac os x crash on every switch() statement in 64-bit mode.
The only solution is to use -fno-jump-tables but this is only workaround.

thanks,
Devid
0 Kudos
3 Replies
Anthony_B_Intel
Employee
382 Views
Well, the no-jump-tables option is a compatibility lever, so maybe this is expected behavior. I would try your question over on the C++ Compiler forum and check out the Knowledge Base.
0 Kudos
DevidO
Beginner
382 Views
Hi,

> so maybe this is expected behavior

Not sure that I understand you here.
Do you mean that using switch() statesmen is not supported by Intel Compilers and the software using this should crash ? I am sure no, but what then.

It does work well on Windows and also in 32-bit mode on Mac OS X 10.6 too but in 64-bit mote the program compiled with Intel Compiler will crash on every switch() statement.
So this should be a bug somewhere.

DevO
0 Kudos
Quoc-An_L_Intel
Moderator
382 Views
This is a known issue, and it is a bug in the Mac OS X linker that come with Xcode 3.2.2-3.2.4. See this thread specific to your issue:

http://software.intel.com/en-us/forums/showthread.php?t=74791

and knowledge base article for resolution:

http://software.intel.com/en-us/articles/intel-compiler-and-xcode-322-linker-runtime-crash-with-switch-statement/

Current status, this problem with the 11.1 compiler is a result of a bug in the linker that comes with Xcode 3.2.2, 3.2.3, 3.2.4.

The work arounds are:

1) Use Xcode 3.2.1 with 11.1 compiler.

2) Use 11.1 compiler with the option -use-asm with Xcode 3.2.2, 3.2.3, 3.2.4.

It should fix most cases but there are some cases when even generating object file through external assembler L* symbols still may appear in object file. Those cases are usually constant string literals placed in cstring section

3) Use Intel Composer XE.

We are not planning to work around this linker bug in the 11.1 compiler due to the complexity of the workaround which might reduce the stability of the 11.1 product.

0 Kudos
Reply