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

             Bug #: 56584
           Summary: _int_free assertion failed
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: c
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: nathael.paj...@ed3l.fr


Created attachment 29633
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29633
The two preprocessed outputs, plus all the source code.

Hi,
I encountered a bug in gcc-4.7.2
It is present in both the amd64 binary package in debian SID, and in the binary
toolchain from emdebian for ARM (package gcc-4.7-arm-linux-gnueabi installed on
a debian sid amd64)

Here is the command line used :

$ arm-linux-gnueabi-gcc -MMD -MP -MF objs/./drivers/usb.d -Wall -O2 -mthumb
-mcpu=cortex-m3 -fmessage-length=0 -ffunction-sections -fdata-sections -static
-fno-builtin drivers/usb.c -c -o objs/./drivers/usb.o -Iinclude/
cc1: malloc.c:4973: _int_free: Assertion `nextchunk->fd_nextsize->bk_nextsize
== nextchunk' failed.
drivers/usb.c:71:1: internal compiler error: Abandon
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccZvTf9l.out file, please attach this to
your bugreport.
$

Compiling the same code with gcc-4.4 (still for ARM) is OK :

$ arm-linux-gnueabi-gcc-4.4 -MMD -MP -MF objs/./drivers/usb.d -Wall -O2 -mthumb
-mcpu=cortex-m3 -fmessage-length=0 -ffunction-sections -fdata-sections -static
-fno-builtin drivers/usb.c -c -o objs/./drivers/usb.o -Iinclude/
drivers/usb.c:38: warning: ‘HEXA’ defined but not used
$

The problem is also present in gcc for x86_64 (of course with a few changes in
the command line, removing -thumb and -mcpu option):

$ gcc -MMD -MP -MF objs/./drivers/usb.d -Wall -O2 -fmessage-length=0
-ffunction-sections -fdata-sections -static -fno-builtin drivers/usb.c -c -o
/dev/null -Iinclude/
cc1: malloc.c:4973: _int_free: Assertion `nextchunk->fd_nextsize->bk_nextsize
== nextchunk' failed.
drivers/usb.c:71:1: internal compiler error: Abandon
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccJok8Sc.out file, please attach this to
your bugreport.
$


Bellow are the gcc -v outputs (for the three gcc used in the examples):


$ arm-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabi/4.7/lto-wrapper
Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5'
--with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix
--with-gxx-include-dir=/usr/arm-linux-gnueabi/include/c++/4.7.2
--libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm
--enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv4t
--with-float=soft --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=arm-linux-gnueabi
--program-prefix=arm-linux-gnueabi- --includedir=/usr/arm-linux-gnueabi/include
--with-headers=/usr/arm-linux-gnueabi/include
--with-libs=/usr/arm-linux-gnueabi/lib
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5) 


$ arm-linux-gnueabi-gcc-4.4 -v
Using built-in specs.
Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.6-15'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.4 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix
--with-gxx-include-dir=/usr/arm-linux-gnueabi/include/c++/4.4.6
--libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug
--enable-objc-gc --disable-sjlj-exceptions --with-arch=armv4t --with-float=soft
--enable-checking=release --program-prefix=arm-linux-gnueabi-
--includedir=/usr/arm-linux-gnueabi/include --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=arm-linux-gnueabi
--with-headers=/usr/arm-linux-gnueabi/include
--with-libs=/usr/arm-linux-gnueabi/lib
Thread model: posix
gcc version 4.4.6 (Debian 4.4.6-15) 


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5'
--with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5) 


Thanks to all of you for your work on gcc, I hope it will help improve gcc :)
+++

Reply via email to