[x264-devel] configure: test for log2f fails, external reference folded out

BugMaster BugMaster at narod.ru
Tue Oct 16 08:04:21 CEST 2018


On Tue, 16 Oct 2018 00:04:41 +0100, Dirk Fieldhouse wrote:
> On 15/10/18 19:55, BugMaster wrote:
>> ...
>> So log2f exists at compile time for constant evolution but not at
>> runtime for variables? It is weird system/environment. Or is this only
>> due use of uClibc instead of glibc (and gcc still use glibc during
>> constant evolution)?

> Exactly. This uClibc's libmath doesn't have log2f(), but perhaps this
> gcc was built with the equivalent of HAVE_LOGF=0, causing its internal
> log2f() to be defined through logf(). Or perhaps it does enough static
> analysis to determine that log2f(2) is never used and so discards it. Or
> both?

>> Anyway for even more obstacle to compiler to optimize it out we can
>> also add volatile to variable declaration.
>> 
>> Check that it works as expected with attached patch.

> Supporting the 2nd hypothesis above, it's not enough just to mention
> log2f(x). You actually have to assign it as in my original proposal
> above, so the proposed patch doesn't quite work even with the "volatile"
> qualifier. I've made the trivial mod in the attached.

> regards
> /df

Hm. So use of function result is obligatory condition to not remove it
call? And what about simple 'return log2f(2);' (attached patch)?
Or would it replace it with constant?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-configure-Fix-log2f-support-check-at-some-systems.patch
Type: application/octet-stream
Size: 643 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x264-devel/attachments/20181016/8f60fa5b/attachment.obj>


More information about the x264-devel mailing list