public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/41311]  New: [4.5 regression] FFmpeg crashes when converting mpg to avi
@ 2009-09-08 18:04 ami_stuff at o2 dot pl
  2009-09-08 18:07 ` [Bug c/41311] " ami_stuff at o2 dot pl
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: ami_stuff at o2 dot pl @ 2009-09-08 18:04 UTC (permalink / raw)
  To: gcc-bugs

Hi,

FFmpeg compiled with GCC 4.5 (20090827) crashes when I try to convert mpg file
to avi (divx). 

"FFmpeg_020fpu -i test.mpg test.avi"

1. I get crash only with "-m68020 -m68881" options, not with -m68040 or
-m68060.
2. I get crash only with -O1, -O2 or -O3 options, not with -O0.
3. GCC 4.4.2 (20090825) don't have this problem.

The problematic file is "libavcodec/ratecontrol.c" - this file generates crash.
I include preprocessed file from GCC 4.4.2 and GCC 4.5.0.

$ make_68k_v45
/usr/local/amiga/bin/m68k-amigaos-gcc-4.5.0.exe -V 4.5.0 -DHAVE_AV_CONFIG_H -I.
-I"/bin/ffmpeg9" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
-D_FILE_OFFSET_BITS=6
4 -D_LARGEFILE_SOURCE -m68020 -m68881 -mnobitfield -std=c99 -fno-common
-fomit-f
rame-pointer -Wdeclaration-after-statement -Wall -Wno-switch
-Wdisabled-optimiza
tion -Wpointer-arith -Wredundant-decls -Wcast-qual -Wwrite-strings -Wundef -O2
-
finline-functions -fno-math-errno       -MMD -MF libavcodec/ratecontrol.d -MT
li
bavcodec/ratecontrol.o -c -o libavcodec/ratecontrol.o libavcodec/ratecontrol.c
libavcodec/ratecontrol.c: In function 'ff_rate_control_init':
libavcodec/ratecontrol.c:109:5: warning: passing argument 3 of 'ff_parse'
discar
ds qualifiers from pointer target type
libavcodec/eval.h:64:14: note: expected 'double (**)(void *, double)' but
argume
nt is of type 'double (* const*)(void *, double)'
libavcodec/ratecontrol.c:109:5: warning: passing argument 4 of 'ff_parse'
discar
ds qualifiers from pointer target type
libavcodec/eval.h:64:14: note: expected 'const char **' but argument is of type
'const char * const*'
libavcodec/ratecontrol.c:168:13: warning: passing argument 2 of 'av_log' makes
i
nteger from pointer without a cast
./libavutil/log.h:104:6: note: expected 'int' but argument is of type 'const
cha
r *'
libavcodec/ratecontrol.c:168:13: warning: too many arguments for format
libavcodec/ratecontrol.c:169:13: warning: passing argument 2 of 'av_log' makes
i
nteger from pointer without a cast
./libavutil/log.h:104:6: note: expected 'int' but argument is of type 'const
cha
r *'
libavcodec/ratecontrol.c:169:13: warning: too many arguments for format
libavcodec/ratecontrol.c: In function 'get_qminmax':
libavcodec/ratecontrol.c:413:5: warning: passing argument 2 of 'av_log' makes
in
teger from pointer without a cast
./libavutil/log.h:104:6: note: expected 'int' but argument is of type 'const
cha
r *'
libavcodec/ratecontrol.c:413:5: warning: too many arguments for format
libavcodec/ratecontrol.c: In function 'ff_rate_estimate_qscale':
libavcodec/ratecontrol.c:692:9: warning: passing argument 2 of 'av_log' makes
in
teger from pointer without a cast
./libavutil/log.h:104:6: note: expected 'int' but argument is of type 'const
cha
r *'
libavcodec/ratecontrol.c:692:9: warning: too many arguments for format
libavcodec/ratecontrol.c:693:9: warning: passing argument 2 of 'av_log' makes
in
teger from pointer without a cast
./libavutil/log.h:104:6: note: expected 'int' but argument is of type 'const
cha
r *'
libavcodec/ratecontrol.c:693:9: warning: too many arguments for format
libavcodec/ratecontrol.c:725:13: warning: passing argument 2 of 'av_log' makes
i
nteger from pointer without a cast
./libavutil/log.h:104:6: note: expected 'int' but argument is of type 'const
cha
r *'
libavcodec/ratecontrol.c:725:13: warning: too many arguments for format
libavcodec/ratecontrol.c:764:9: warning: passing argument 2 of 'av_log' makes
in
teger from pointer without a cast
./libavutil/log.h:104:6: note: expected 'int' but argument is of type 'const
cha
r *'
libavcodec/ratecontrol.c:764:9: warning: too many arguments for format
libavcodec/ratecontrol.c:768:9: warning: passing argument 2 of 'av_log' makes
in
teger from pointer without a cast
./libavutil/log.h:104:6: note: expected 'int' but argument is of type 'const
cha
r *'
libavcodec/ratecontrol.c:768:9: warning: too many arguments for format
libavcodec/ratecontrol.c:780:9: warning: passing argument 2 of 'av_log' makes
in
teger from pointer without a cast
./libavutil/log.h:104:6: note: expected 'int' but argument is of type 'const
cha
r *'
libavcodec/ratecontrol.c:780:9: warning: too many arguments for format
libavcodec/ratecontrol.c:786:9: warning: passing argument 2 of 'av_log' makes
in
teger from pointer without a cast
./libavutil/log.h:104:6: note: expected 'int' but argument is of type 'const
cha
r *'
libavcodec/ratecontrol.c:786:9: warning: too many arguments for format
libavcodec/ratecontrol.c: In function 'init_pass2':
libavcodec/ratecontrol.c:874:9: warning: passing argument 2 of 'av_log' makes
in
teger from pointer without a cast
./libavutil/log.h:104:6: note: expected 'int' but argument is of type 'const
cha
r *'
libavcodec/ratecontrol.c:874:9: warning: too many arguments for format
libavcodec/ratecontrol.c:936:5: warning: passing argument 2 of 'av_log' makes
in
teger from pointer without a cast
./libavutil/log.h:104:6: note: expected 'int' but argument is of type 'const
cha
r *'
libavcodec/ratecontrol.c:936:5: warning: too many arguments for format


-- 
           Summary: [4.5 regression] FFmpeg crashes when converting mpg to
                    avi
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ami_stuff at o2 dot pl
  GCC host triplet: i686-cygwin
GCC target triplet: m68k-amigaos


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c/41311] [4.5 regression] FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
@ 2009-09-08 18:07 ` ami_stuff at o2 dot pl
  2009-09-08 18:07 ` ami_stuff at o2 dot pl
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ami_stuff at o2 dot pl @ 2009-09-08 18:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from ami_stuff at o2 dot pl  2009-09-08 18:07 -------
Created an attachment (id=18544)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18544&action=view)
asm output GCC 4.4.2 -O1


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c/41311] [4.5 regression] FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
  2009-09-08 18:07 ` [Bug c/41311] " ami_stuff at o2 dot pl
