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 c/15517] New: -O2 and higher removes some static const


The problem arises with ffmpeg/libavcodec (no version known) included in
transcode 0.6.11 (http://www.theorie.physik.uni-goettingen.de/~ostreich/transcode/)


# Cmdline triggering the bug (sources configured with a plain ./configure)

/tmp/gcc/transcode-0.6.11/ffmpeg/libavcodec>  gcc -DHAVE_CONFIG_H -I../.. -I.
-I../.. -I. -I../../    -O2 -g -Wall -ffast-math  -DARCH_X86 -DHAVE_MMX
-DHAVE_AV_CONFIG_H -D_GNU_SOURCE --include=../av_config.h -g -O3 -O3
-fomit-frame-pointer -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 -MT dsputil_mmx.o -MD -MP -MF ".deps/dsputil_mmx.Tpo"  -c
-o dsputil_mmx.o `test -f 'i386/dsputil_mmx.c' || echo './'`i386/dsputil_mmx.c;

# Compiler output
i386/dsputil_mmx_rnd.h:362: warning: `avg_no_rnd_pixels8_l2_mmx' defined but not
used
i386/dsputil_mmx_rnd.h:409: warning: `avg_no_rnd_pixels16_l2_mmx' defined but
not used
i386/dsputil_mmx_avg.h:57: warning: `put_pixels8_l2_3dnow' defined but not used
i386/dsputil_mmx_avg.h:129: warning: `put_pixels16_l2_3dnow' defined but not used
i386/dsputil_mmx_avg.h:57: warning: `put_pixels8_l2_mmx2' defined but not used
i386/dsputil_mmx_avg.h:129: warning: `put_pixels16_l2_mmx2' defined but not used


# That's the code
/tmp/gcc/transcode-0.6.11/ffmpeg/libavcodec> grep ff_pw_.. i386/dsputil_mmx.c |
grep static
static const uint64_t ff_pw_20 __attribute__ ((aligned(8))) = 0x0014001400140014ULL;
static const uint64_t ff_pw_3  __attribute__ ((aligned(8))) = 0x0003000300030003ULL;
static const uint64_t ff_pw_16 __attribute__ ((aligned(8))) = 0x0010001000100010ULL;
static const uint64_t ff_pw_15 __attribute__ ((aligned(8))) = 0x000F000F000F000FULL;


# That's what's missing
/tmp/gcc/transcode-0.6.11/ffmpeg/libavcodec> nm dsputil_mmx.o | grep ff_pw
00000008 r ff_pw_15
00000000 r ff_pw_16
         U ff_pw_20
         U ff_pw_3


Resolution:
-----------
Replace -O2 and -O3 by -O1


Versions etc.:
--------------
# gcc -v

Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.3/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man
--enable-languages=c,c++,f77,objc,java,ada --disable-checking --libdir=/usr/lib
--enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib
--with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.3 (SuSE Linux)

# Distribution: SuSE 9.1

# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz
stepping        : 7
cpu MHz         : 1998.497
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid
bogomips        : 3956.73

-- 
           Summary: -O2 and higher removes some static const
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: td at pre-secure dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: (?) i586-suse-linux
  GCC host triplet: i586-suse-linux
GCC target triplet: i586-suse-linux


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


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