[FFmpeg-devel] Remove some optimizations from Makefile

ami_stuff ami_stuff
Sun Aug 2 14:35:04 CEST 2009


I would like to propose remove of some optimalizations from makefile.

1. GCC 4.4.1

-O3 flag activates these optimizations:


The problematic optimization is "-funswitch-loops". When I compile FFmpeg with this flag enabled
as a result:

a) I get monstruary/slow binary generated for m68k.

* libavcodec/dsputil.o + -03 flag -> 1,18MB
* libavcodec/dsputil.o + -O2 flag -> 306KB
  + -finline-functions
  + -fpredictive-commoning
  + -fgcse-after-reload
  + -ftree-vectorize options

b) GCC 4.4.1 ICEs on "libavcodec/mpegvideo.o" because of "-funswitch-loops". Without this flag there
is no ICE at all.

2. GCC 3.4.0

-O3 flag activates -fweb optimization. This optimization produces bad result from belowe inline:

static inline int64_t MAC64(int64_t d, int a, int b)
    union { int64_t x; int hl[2]; } x = { d };
    int h, l;
    __asm__ ("muls.l %5, %2:%3   \n\t"
             "add.l  %3, %1      \n\t"
             "addx.l %2, %0      \n\t"
             : "+dm"(x.hl[0]), "+dm"(x.hl[1]),
               "=d"(h), "=&d"(l)
             : "3"(a), "dmi"(b));
    return x.x;

When I use "-fno-web" switch, inline works correctly.

First I thought this inline is supposed to work with GCC 4.x+ only, but it looks like -fweb
optimization destroyes it. Maybe Mans have GCC 3.x m68k cross-compiler installed and can test
if the same happens with GCC 3.4.1 and up to 3.4.6.


More information about the ffmpeg-devel mailing list