Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - floating point optimization crash under 6.4.1: (5 Items)
   
floating point optimization crash under 6.4.1  
Hello All,

We are working on a project that includes an old math module that does an enormous amount of calculations that need to 
be done as quickly as possible. The project successfully compiles and runs in QNX 6.4.0, but it complies and crashes in 
6.4.1. We found that we needed to speed it up, so we inserted the following line into the make file:

CCFLAGS := $(CCFLAGS) -O2 -march=core2 -msse -msse2 -msse3 -mssse3 -ffast-math

We are running the executables on identical hardware, so there is not a problem with the CPU not supporting the 
instructions. We tried compiling in 6.4.0 with the optimizations and running it on the 6.4.1 computer, and found that 
the program with optimizations was at least 100% faster than compiling on 6.4.1 without the optimizations. 

The project is large and has several dependencies, so I cannot post any sample code at this point. The program crashes 
100%  of the time with the optimizations, so at least it's not an intermittent problem. It's crashing with Signal 11, a 
segmentation fault. We have done a lot of testing on the program in QNX 6.4.0, and have never received this crash.

Has anyone else experienced any problems like this?

Thanks,
Kevin
Re: floating point optimization crash under 6.4.1  
KEvin Raymond wrote:
> Hello All,
> 
> We are working on a project that includes an old math module that does an enormous amount of calculations that need to
 be done as quickly as possible. The project successfully compiles and runs in QNX 6.4.0, but it complies and crashes in
 6.4.1. We found that we needed to speed it up, so we inserted the following line into the make file:
> 
> CCFLAGS := $(CCFLAGS) -O2 -march=core2 -msse -msse2 -msse3 -mssse3 -ffast-math
> 
> We are running the executables on identical hardware, so there is not a problem with the CPU not supporting the 
instructions. We tried compiling in 6.4.0 with the optimizations and running it on the 6.4.1 computer, and found that 
the program with optimizations was at least 100% faster than compiling on 6.4.1 without the optimizations. 
> 
> The project is large and has several dependencies, so I cannot post any sample code at this point. The program crashes
 100%  of the time with the optimizations, so at least it's not an intermittent problem. It's crashing with Signal 11, a
 segmentation fault. We have done a lot of testing on the program in QNX 6.4.0, and have never received this crash.

Does the program crash if you compile on 6.4.1 without optimization? If 
it doesn't crash without optimization, please try adding 
-fno-strict-aliasing to the CCFLAGS you posted.

Without a testcase its difficult for us to help.

Regards,

Ryan Mansfield
Re: floating point optimization crash under 6.4.1  
Hey Ryan,

We tried the option you suggested, but the program continues to crash. Any other ideas?

Thanks,
Kevin
Re: floating point optimization crash under 6.4.1  
Hello All,

After some more testing, we noticed that it still crashes with O2 and the sse flags, but it is stable and fast using O1.
 We also tried it with no O flag, but in this case there was a huge performance hit.

Thanks for the help,

Kevin
Re: floating point optimization crash under 6.4.1  
You could now try ratcheting up the individual optimization flags to see
which one (or ones, or combinations ;-) are the culprit(s).  My guess
would still be on inappropriate code motion of some kind, perhaps
because of a borked asm constraint somewhere.

On Mon, 2009-06-22 at 17:23 -0400, KEvin Raymond wrote:
> Hello All,
> 
> After some more testing, we noticed that it still crashes with O2 and the sse flags, but it is stable and fast using 
O1. We also tried it with no O flag, but in this case there was a huge performance hit.
> 
> Thanks for the help,
> 
> Kevin
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post32269
>