Wednesday, 15 April 2015

c++ - gcc creates crashing code depending on optimisation -


I have a complex complex code, which I compile using GCC 4.8.1.

  g ++ -c file.cc-march = native -mfpmath = sse -mpreferred-stack-boundary = 4 -minute inline-unit-increment = 50 -GGDB3-with WALL While compiling - the crashed code with the default (which I was unable to debug, but the address of a straight) Wextra-Winit-self -O2 -fPIC -funroll-loops -fforce-addr -rdynamic  < / Pre> 

Anything that was created suddenly varies from that time, in particular, is not aligned with the 32bytes required by the code, but only up to 8bytes). -O1 Instead, the code works fine so I added all customizable flags that are -O1 and -O2 (at the end of this, I have two files through O1-opts and O2-opts

  G ++ -march = native -mfpmath = sse has been created -Capreid-Stack-cement = 4 -Perm inline-unit-increment = 50 -GGD3 -Wall -extra -winit-self -O1 -fPIC -Frolroll-less -Force-edit -RDNIC-KLLP = Optimizer> O1-opts g ++ -march = native -mfpmath = sse -mpreferred-stack-boundary = 4-ultimate Nullin-unit-increase = 50 -GGDB3 -Wall -extra -Vinit-self -O2 -fPIC- Funnel-Loop - Fforce-addr -rdynamic -q --help = Adapter> O2-opts  < / Pre> 

when the diff O1-opts O2-opts option provides the difference). When adding all option differences to -O1 , the generated code still does not crash, it's my puzzle, so my question is: Is it absolutely Do not give results with -O2 ? (And also: What is the probable cause of my problem?)

The issue is that - O2 option not only defines different flags, but also enables additional customization in contrast to -O1 .

For GCC Wiki is an appropriate entry in the FQF section.


No comments:

Post a Comment