@ 2009-09-08 18:07 ` ami_stuff at o2 dot pl
  2009-09-08 18:09 ` ami_stuff at o2 dot pl
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ami_stuff at o2 dot pl @ 2009-09-08 18:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ami_stuff at o2 dot pl  2009-09-08 18:06 -------
Created an attachment (id=18543)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18543&action=view)
preprocessed file GCC 4.4.2 -O1


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c/41311] [4.5 regression] FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
  2009-09-08 18:07 ` [Bug c/41311] " ami_stuff at o2 dot pl
  2009-09-08 18:07 ` ami_stuff at o2 dot pl
@ 2009-09-08 18:09 ` ami_stuff at o2 dot pl
  2009-09-08 18:09 ` ami_stuff at o2 dot pl
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ami_stuff at o2 dot pl @ 2009-09-08 18:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from ami_stuff at o2 dot pl  2009-09-08 18:09 -------
Created an attachment (id=18546)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18546&action=view)
asm output GCC 4.5.0 -O0


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c/41311] [4.5 regression] FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
                   ` (2 preceding siblings ...)
  2009-09-08 18:09 ` ami_stuff at o2 dot pl
@ 2009-09-08 18:09 ` ami_stuff at o2 dot pl
  2009-09-08 18:11 ` ami_stuff at o2 dot pl
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ami_stuff at o2 dot pl @ 2009-09-08 18:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ami_stuff at o2 dot pl  2009-09-08 18:08 -------
Created an attachment (id=18545)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18545&action=view)
preprocessed file GCC 4.5.0 -O0


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c/41311] [4.5 regression] FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
                   ` (4 preceding siblings ...)
  2009-09-08 18:11 ` ami_stuff at o2 dot pl
