Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 15386
Product:  
Component:  
Status: RESOLVED
Resolution: DUPLICATE of bug 323
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Diego Biurrun <diego@biurrun.de>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 15386 depends on: Show dependency tree
Show dependency graph
Bug 15386 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: Opened: 2004-05-11 20:57
MPlayer triggers another compiler bug...

The WMA (Windows Media audio codec) decoder of FFmpeg/libavcodec
(http://ffmpeg.org) wmadec.c gets miscompiled by gcc versions >=3.1 when
compiled with -mcpu=k6 and/or -O1 or above.  When playing a WMA sample with
MPlayer all you get is pop at the beginning and then no sound.  The problem
disappears with either -mcpu=pentium-mmx or -O0 (changing one parameter is
enough to make the problem go away, either one works).

Here is the complete command line and output when compiling the file:

/var/tmp/gcc-3.5-20040502/bin/gcc -I../libvo/ -I../../libvo -I/usr/X11R6/include
-g -O4 -march=k6 -mcpu=k6 -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT
-I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include
-DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
-Wall -save-temps -c -o wmadec.o wmadec.c && make && cd .. && make
gcc: warning: -pipe ignored because -save-temps specified
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.

I have tried several gcc versions, 2.95.3 and 3.0.4 are OK, 3.1, 3.1.1, 3.2.3,
3.3.2, 3.4.0 and 3.5.0-20040502 all display the problem.

gcc -v output:
Configured with: ../gcc-3.1/configure --prefix=/var/tmp/gcc-3.1/
Thread model: single
gcc version 3.1

I put the file together with all the headers necessary to compile it, the .o and
.i files and a sample to test the broken sound with MPlayer on my homepage:

http://www.mplayerhq.hu/~diego/gcc/

If you require further info or testing I will be more than happy to provide it.

------- Comment #1 From Andrew Pinski 2004-05-11 22:36 -------
Does adding -fno-strict-aliasing work?

------- Comment #2 From Diego Biurrun 2004-05-11 23:19 -------
No, -fno-strict-aliasing does not help.

------- Comment #3 From Eric Botcazou 2004-05-12 06:05 -------
Which version of binutils do you use?

------- Comment #4 From Diego Biurrun 2004-05-12 08:09 -------
binutils version: 2.14.90.0.7-6

Some more information: My machine is a K6-III 500 running current Debian
unstable with a homebrewed 2.4.25 kernel.

------- Comment #5 From Andrew Pinski 2004-05-12 13:13 -------
Does lowering the optimization to -O2 help? (Note -O4 is the same as -O3).

------- Comment #6 From Diego Biurrun 2004-05-12 13:41 -------
No, -O2 does not help.  As noted above the problem goes away with -O0 (-O1
still
has the bug) or -mcpu=pentium-mmx or both.

------- Comment #7 From Wolfgang Bangerth 2004-05-12 13:49 -------
One of the things that would really help us is if you could split 
up the one file that is miscompiled into a number of files each 
of which has exactly one function, and try to figure out which 
function is miscompiled. One of the reasons why we have trouble 
doing anything with your report except for poking in the dark is 
because it is very hard to figure out what exactly goes wrong in 
applications that we don't know, and we usually need quite some help 
from application developers to figure out where the bug is. So if 
you could try to cut the problem down to one or a few functions, it 
would be a tremendous help. The next step is to determine for which 
arguments this function does the wrong thing, and to put together 
a small testcase where this one function is called with just these 
parameters for which the output is known. 
 
Thanks 
  Wolfgang 

------- Comment #8 From Eric Botcazou 2004-05-15 06:10 -------
We need a preprocessed testcase to start working on it.

------- Comment #9 From Diego Biurrun 2004-07-18 11:07 -------
small remark: Adding -fno-inline to the compilation flags does not help.

------- Comment #10 From Diego Biurrun 2004-07-18 12:08 -------
I managed to split the file in two and isolate the bug to a small part of the
original file that only contains two functions, a large and a small one.

void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len)
int wma_decode_init(AVCodecContext * avctx)

All relevant files and the output of gcc can be found at

http://www.mplayerhq.hu/~diego/gcc/

I hope this satisfies your requirements, if there is anything else I can do,
please let me know.

------- Comment #11 From Andrew Pinski 2004-07-18 14:25 -------
Does -ffloat-store help at all?

------- Comment #12 From Diego Biurrun 2004-07-19 00:49 -------
-ffloat-store fixes the problem.

------- Comment #13 From Andrew Pinski 2004-07-19 01:19 -------
This is a dup of bug 323, the problem is with excessive precession.

*** This bug has been marked as a duplicate of 323 ***

------- Comment #14 From Diego Biurrun 2004-07-19 11:50 -------
Hmmm, how can a bug that started appearing with 3.1 be duped against a bug open
against 2.95.2 when 2.95.3 has no problems at all?

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug