This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/41311] [4.5 regression] m68k - FFmpeg crashes when converting mpg to avi



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]