bas-t / ffdecsawrapper

FFdecsa empowered softcam for MythTV
GNU General Public License v3.0
17 stars 9 forks source link

g++ 4.8 and higher segfaults using -O3 on mmx optimization #8

Closed bas-t closed 10 years ago

bas-t commented 10 years ago

When using g++ 4.8 or snapshot from 4.9 on Debian, the PARALLEL_64_MMX and PARALLEL_128_2MMX tests segfault with optimization level -O3

Don't have a clue right now.

bas-t commented 10 years ago

Tested on Ubuntu Saucy. Same negative result.

I suspect that it could have something to do with different gcc version used to compile the kernel. In Debian as well as Ubuntu, it is common practice to ship a higher default gcc version in any given release then the kernel was compiled with.

Up until gcc 4.7 version, this was not much of an issue, but it seems that gcc 4.8 makes the difference.

Still investigating.

bas-t commented 10 years ago

Tested again on Saucy. cat /proc/version shows that the kernel is build with gcc version 4.8.1 No segfaults.

bas-t commented 10 years ago

Tested again, different results. Using gcc/g++ version 4.8.1 compiler on Ubuntu Saucy, Debian Wheezy and Debian Jessie, testing mmx optimization with optimization level 3 (-O3)

Mobile AMD Sempron(tm) Processor 3000+, 1 cores --> failed test Intel(R) Atom(TM) CPU D525 @ 1.80GHz, 4 cores --> failed too AMD Geode NX 1750 , 1 cores --> success!

Same tests done using a lower gcc/g++ version (4.7 or 4.6) allways lead to success

I don't know what to think of it, except that I'm nowhere near a conclusive anwer to this issue right now.

A hypothetical answer: wether or not segfaulting while testing mmx optimization (level 3) could very well depend on the processor the tests are done with (that is, while using 4.8 compiler).

I only have these three processors to test with, I need feedback from people with other processors.

DingoSEAD commented 10 years ago

mythbuntu 12.04 LTS 3.2 gcc 4.6

command : ./configure --compiletype=release

http://pastebin.com/gTFV0tLD

bas-t commented 10 years ago

@DingoSEAD: I've opened a new ticket for this, your issue has nothing to do with g++ 4.8 and mmx optimization segfaults.

Thanks for finding a bug in the code, I pushed a workaround, I need to rework the new optimization code anyway to fix this and maybe other issues in a more permanent way. It's on my to-do list with high priority

Opened ticket #12 as a reminder to myself.

bas-t commented 10 years ago

"A hypothetical answer: wether or not segfaulting while testing mmx optimization (level 3) could very well depend on the processor the tests are done with (that is, while using 4.8 compiler)."

Not so much hypothetical anymore, this is clearly a bug in gcc 4.8. Some CPU's suffer from it, but most don't Sadly, most of my cpu's are in the wrong list.

As it is now, it's not even a biggy, optimization with level -O2 is much faster with gcc 4.8, allmost as fast as -O3 in gcc 4.6

bas-t commented 10 years ago

Seems to be related to 32 bits os, afaik amd64 systems are not affected.