@ 2009-09-08 18:11 ` ami_stuff at o2 dot pl
  2009-09-08 18:17 ` schwab at linux-m68k dot org
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ami_stuff at o2 dot pl @ 2009-09-08 18:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from ami_stuff at o2 dot pl  2009-09-08 18:10 -------
Created an attachment (id=18547)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18547&action=view)
preprocessed file GCC 4.5.0 -O1


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c/41311] [4.5 regression] FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
                   ` (3 preceding siblings ...)
  2009-09-08 18:09 ` ami_stuff at o2 dot pl
@ 2009-09-08 18:11 ` ami_stuff at o2 dot pl
  2009-09-08 18:11 ` ami_stuff at o2 dot pl
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ami_stuff at o2 dot pl @ 2009-09-08 18:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from ami_stuff at o2 dot pl  2009-09-08 18:11 -------
Created an attachment (id=18548)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18548&action=view)
asm output GCC 4.5.0 -O1


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c/41311] [4.5 regression] FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
                   ` (5 preceding siblings ...)
  2009-09-08 18:11 ` ami_stuff at o2 dot pl
@ 2009-09-08 18:17 ` schwab at linux-m68k dot org
  2009-09-08 18:36 ` ami_stuff at o2 dot pl
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: schwab at linux-m68k dot org @ 2009-09-08 18:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from schwab at linux-m68k dot org  2009-09-08 18:16 -------
Fix all the warnings first then try again.


-- 

schwab at linux-m68k dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c/41311] [4.5 regression] FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
                   ` (6 preceding siblings ...)
  2009-09-08 18:17 ` schwab at linux-m68k dot org
@ 2009-09-08 18:36 ` ami_stuff at o2 dot pl
  2009-09-09 14:55 ` nospamname at web dot de
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ami_stuff at o2 dot pl @ 2009-09-08 18:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ami_stuff at o2 dot pl  2009-09-08 18:36 -------
I don't know how to do it.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c/41311] [4.5 regression] FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
                   ` (7 preceding siblings ...)
  2009-09-08 18:36 ` ami_stuff at o2 dot pl
@ 2009-09-09 14:55 ` nospamname at web dot de
  2009-09-18  4:47 ` [Bug target/41311] " pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: nospamname at web dot de @ 2009-09-09 14:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from nospamname at web dot de  2009-09-09 14:54 -------
ratecontrol.c line 624 cause crash in my source.assert is done by this
command(should be fbngt)

FBNLT   _ff_rate_estimate_qscale+$716 ;118F015C

q= get_qscale(s, rce, rate_factor, picture_number);
printf("%f\n",q); // (is 613.928)
        if (q < 0)
            return -1;
        TRAP
---->        assert(q>0.0);

the TRAP command is a define to jump in debugger with trap #0.i notice it seem
break the peephole detect and so 
GCC 4.5.0 produce working code when trap is in.see the  FBNGT  
_ff_rate_estimate_qscale+$71A.thats correct and ffmpeg work.

on 2. asm snippet that do not work its.

and the assert is execute

FMOVE.D (A7)+,FP0                    
FMOVE.S FP0,D4                       
FMOVE.S D4,FP4                       
FMOVE.D FP4,-(A7)                    
PEA     _ff_get_2pass_fcode+$24(PC) ;
JSR     _printf      ;11A1563C       
LEA     $20(A7),A7                   
FTST.S  D4                           
FBLT    _ff_rate_estimate_qscale+$5D4
TRAP    #0                           
FTST.S  D4                           
FBNGT   _ff_rate_estimate_qscale+$71A
FMOVE.D FP4,-(A7)                    
MOVE.L  A3,-(A7)                     
MOVE.L  A2,-(A7)    

