Opened 17 years ago
Closed 17 years ago
#5997 closed defect (fixed)
soundtouch SSE ASM exposes GCC bug
Reported by: | Nigel | Owned by: | Isaac Richards |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | head |
Severity: | medium | Keywords: | |
Cc: | foobum@… | Ticket locked: | no |
Description
Mac gcc4.0.1 r19283 build does:
g++ -c -pipe -march=pentium4 -g -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -Wno-non-virtual-dtor -funit-at-a-time -D__STDC_CONSTANT_MACROS -Wno-long-double -fPIC -DPIC -w -fPIC -DMMX -Di386 -DUSING_APPLEREMOTE -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DALLOW_SSE2 -I/Volumes/MythBuild/.osx-packager/build/mkspecs/macx-g++ -I. -I/Volumes/MythBuild/.osx-packager/build/include -I/Volumes/MythBuild/.osx-packager/build/include -I../../libs/libavcodec -I../.. -I. -o sse_gcc.o sse_gcc.cpp sse_gcc.cpp: In member function 'virtual void soundtouch::TDStretchSSE2::overlapMulti(short int*, const short int*) const': sse_gcc.cpp:164: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
We work around the bug in libavcodec by tweaking the compile flags, but since this ASM was recently developed for #5890, I'm wondering if we can rework it for less registers?
Attachments (1)
Change History (6)
by , 17 years ago
Attachment: | st-reg_c.diff added |
---|
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Thanks for the patch, Nick, but sadly neither it nor -fomit make any difference.
comment:3 by , 17 years ago
Ok. Unfortunately this just seems to be gcc being silly - hesitant to patch the asm when versions either side compile it ok. What happens if you drop -fPIC and add -fomit - should give gcc 2 extra GP registers to fritter away..
comment:4 by , 17 years ago
Removing the -fPIC was too hard (.pro adds one, qmake adds one), but -O does the trick for now.
Hmm, this does look like a gcc bug specific to your version; neither gcc 3.4.4, 4.1.1 or 4.2.4 do this for me. We only use 5 (of 8) regs from GENERAL_REGS and we could use less but at the cost of additional insns. Using -fomit-frame-pointer should help. The attached patch avoids using REG_c explicitly in case that helps too..