[FFmpeg-devel] [PATCHv2] avutil/mathematics: speed up av_gcd by using Stein's binary GCD algorithm

Michael Niedermayer michael at niedermayer.cc
Thu Oct 22 14:33:30 CEST 2015

On Thu, Oct 22, 2015 at 07:04:41AM -0400, Ganesh Ajjanagadde wrote:
> On Thu, Oct 22, 2015 at 5:49 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> > Ganesh Ajjanagadde <gajjanagadde <at> gmail.com> writes:
> >
> >> > This broke fate with -ftrapv
> >
> >> > The problem seems to be in av_gcd() and not the De-Bruijn version of
> >> > ff_ctzll since the gcc builtin is being used.
> >>
> >> Don't have the time to investigate right now - revert for now unless
> >> someone can fix it quickly.
> >
> > Ping?
> >
> > Please revert if nobody can fix this.
> "Fixing" this at the moment is highly dubious - read the thread. It
> does not even occur in a reproducible way, does not trigger on ubsan,
> I can't even see it on ftrapv. Show me why it is not a toolchain
> issue.

IMO never just assume that a problem that appears after a change you do
is not caused by your code.
Because if you do and you are wrong the bug might never be fixed
while OTOH, if you assume its in your code you will sooner or later
by debuging find the bug or more details, and that may be a
code generation issue in the toolchain outside your code in case
you where wrong.
Its the safer default assumtation as the failure path if you are wrong
is less bad.

either way, bug fixed
the reason for non reproduceablility likely was that the x86 asm
overrode the C code in which the bug was

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151022/7550a2ae/attachment.sig>

More information about the ffmpeg-devel mailing list