without this asm command trap #0 the asm code that fail. 

MOVE.L  D1,-(A7)                               
MOVE.L  D0,-(A7)                               
FMOVE.D (A7)+,FP0                              
FMOVE.S FP0,D4                                 
FMOVE.S D4,FP4                                 
FMOVE.D FP4,-(A7)                              
PEA     _ff_get_2pass_fcode+$24(PC) ;118EF9E8  
JSR     _printf      ;11A15638                 
LEA     $20(A7),A7                             
FTST.S  D4                                     
FBLT    _ff_rate_estimate_qscale+$5D0 ;118F0016
FBNLT   _ff_rate_estimate_qscale+$716 ;118F015C
FMOVE.D FP4,-(A7)                              
MOVE.L  A3,-(A7)                               
MOVE.L  A2,-(A7)                               
JSR     _ff_rac_terminate+$19E(PC) ;118ECF6C   
MOVE.L  D1,-(A7)                               
MOVE.L  D0,-(A7)                               
FMOVE.D (A7)+,FP1                              



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug target/41311] [4.5 regression] FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
                   ` (8 preceding siblings ...)
  2009-09-09 14:55 ` nospamname at web dot de
@ 2009-09-18  4:47 ` pinskia at gcc dot gnu dot org
  2009-09-18  9:20 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-09-18  4:47 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
          Component|c                           |target
           Keywords|                            |wrong-code
   Target Milestone|---                         |4.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug target/41311] [4.5 regression] FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
                   ` (9 preceding siblings ...)
  2009-09-18  4:47 ` [Bug target/41311] " pinskia at gcc dot gnu dot org
@ 2009-09-18  9:20 ` rguenth at gcc dot gnu dot org
  2009-12-29 16:30 ` schwab at linux-m68k dot org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-09-18  9:20 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug target/41311] [4.5 regression] FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
                   ` (10 preceding siblings ...)
  2009-09-18  9:20 ` rguenth at gcc dot gnu dot org
@ 2009-12-29 16:30 ` schwab at linux-m68k dot org
  2010-01-02  0:42 ` [Bug target/41311] [4.5 regression] m68k - " ami_stuff at o2 dot pl
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: schwab at linux-m68k dot org @ 2009-12-29 16:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from schwab at linux-m68k dot org  2009-12-29 16:29 -------
m68k-amigaos is not a supported target.


-- 

schwab at linux-m68k dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug target/41311] [4.5 regression] m68k - FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
                   ` (11 preceding siblings ...)
  2009-12-29 16:30 ` schwab at linux-m68k dot org
@ 2010-01-02  0:42 ` ami_stuff at o2 dot pl
  2010-01-02  0:47 ` ami_stuff at o2 dot pl
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ami_stuff at o2 dot pl @ 2010-01-02  0:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from ami_stuff at o2 dot pl  2010-01-02 00:41 -------
The problematic function is as was said "ff_rate_estimate_qscale".

I found out which optimizations causes the problem:

-m68020 -m68881 -O1 -fno-tree-ccp -fno-tree-dominator-opts (works ok).

-m68020 -m68881 -O1 ("Abort trap")

I attache output files from GCC 4.5 20091224. Maybe someone will try to create
a simpler testcase for thie bug in the future. GCC 4.4 and all older versions
of GCC works correctly, so bug was introduced in the GCC 4.5 branch (only for
-m68020/30 -m68881, -m68040 & -m68060 seems to be OK).


-- 

ami_stuff at o2 dot pl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.5 regression] FFmpeg     |[4.5 regression] m68k -
                   |crashes when converting mpg |FFmpeg crashes when
                   |to avi                      |converting mpg to avi


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug target/41311] [4.5 regression] m68k - FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
                   ` (12 preceding siblings ...)
  2010-01-02  0:42 ` [Bug target/41311] [4.5 regression] m68k - " ami_stuff at o2 dot pl
@ 2010-01-02  0:47 ` ami_stuff at o2 dot pl
  2010-01-03 13:57 ` nospamname at web dot de
  2010-01-10 11:13 ` nospamname at web dot de
  15 siblings, 0 replies; 17+ messages in thread
