From: SourceForge.net <no...@so...> - 2009-08-08 19:02:59
|
Bugs item #2834267, was opened at 2009-08-08 15:02 Message generated for change (Tracker Item Submitted) made by peterjhurley You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2834267&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: gcc Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Peter Hurley (peterjhurley) Assigned to: Nobody/Anonymous (nobody) Summary: gcc 4.4 generates unaligned stack offsets with sse2 code Initial Comment: gcc 4.4 is generating stack frame offsets to compiler-generated locals that are not 16-byte aligned for sse2 instructions, causing #GP(0) faults. This bug is different than artifact id# 1008330 (movaps problem with mingw). That bug was due to the fact that the base pointer itself was not aligned at function entry, rather than frame offsets being unaligned. In the attached submission file, compiled with: g++ -O3 -msse3 -g3 -Wall -c -save-temps -osubmission.o submission.cpp the following assembly code is emitted: /APP # 60 "..\submission.cpp" 1 movddup 16(%eax),%xmm0 # 0 "" 2 /NO_APP LBE42: LBE41: .loc 1 103 0 addpd %xmm0, %xmm0 movapd %xmm0, -88(%ebp) The frame offset of the destination operand in the movapd instruction, -88, is not 16-byte aligned and causes a GP fault. The same file compiled with: g++ -O0 -msse3 -g3 -Wall -c -save-temps -osubmission.o submission.cpp generates a different sequence for the same source (obviously) that does not exhibit the same error as above. However, later in the same output the following sequence is emitted: .loc 1 127 0 movsd -40(%ebp), %xmm0 movhpd -32(%ebp), %xmm0 cmpltpd -216(%ebp), %xmm0 movlpd %xmm0, -40(%ebp) movhpd %xmm0, -32(%ebp) The frame offset value of the source operand in the cmpltpd instruction, -216, is not 16-byte aligned, and generates a GP fault. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2834267&group_id=2435 |