[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#619963: gcc-4.6: wrongly optimizes memmove() into memcpy()



Package: gcc-4.6
Version: 4.6.0-1
Severity: grave
Justification: renders package unusable


	Hello,

Trying to compile VLC media player using Debian gcc-4.6.
It turns out that the compiler is silently replacing memmove() calls
with memcpy() ones, when it is clearly NOT a legal optimization. The
issue was uncovered with valgrind. For instance, this one is failing,
even though both source and destination obviously overlap:

     memmove( &p_aout->pp_inputs[i_input], &p_aout->pp_inputs[i_input + 1],
              (AOUT_MAX_INPUTS - i_input - 1) * sizeof(aout_input_t *) );

This results in memory corruption at run-time and eventually crashes.

Compiler flags used were: -g -O2 -ffast-math -funroll-loops -fPIC
I can provide the full .i file if needed.

Best regards,

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (100, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.38-1-686 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gcc-4.6 depends on:
ii  binutils               2.21.0.20110327-1 The GNU assembler, linker and bina
ii  cpp-4.6                4.6.0-1           The GNU C preprocessor
ii  gcc-4.6-base           4.6.0-1           The GNU Compiler Collection (base 
ii  libc6                  2.11.2-11         Embedded GNU C Library: Shared lib
ii  libcloog-ppl0          0.15.9-3          the Chunky Loop Generator (runtime
ii  libgcc1                1:4.6.0-1         GCC support library
ii  libgmp10               2:5.0.1+dfsg-7    Multiprecision arithmetic library
ii  libgmpxx4ldbl          2:5.0.1+dfsg-7    Multiprecision arithmetic library 
ii  libgomp1               4.6.0-1           GCC OpenMP (GOMP) support library
ii  libmpc2                0.9-2             multiple precision complex floatin
ii  libmpfr4               3.0.0-9           multiple precision floating-point 
ii  libppl-c4              0.11.2-3          Parma Polyhedra Library (C interfa
ii  libppl9                0.11.2-3          Parma Polyhedra Library (runtime l
ii  libquadmath0           4.6.0-1           GCC Quad-Precision Math Library
ii  zlib1g                 1:1.2.3.4.dfsg-3  compression library - runtime

Versions of packages gcc-4.6 recommends:
ii  libc6-dev                     2.11.2-11  Embedded GNU C Library: Developmen

Versions of packages gcc-4.6 suggests:
pn  binutils-gold                 <none>     (no description available)
pn  gcc-4.6-doc                   <none>     (no description available)
pn  gcc-4.6-locales               <none>     (no description available)
pn  gcc-4.6-multilib              <none>     (no description available)
ii  libgcc1-dbg                   1:4.6.0-1  GCC support library (debug symbols
pn  libgomp1-dbg                  <none>     (no description available)
pn  libmudflap0-4.6-dev           <none>     (no description available)
pn  libmudflap0-dbg               <none>     (no description available)
pn  libquadmath0-dbg              <none>     (no description available)

-- no debconf information



Reply to: