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

Inline functions: architecture dependent compilations problems.

Diego__A_
Beginner
411 Views

 I have a C program that uses inline functions. They are defined in a header file as, for example, static inline int fun(vars...), etc, and I use inline-forceinline option to force to the compiler to inline the functions.

 The compiler version is Intel® C++ Composer XE for Linux*, Version 13.0.1.117.

 I have the "same" compiler installed in two machines, the first one is a Dell laptop with a processor Intel(R) Core(TM) 2 Duo CPU T5800 @ 2.00 GHz (ia32 arch) and the seccond one is a desktop computer with an Intel(R) Core(TM) i7 CPU 920  @ 2.67GHz (intel64 arch).

When I compile and run the program, the ia32 architecture gives the currect result while, when I compile and run the same code into the intel64 architecture gives: Segmentation fault (core dumped).

I am not an expert and this fact has me completely confused! I would appreciate it if someone could help me.




0 Kudos
3 Replies
SergeyKostrov
Valued Contributor II
411 Views
>>...When I compile and run the program, the ia32 architecture gives the currect result while, when I compile and run >>the same code into the intel64 architecture gives: Segmentation fault (core dumped)... Could you provide a test case that reproduces the problem? Unfortunately, it is not clear what causes your application to crash. It could be a problem not related to inlining, like a problem with incorrect usage of memory.
0 Kudos
Bernard
Valued Contributor I
411 Views

>>>When I compile and run the program, the ia32 architecture gives the currect result while, when I compile and run the same code into the intel64 architecture gives: Segmentation fault (core dumped).>>>

Segmentation fault on Windows platform is called Access violation so it is related to the memory.It is possible that your code could dereference null pointer or access data in other process address space or trying to access nonexistant memory address.

0 Kudos
Mark_S_Intel1
Employee
411 Views

Diego,

Were you able to resolve this issue?
As Sergey pointed out it's not clear that inlining is the cause.  If you suspect inlining you could disable it by using -Ob0.  I will investigate this issue if you could send a test case.

Thanks,
--mark

0 Kudos
Reply