From: ami_stuff at o2 dot pl @ 2010-01-02  0:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from ami_stuff at o2 dot pl  2010-01-02 00:47 -------
Created an attachment (id=19441)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19441&action=view)
files


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug target/41311] [4.5 regression] m68k - FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
                   ` (13 preceding siblings ...)
  2010-01-02  0:47 ` ami_stuff at o2 dot pl
@ 2010-01-03 13:57 ` nospamname at web dot de
  2010-01-10 11:13 ` nospamname at web dot de
  15 siblings, 0 replies; 17+ messages in thread
From: nospamname at web dot de @ 2010-01-03 13:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from nospamname at web dot de  2010-01-03 13:57 -------
Can this report reopen please and target change to m68k-* ?
Bug happen also in m68k-elf.See here the two fjlt .L319 to diffrent labels.I
remove lots compiler options
to make it more simple.But ffmpeg error is same.

I try also a simple testprog, but this produce diffrent and working Code.maybe
somebody with better optimizer knowledge can modify the testprog to produce
same code and use ftst.s d0

$ make
/bernd/ffmpeg/version.sh "/bernd/ffmpeg" version.h
m68k-elf-gcc -V4.5.0 -DHAVE_AV_CONFIG_H -I. -I"/bernd/ffmpeg" -D_ISOC99_SOURCE
-
D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -S -m68020
-m
68881 -I/usr/local/amiga/m68k-amigaos/include -Wundef -O1        -MMD -MF
libavc
odec/ratecontrol.d -MT libavcodec/ratecontrol.o  -c -o libavcodec/ratecontrol.o
libavcodec/ratecontrol.c

thats the snippet from the asm file create with -S.

        .LVL554:
        fmove.s %d4,%fp1
        fmul.x %fp1,%fp0
        fmove.d %fp0,-(%sp)
        move.l %a3,-(%sp)
        move.l %a2,-(%sp)
.LCFI139:
        jsr get_qscale
.LM656:
        fmove.s %fp0,%d0
.LVL555:
.LM657:
        lea (20,%sp),%sp
        ftst.s %d0
        fjlt .L319
.LM658:
        fjlt .L310
        fslt %d0
.LVL556: 

here is snippet(amistuff upload) of m68k-amigaos with GCC 4.5.0 24. december
2009 and wrong code too

        jsr _get_qscale
        move.l d1,-(sp)
        move.l d0,-(sp)
        fmove.d (sp)+,fp0
        fmove.s fp0,d0
        lea (20,sp),sp
        ftst.s d0
        fjlt L315
        fjlt L306
        fslt d0
        extb.l d0
        neg.l d0
        move.l d0,-(sp)

        -------------

here is snippet(ami_stuff upload) with correct Code of m68k-amigaos GCC 4.5.0
24.december 2009

        jsr _get_qscale
        move.l d1,-(sp)
        move.l d0,-(sp)
        fmove.d (sp)+,fp0
        fmove.s fp0,d0
        lea (20,sp),sp
        ftst.s d0
        fjnlt L342
        fmove.s #0xbf800000,fp2
        jra L307
L342:
        ftst.s d0
        fjgt L331
        fslt d0

I now write a testprogram to reproduce the Bug.But GCC generate diffrent code
that work ok with both compilers

maybe somebody can tell how fake the optimizer to produce same code and do a
ftst.s d0 as in above Situation ?

------------

#define assert(expression)  \
  ((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))

#define __assert(expression, file, line)  \
      (printf ("%s:%u: failed assertion `%s'\n", file, line,expression),       
\
       abort(), 0)

double get_qscale(long *s, long *rce, double rate_factor, int frame_num)
{
return rate_factor*frame_num;
}

double get_diff_limited_q(long *s, long *rce, double q);

