https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69320
Bug ID: 69320 Summary: wrong code generation at -O2 and higher Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: jamrial at gmail dot com Target Milestone: --- Created attachment 37377 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37377&action=edit Assembly and preprocessed output of miscompiled file http://fate.ffmpeg.org/report.cgi?time=20160116195307&slot=x86_64-archlinux-gcc-experimental https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/svq1enc.c;h=1e1745e7b10ed24e8a600d643b5aa951317f2aba;hb=HEAD FFmpeg's svq1 encoder is being miscompiled by GCC 6 starting with revision r232361. I'm attaching example assembly of the last good commit and the first bad, alongside the preprocessed output. To reproduce the issue you can download ffmpeg and run the fate svq1 tests (no external samples needed to run), which will fail and create output video files full of artifacts from the revision mentioned above onward: git clone https://git.videolan.org/git/ffmpeg.git && cd ffmpeg && ./configure && make fate-vsynth{1,2,3}-svq1