public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug inline-asm/45160] New: [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm)
@ 2010-08-01 23:59 t dot artem at mailcity dot com
2010-08-02 0:09 ` [Bug inline-asm/45160] " t dot artem at mailcity dot com
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: t dot artem at mailcity dot com @ 2010-08-01 23:59 UTC (permalink / raw)
To: gcc-bugs
A testcase for x86 architecture (Intel Core i5 CPU here):
1) Download
http://sourceforge.net/projects/faac/files/faad2-src/faad2-2.6/faad2-2.6.1.tar.gz/download
2) Build it using these commands
perl -pi -e 's|dnl AC_PROG_CXX|AC_PROG_CXX|' configure.in
autoreconf -vif
configure --disable-static
using GCC 4.2.4 and GCC 4.4.x
3) faad binary compiled with GCC 4.4.x will fail to properly decode some AAC
files (a sample file can be downloaded here
http://bugzilla.mplayerhq.hu/attachment.cgi?id=651 )
faad -o outfile.wav out.aac
...
Decoding out.aac took: 0.21 sec. 285.83x real-time. (GCC 4.2.x)
Decoding out.aac took: 1.55 sec. 38.72x real-time. (GCC 4.4.x)
So, we have two bugs here:
1) faad2's AAC decode algorithm fails to work correctly under GCC 4.4.x (even
with gcc -O2 -march=i686).
3) faad2's AAC decode algorithm compiled with GCC 4.4.x works an order of
magnitude slower than the same code code compiled using GCC 4.2.x.
--
Summary: [GCC 4.4.x regression] Invalid assembly code is
generated for x86 architecture for faad2 library (AAC
decode algorithm)
Product: gcc
Version: 4.4.5
Status: UNCONFIRMED
Severity: critical
Priority: P3
Component: inline-asm
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: t dot artem at mailcity dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45160
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug inline-asm/45160] [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm)
2010-08-01 23:59 [Bug inline-asm/45160] New: [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm) t dot artem at mailcity dot com
@ 2010-08-02 0:09 ` t dot artem at mailcity dot com
2010-08-02 0:31 ` t dot artem at mailcity dot com
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: t dot artem at mailcity dot com @ 2010-08-02 0:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from t dot artem at mailcity dot com 2010-08-02 00:09 -------
faad2 2.7.0 exhibits the same misbehavior, you can download it here:
http://downloads.sourceforge.net/faac/faad2-2.7.tar.bz2
No extra commands are required for compilation, just ./configure && make
---
P.S. You may want to use
./configure --enable-static --disable-shared
in order to get a single binary which doesn't use any external libraries (thus
it will be easier to verify the bug).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45160
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug inline-asm/45160] [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm)
2010-08-01 23:59 [Bug inline-asm/45160] New: [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm) t dot artem at mailcity dot com
2010-08-02 0:09 ` [Bug inline-asm/45160] " t dot artem at mailcity dot com
@ 2010-08-02 0:31 ` t dot artem at mailcity dot com
2010-08-02 13:09 ` [Bug inline-asm/45160] [4.4.x/4.5.x " t dot artem at mailcity dot com
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: t dot artem at mailcity dot com @ 2010-08-02 0:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from t dot artem at mailcity dot com 2010-08-02 00:31 -------
Created an attachment (id=21368)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21368&action=view)
faad2 2.7.0 complete sources with -save-temps
Complete sources with -save-temps for GCC 4.2.4 and GCC 4.4.4.
The same compilation flags:
-march=i686 -O2 -pipe -save-temps
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45160
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug inline-asm/45160] [4.4.x/4.5.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm)
2010-08-01 23:59 [Bug inline-asm/45160] New: [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm) t dot artem at mailcity dot com
2010-08-02 0:09 ` [Bug inline-asm/45160] " t dot artem at mailcity dot com
2010-08-02 0:31 ` t dot artem at mailcity dot com
@ 2010-08-02 13:09 ` t dot artem at mailcity dot com
2010-08-02 13:10 ` t dot artem at mailcity dot com
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: t dot artem at mailcity dot com @ 2010-08-02 13:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from t dot artem at mailcity dot com 2010-08-02 13:09 -------
I've just tested GCC 4.5.1 and it also miscompiles the source code.
--
t dot artem at mailcity dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[GCC 4.4.x regression] |[4.4.x/4.5.x regression]
|Invalid assembly code is |Invalid assembly code is
|generated for x86 |generated for x86
|architecture for faad2 |architecture for faad2
|library (AAC decode |library (AAC decode
|algorithm) |algorithm)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45160
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug inline-asm/45160] [4.4.x/4.5.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm)
2010-08-01 23:59 [Bug inline-asm/45160] New: [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm) t dot artem at mailcity dot com
` (2 preceding siblings ...)
2010-08-02 13:09 ` [Bug inline-asm/45160] [4.4.x/4.5.x " t dot artem at mailcity dot com
@ 2010-08-02 13:10 ` t dot artem at mailcity dot com
2010-08-02 13:15 ` t dot artem at mailcity dot com
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: t dot artem at mailcity dot com @ 2010-08-02 13:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from t dot artem at mailcity dot com 2010-08-02 13:10 -------
Created an attachment (id=21369)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21369&action=view)
faad2 2.7.0 complete sources with -save-temps for GCC 4.5.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45160
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug inline-asm/45160] [4.4.x/4.5.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm)
2010-08-01 23:59 [Bug inline-asm/45160] New: [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm) t dot artem at mailcity dot com
` (3 preceding siblings ...)
2010-08-02 13:10 ` t dot artem at mailcity dot com
@ 2010-08-02 13:15 ` t dot artem at mailcity dot com
2010-08-02 14:12 ` rguenth at gcc dot gnu dot org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: t dot artem at mailcity dot com @ 2010-08-02 13:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from t dot artem at mailcity dot com 2010-08-02 13:15 -------
I've found the culprit (or better say mplayer developer hinted), it is
-fstrict-aliasing optimization.
With -fno-strict-aliasing GCC 4.4.x and 4.5.x produce proper code.
Please, advise.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45160
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug inline-asm/45160] [4.4.x/4.5.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm)
2010-08-01 23:59 [Bug inline-asm/45160] New: [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm) t dot artem at mailcity dot com
` (4 preceding siblings ...)
2010-08-02 13:15 ` t dot artem at mailcity dot com
@ 2010-08-02 14:12 ` rguenth at gcc dot gnu dot org
2010-08-02 15:49 ` t dot artem at mailcity dot com
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-08-02 14:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from rguenth at gcc dot gnu dot org 2010-08-02 14:12 -------
Why CC me? I have no clue about faad2, the strict-aliasing thing hints
at errors in faad2, not gcc.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|rguenth at gcc dot gnu dot |
|org |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45160
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug inline-asm/45160] [4.4.x/4.5.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm)
2010-08-01 23:59 [Bug inline-asm/45160] New: [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm) t dot artem at mailcity dot com
` (5 preceding siblings ...)
2010-08-02 14:12 ` rguenth at gcc dot gnu dot org
@ 2010-08-02 15:49 ` t dot artem at mailcity dot com
2010-08-02 16:21 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: t dot artem at mailcity dot com @ 2010-08-02 15:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from t dot artem at mailcity dot com 2010-08-02 15:49 -------
(In reply to comment #6)
> Why CC me? I have no clue about faad2, the strict-aliasing thing hints
> at errors in faad2, not gcc.
>
Richard, I don't know who is who amongst GCC developers, but you are a
prominent person, so I thought you know someone who can help shed light on this
issue.
Like I said GCC 4.2.x has no problems compiling this library, so I have no idea
who to blame and who else I should get in touch with.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45160
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug inline-asm/45160] [4.4.x/4.5.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm)
2010-08-01 23:59 [Bug inline-asm/45160] New: [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm) t dot artem at mailcity dot com
` (6 preceding siblings ...)
2010-08-02 15:49 ` t dot artem at mailcity dot com
@ 2010-08-02 16:21 ` pinskia at gcc dot gnu dot org
2010-08-02 20:27 ` t dot artem at mailcity dot com
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-08-02 16:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from pinskia at gcc dot gnu dot org 2010-08-02 16:21 -------
> Like I said GCC 4.2.x has no problems compiling this library, so I have no idea
> who to blame and who else I should get in touch with.
I would get into contact with the developers of the library first. Yes GCC has
some bugs but the library could have a bug still. Since the problem disappreas
with -fno-strict-aliasing that normally points at a bug in the library. In
that it does not follow the C/C++ alisaing rules.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45160
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug inline-asm/45160] [4.4.x/4.5.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm)
2010-08-01 23:59 [Bug inline-asm/45160] New: [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm) t dot artem at mailcity dot com
` (7 preceding siblings ...)
2010-08-02 16:21 ` pinskia at gcc dot gnu dot org
@ 2010-08-02 20:27 ` t dot artem at mailcity dot com
2010-08-30 15:47 ` rguenth at gcc dot gnu dot org
2010-09-06 20:20 ` t dot artem at mailcity dot com
10 siblings, 0 replies; 12+ messages in thread
From: t dot artem at mailcity dot com @ 2010-08-02 20:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from t dot artem at mailcity dot com 2010-08-02 20:27 -------
The culprit is the ic_predict.c file. When I compile it with
-fno-strict-aliasing (while everything else is being compiled with
-fstrict-aliasing) libfaad works correctly.
These are the warnings which I get from GCC:
ic_predict.c: In function 'flt_round':
ic_predict.c:58: warning: dereferencing type-punned pointer will break
strict-aliasing rules
ic_predict.c:58: warning: dereferencing type-punned pointer will break
strict-aliasing rules
ic_predict.c:58: warning: dereferencing type-punned pointer will break
strict-aliasing rules
ic_predict.c:60: warning: dereferencing type-punned pointer will break
strict-aliasing rules
ic_predict.c: In function 'ic_prediction':
ic_predict.c:78: warning: dereferencing pointer 'tmp' does break
strict-aliasing rules
ic_predict.c:77: note: initialized from here
ic_predict.c:78: warning: dereferencing pointer 'tmp' does break
strict-aliasing rules
ic_predict.c:77: note: initialized from here
ic_predict.c:78: warning: dereferencing pointer 'tmp' does break
strict-aliasing rules
ic_predict.c:77: note: initialized from here
ic_predict.c:78: warning: dereferencing pointer 'tmp' does break
strict-aliasing rules
ic_predict.c:77: note: initialized from here
ic_predict.c:78: warning: dereferencing pointer 'tmp' does break
strict-aliasing rules
ic_predict.c:77: note: initialized from here
ic_predict.c:78: warning: dereferencing pointer 'tmp' does break
strict-aliasing rules
ic_predict.c:77: note: initialized from here
Maybe GCC developers could devise a patch for this file because
http://www.audiocoding.com/faad2.html site seems to be dead.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45160
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug inline-asm/45160] [4.4.x/4.5.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm)
2010-08-01 23:59 [Bug inline-asm/45160] New: [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm) t dot artem at mailcity dot com
` (8 preceding siblings ...)
2010-08-02 20:27 ` t dot artem at mailcity dot com
@ 2010-08-30 15:47 ` rguenth at gcc dot gnu dot org
2010-09-06 20:20 ` t dot artem at mailcity dot com
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-08-30 15:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from rguenth at gcc dot gnu dot org 2010-08-30 15:47 -------
Not a gcc bug.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45160
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug inline-asm/45160] [4.4.x/4.5.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm)
2010-08-01 23:59 [Bug inline-asm/45160] New: [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm) t dot artem at mailcity dot com
` (9 preceding siblings ...)
2010-08-30 15:47 ` rguenth at gcc dot gnu dot org
@ 2010-09-06 20:20 ` t dot artem at mailcity dot com
10 siblings, 0 replies; 12+ messages in thread
From: t dot artem at mailcity dot com @ 2010-09-06 20:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from t dot artem at mailcity dot com 2010-09-06 20:19 -------
(In reply to comment #9)
> Maybe GCC developers could devise a patch for this file because
> http://www.audiocoding.com/faad2.html site seems to be dead.
>
(In reply to comment #10)
> Not a gcc bug.
>
FAAD developers don't answer my e-mails, so what I can do? Resort to compile
FAAD library using a specially compiled GCC? What about other less experienced
users? There just a few warnings which I suppose can be easily resolved ...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45160
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2010-09-06 20:20 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-01 23:59 [Bug inline-asm/45160] New: [GCC 4.4.x regression] Invalid assembly code is generated for x86 architecture for faad2 library (AAC decode algorithm) t dot artem at mailcity dot com
2010-08-02 0:09 ` [Bug inline-asm/45160] " t dot artem at mailcity dot com
2010-08-02 0:31 ` t dot artem at mailcity dot com
2010-08-02 13:09 ` [Bug inline-asm/45160] [4.4.x/4.5.x " t dot artem at mailcity dot com
2010-08-02 13:10 ` t dot artem at mailcity dot com
2010-08-02 13:15 ` t dot artem at mailcity dot com
2010-08-02 14:12 ` rguenth at gcc dot gnu dot org
2010-08-02 15:49 ` t dot artem at mailcity dot com
2010-08-02 16:21 ` pinskia at gcc dot gnu dot org
2010-08-02 20:27 ` t dot artem at mailcity dot com
2010-08-30 15:47 ` rguenth at gcc dot gnu dot org
2010-09-06 20:20 ` t dot artem at mailcity dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).