float ff_rate_estimate_qscale(double rate_factor, int picture_number)
{
long *s;
long *rce;
float q;
q= get_qscale(s, rce, rate_factor, picture_number);
        if (q < 0)
            return -1;

        assert(q>0.0);
         q = get_diff_limited_q(s, rce, q);
         assert(q>0.0);
}



int main(int argc, char **argv)
{
printf("%ld\n",ff_rate_estimate_qscale((float)argc,argc*4));
}

--------------------

link.w %fp,#0
        move.l 16(%fp),-(%sp)
        move.l 12(%fp),-(%sp)
        move.l 8(%fp),-(%sp)
        clr.l -(%sp)
        clr.l -(%sp)
        jsr get_qscale
        lea (20,%sp),%sp
        fsmove.x %fp0,%fp0
        fjnlt .L11
        fmove.s #0xbf800000,%fp0
        jra .L2
.L11:
        ftst.x %fp0
        fjgt .L5 


-- 

nospamname at web dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nospamname at web dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug target/41311] [4.5 regression] m68k - FFmpeg crashes when converting mpg to avi
  2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
                   ` (14 preceding siblings ...)
  2010-01-03 13:57 ` nospamname at web dot de
@ 2010-01-10 11:13 ` nospamname at web dot de
  15 siblings, 0 replies; 17+ messages in thread
From: nospamname at web dot de @ 2010-01-10 11:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from nospamname at web dot de  2010-01-10 11:13 -------
All GCC Versions after this Patch r146817 (Author: matz) have the Problem

http://gcc.gnu.org/ml/gcc-cvs/2009-04/msg01459.html

Here is a better testprogram that show more exact what the code do, but this
generate with all Versions correct code.seem only with speical register usage
and maybe not relatet to backend Problem come.


#define __P(protos)     protos
int      fprintf __P((unsigned long *, const char *, ...));
unsigned int * stderr;
#define assert(expression)  \
  ((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))

#define __assert(expression, file, line)  \
      (fprintf (stderr,"%s:%u: failed assertion `%s'\n", file,
line,expression),        \
       abort(), 0)

static double get_qscale(long *s, long *rce, double rate_factor, int frame_num)
{
return rate_factor*frame_num;
}

double get_diff_limited_q(long *s, long *rce, double q);

float ff_rate_estimate_qscale(double rate_factor, int picture_number)
{
long *s;
long *rce;
float q;
q= get_qscale(s, rce, rate_factor, picture_number);
        if (q < 0)
            return -1;

        assert(q>0.0);
         q = get_diff_limited_q(s, rce, q);
         assert(q>0.0);
}

int main(int argc, char **argv)
{
printf("%ld\n",ff_rate_estimate_qscale((float)argc,argc*4));
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41311


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2010-01-10 11:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] FFmpeg crashes when converting mpg to avi ami_stuff at o2 dot pl
2009-09-08 18:07 ` [Bug c/41311] " ami_stuff at o2 dot pl
2009-09-08 18:07 ` ami_stuff at o2 dot pl
2009-09-08 18:09 ` ami_stuff at o2 dot pl
2009-09-08 18:09 ` ami_stuff at o2 dot pl
2009-09-08 18:11 ` ami_stuff at o2 dot pl
2009-09-08 18:11 ` ami_stuff at o2 dot pl
2009-09-08 18:17 ` schwab at linux-m68k dot org
2009-09-08 18:36 ` ami_stuff at o2 dot pl
2009-09-09 14:55 ` nospamname at web dot de
2009-09-18  4:47 ` [Bug target/41311] " pinskia at gcc dot gnu dot org
2009-09-18  9:20 ` rguenth at gcc dot gnu dot org
2009-12-29 16:30 ` schwab at linux-m68k dot org
2010-01-02  0:42 ` [Bug target/41311] [4.5 regression] m68k - " ami_stuff at o2 dot pl
2010-01-02  0:47 ` ami_stuff at o2 dot pl
2010-01-03 13:57 ` nospamname at web dot de
2010-01-10 11:13 ` nospamname at web dot de

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).