Ticket #5997 (closed defect: fixed)
Opened 4 years ago
Last modified 4 years ago
soundtouch SSE ASM exposes GCC bug
| Reported by: | nigel | Owned by: | ijr |
|---|---|---|---|
| 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
Change History
comment:1 Changed 4 years ago by foobum@…
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..
comment:2 Changed 4 years ago by nigel
Thanks for the patch, Nick, but sadly neither it nor -fomit make any difference.
comment:3 Changed 4 years ago by foobum@…
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 Changed 4 years ago by nigel
Removing the -fPIC was too hard (.pro adds one, qmake adds one), but -O does the trick for now.
