[英]segmentation fault in SSE when -O3 is on
I found a very strange behaviour when using gcc's -O3 or -O2 option.在使用 gcc 的-O3或-O2选项时,我发现了一个非常奇怪的行为。
When my program is running under debug mode ( -g ), it is fine;当我的程序在调试模式( -g )下运行时,它很好; but it raises a segmentation fault when I turned on -O3 or -O2 .但是当我打开-O3或-O2时它会引发分段错误。
The segmentation happens when it is running a function with SSE2 macro inside;当它运行一个带有SSE2宏的函数时会发生分段; like喜欢
_m128i polynomial = _mm_set1_epi8(0x1d)
This is only part of the code.这只是代码的一部分。
I think I have already eliminate the situation of address alignment on 16 bytes.我想我已经消除了16字节地址对齐的情况。 It's so wired that the -g mode and the -O2 or -O3 mode behaves differently.它是如此连线,以至于 -g 模式和-O2或-O3模式的行为不同。
Actually, I am not sure the bug is related to SSE2 or not.实际上,我不确定该错误是否与 SSE2 相关。
I am using gcc 4.4.3 .我正在使用gcc 4.4.3 。
Have you encountered the same problem?你遇到过同样的问题吗?
Or can you gave me some suggestion on how to deal with it?或者你能给我一些关于如何处理它的建议吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.