public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nospamname at web dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/41311] [4.5 regression] m68k - FFmpeg crashes when converting mpg to avi
Date: Sun, 03 Jan 2010 13:57:00 -0000	[thread overview]
Message-ID: <20100103135709.22882.qmail@sourceware.org> (raw)
In-Reply-To: <bug-41311-17839@http.gcc.gnu.org/bugzilla/>



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


  parent reply	other threads:[~2010-01-03 13:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-08 18:04 [Bug c/41311] New: [4.5 regression] " 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 [this message]
2010-01-10 11:13 ` nospamname at web dot de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100103135709.22882.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).