[FFmpeg-devel] [PATCH] configure: disable the new optimizer in Visual Studio 2015 Update 3

Michael Niedermayer michael at niedermayer.cc
Fri Jan 6 14:04:08 EET 2017


On Fri, Jan 06, 2017 at 12:11:57AM +0100, Kacper Michajlow wrote:
> 2016-07-04 3:53 GMT+02:00 Kacper Michajlow <kasper93 at gmail.com>:
> > 2016-07-03 23:39 GMT+02:00 Hendrik Leppkes <h.leppkes at gmail.com>:
> >> On Tue, Jun 28, 2016 at 12:01 PM, Hendrik Leppkes <h.leppkes at gmail.com> wrote:
> >>> On Tue, Jun 28, 2016 at 11:48 AM, Hendrik Leppkes <h.leppkes at gmail.com> wrote:
> >>>> Visual Studio 2015 Update 3 introduced a new SSA optimizer, however
> >>>> it unfortunately causes miscompilations. Until it is fixed, the new
> >>>> optimizations are disabled and should be re-checked on subsequent
> >>>> compiler releases.
> >>>>
> >>>> Fixes recent FATE failure of fate-lavf-pam on VS2015.
> >>>
> >>> On that note, i'm not exactly sure which code actually miscompiles.
> >>> I though its pamenc, but the generated files are identical, then I
> >>> though its the crc computing code (crcenc/adler32), but those seem
> >>> fine as well and would likely screw up in more then one case if they
> >>> would miscompile.
> >>>
> >>> So that leaves pnmdec, I suppose, but I didn't make much headway to
> >>> poke around in that. If anyone has any handy hints how to find the
> >>> code in question that might be helpful.
> >>> Maybe the code is actually not-quite-right and might enjoy some straigtening.
> >>>
> >>
> >> Applied the patch to disable the new optimizations in MSVC as I did
> >> not spot anything obviously "bad" in pamdec - which does not mean
> >> there isn't anything there, of course.
> >>
> >
> > This is pretty bad miscompilation in new SSA optimizer. It assumes
> > that variable declared in loop doesn't change the value even if there
> > is assignment. I minimized testcese and reported the bug
> > https://connect.microsoft.com/VisualStudio/feedback/details/2890170
> >
> > - Kacper
> 
> Sorry for bumping such old thread, but I just got information that the
> bug has been fixed in MSVC.
> 
> It is fixed in hotfix for VS2015 - KB3207317
> https://support.microsoft.com/en-us/kb/3207317 and of course in
> upcoming VS2017.
> 
> I've confirmed that this hotfix fixes fate-lavf-pam test. The
> following change will enable SSA Optimizer on newer compiler versions.
> 
> ---
>  configure | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/configure b/configure
> index 398e843..cf82b3b 100755
> --- a/configure
> +++ b/configure
> @@ -6317,9 +6317,9 @@ EOF
>      check_func strtoll || add_cflags -Dstrtoll=_strtoi64
>      check_func strtoull || add_cflags -Dstrtoull=_strtoui64
>      # the new SSA optimzer in VS2015 U3 is mis-optimizing some parts
> of the code
> -    # this flag should be re-checked on newer compiler releases and put under a

patch is currupted by stray newline

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- 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/20170106/b294b5b2/attachment.sig>


More information about the ffmpeg-devel mailing list