public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/42522]  New: [m68k] Wrong code generated with -O2/-O3
@ 2009-12-28 20:15 ami_stuff at o2 dot pl
  2009-12-28 20:18 ` [Bug c/42522] " 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-12-28 20:15 UTC (permalink / raw)
  To: gcc-bugs

Hi,

This is a code from "libavformat/flvdec.c":

static int flv_probe(AVProbeData *p)
{
    const uint8_t *d;

    d = p->buf;
    if (d[0] == 'F' && d[1] == 'L' && d[2] == 'V' && d[3] < 5 && d[5]==0 &&
AV_RB32(d+5)>8) {
        return AVPROBE_SCORE_MAX;
    }
    return 0;
}

When I compile FFmpeg with -O2/-O3 options, FFmpeg doesn't recognize FLV files
("Unknown format"), but when I use -O1 everything works correctly.

Here is asm output when I compile flvdec.c file with -O2:

_flv_probe:
        clr.l d0
        rts
        .even

and here when I use -O1:

_flv_probe:
        move.l 4(sp),a0
        move.l 4(a0),a0
        cmp.b #70,(a0)
        jne L3
        cmp.b #76,1(a0)
        jne L4
        cmp.b #86,2(a0)
        jne L5
        cmp.b #4,3(a0)
        jhi L6
        tst.b 5(a0)
        jne L7
        move.l 5(a0),d0
        moveq #8,d1
        cmp.l d0,d1
        jcs L8
        clr.l d0
        rts
L3:
        clr.l d0
        rts
L4:
        clr.l d0
        rts
L5:
        clr.l d0
        rts
L6:
        clr.l d0
        rts
L7:
        clr.l d0
        rts
L8:
        moveq #100,d0
        rts
        .even


I attache proprocessed files + asm output in the archive.


-- 
           Summary: [m68k] Wrong code generated with -O2/-O3
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: major
          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=42522


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

end of thread, other threads:[~2010-05-09 13:54 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-28 20:15 [Bug c/42522] New: [m68k] Wrong code generated with -O2/-O3 ami_stuff at o2 dot pl
2009-12-28 20:18 ` [Bug c/42522] " ami_stuff at o2 dot pl
2009-12-28 20:23 ` [Bug target/42522] " pinskia at gcc dot gnu dot org
2009-12-28 20:39 ` [Bug c/42522] " ami_stuff at o2 dot pl
2009-12-28 23:31 ` schwab at linux-m68k dot org
2009-12-28 23:38 ` ami_stuff at o2 dot pl
2009-12-29  1:20 ` ami_stuff at o2 dot pl
2009-12-29 11:58 ` schwab at linux-m68k dot org
2009-12-29 18:52 ` nospamname at web dot de
2009-12-31 13:35 ` nospamname at web dot de
2009-12-31 17:01 ` mikpe at it dot uu dot se
2009-12-31 17:06 ` [Bug target/42522] " jsm28 at gcc dot gnu dot org
2009-12-31 18:04 ` nospamname at web dot de
2010-01-17 22:27 ` [Bug rtl-optimization/42522] (zero_extract:SI (mem:QI) ...) misoptimized schwab at linux-m68k dot org
2010-01-17 22:35 ` schwab at linux-m68k dot org
2010-01-18 10:26 ` rguenth at gcc dot gnu dot org
2010-05-09 13:54 ` ami_stuff at o2 dot pl

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