From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41544 invoked by alias); 10 Oct 2015 19:46:57 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 41515 invoked by uid 48); 10 Oct 2015 19:46:53 -0000 From: "jamrial at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/67920] New: wrong code with -O3 Date: Sat, 10 Oct 2015 19:46:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jamrial at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg00803.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67920 Bug ID: 67920 Summary: wrong code with -O3 Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: jamrial at gmail dot com Target Milestone: --- Some change to trunk made in the last 18 days is making gcc miscompile the files libavcodec/jpeg2000dec.c libavcodec/j2kenc.c and libavcodec/avuidec.c from ffmpeg git head when -O3 is used. This doesn't happen with -O2. I tested with x86_64-pc-linux-gnu only. How to reproduce: git clone git://git.videolan.org/ffmpeg.git && cd ffmpeg && ./configure make fate-vsynth1-jpeg2000 fate-vsynth1-avui The tests will fail, the former showing both the encoder and decoder are producing garbage, and the latter only the decoder. Adding -fno-strict-aliasing -fwrapv does not make a difference. The command Makefile uses to compile all three files looks like this: gcc -I. -I/home/jamrial/ffmpeg/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DZLIB_CONST -DHAVE_AV_CONFIG_H -std=c99 -fomit-frame-pointer -pthread -g -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=format-security -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -Wformat -fdiagnostics-color=auto -Wno-maybe-uninitialized -c -o OUTPUT.o INPUT.c You can get that kind of verbose output by running make with V=1. Keep in mind you'll probably run into pr67794 while bisecting gcc trunk to find the commit that introduced this regression. Apologizes for not having a simpler test case.