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/20126] New: Inlined memcmp makes one argument null on entry


Hi, I found out a compiler bug triggered by compiling Python 2.3 with GCC 4.0
"pre5." I've been able to track it down to a small fragment which I'll attach
below. The bug is a regression as GCC 3.4.4 20050203 produces a working application.

This is the compiler's output and compilation command-line:
Using built-in specs.
Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada
--prefix=/usr --libexecdir=/usr/lib --enable-shared --with-system-zlib
--enable-nls --enable-threads=posix --without-included-gettext
--program-suffix=-4.0 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt
--enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm
--enable-java-awt=gtk --enable-mpfr x86_64-linux
Thread model: posix
gcc version 4.0.0 20050125 (experimental) (Debian 4.0-0pre5.0.0.1.gcc4)
 /usr/lib/gcc/x86_64-linux/4.0.0/cc1 -E -quiet -v ptest.c -mtune=k8 -Wall
-Wstrict-prototypes -O3 -fpch-preprocess -o ptest.i
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux/4.0.0/../../../../x86_64-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/x86_64-linux/4.0.0/include
 /usr/include
End of search list.
 /usr/lib/gcc/x86_64-linux/4.0.0/cc1 -fpreprocessed ptest.i -quiet -dumpbase
ptest.c -mtune=k8 -auxbase ptest -O3 -Wall -Wstrict-prototypes -version -o ptest.s
GNU C version 4.0.0 20050125 (experimental) (Debian 4.0-0pre5.0.0.1.gcc4)
(x86_64-linux)
        compiled by GNU C version 4.0.0 20050125 (experimental) (Debian
4.0-0pre5.0.0.1.gcc4).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
 as -V -Qy --64 -o ptest.o ptest.s
GNU ensamblador versión 2.15 (x86_64-linux) utilizando BFD versión 2.15
 /usr/lib/gcc/x86_64-linux/4.0.0/collect2 --eh-frame-hdr -m elf_x86_64
-dynamic-linker /lib/ld-linux-x86-64.so.2 -o ptest
/usr/lib/gcc/x86_64-linux/4.0.0/../../../../lib64/crt1.o
/usr/lib/gcc/x86_64-linux/4.0.0/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-linux/4.0.0/crtbegin.o -L/usr/lib/gcc/x86_64-linux/4.0.0
-L/usr/lib/gcc/x86_64-linux/4.0.0
-L/usr/lib/gcc/x86_64-linux/4.0.0/../../../../lib64
-L/usr/lib/gcc/x86_64-linux/4.0.0/../../.. -L/lib/../lib64 -L/usr/lib/../lib64
ptest.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s
--no-as-needed /usr/lib/gcc/x86_64-linux/4.0.0/crtend.o
/usr/lib/gcc/x86_64-linux/4.0.0/../../../../lib64/crtn.o

In case the information is ambiguous, the compiler is a 64-bit binary generating
64-bit binaries.

Please check http://lists.debian.org/debian-amd64/2005/02/msg00505.html for some
comments I wrote on the relevant assembly output.

-- 
           Summary: Inlined memcmp makes one argument null on entry
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jkohen at users dot sourceforge dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: x86_64-linux
  GCC host triplet: x86_64-linux
GCC target triplet: x86_64-linux


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


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