bootstrap failure while compiling gcc/tree.c

Brian Sidebotham micros@valvers.com
Thu Aug 23 15:03:00 GMT 2007


Brian Sidebotham wrote:
> ../../gcc/gcc/tree.c: In function "build_string":
> ../../gcc/gcc/tree.c:1197: internal compiler error: in 
> iterative_hash_expr, at tree.c:4189
> Please submit a full bug report,
> with preprocessed source if appropriate.
> 
> I have placed the pre-processed file here:
> http://www.valvers.com/gcc/arm-elf/tree.i (1.5Mb)
> 
> The following configure line was used:
> 
> ../gcc/configure --target=arm-elf --prefix=${installdir} --with-newlib 
> --with-headers=${newlibdir}/src/newlib/libc/include 
> --enable-languages=c,c++ --enable-interwork --enable-multilib
> 
> codebase is svn revision 127732
> 
> The failing command line is:
> 
> gcc -c   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall 
> -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes 
> -Wold-style-definition -Wmissing-format-attribute -fno-common   
> -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. 
> -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include 
> -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd 
> -I../libdecnumber    ../../gcc/gcc/tree.c -o tree.o
> 
> and lastly, the specs of the gcc compiler being used are:
> 
> Using built-in specs.
> Target: i486-linux-gnu
> Configured with: ../src/configure -v 
> --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr 
> --enable-shared --with-system-zlib --libexecdir=/usr/lib 
> --without-included-gettext --enable-threads=posix --enable-nls 
> --program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu 
> --enable-libstdcxx-debug --enable-java-awt=gtk-default 
> --enable-gtk-cairo 
> --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre 
> --enable-mpfr --disable-werror --with-tune=pentium4 
> --enable-checking=release i486-linux-gnu
> Thread model: posix
> gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
> 

These are the two lines that fail:

tree.c:1197: memcpy (CONST_CAST (TREE_STRING_POINTER (s)), str, len);
   memcpy (((__extension__(union {__typeof(((const char *)(STRING_CST_CHECK 
(s)->string.str)))_q; void *_v;})(((const char *)(STRING_CST_CHECK 
(s)->string.str))))._v), str, len);

tree.c:1198: ((char *) CONST_CAST (TREE_STRING_POINTER (s)))[len] = '\0';
   ((char *) ((__extension__(union {__typeof(((const char *)(STRING_CST_CHECK 
(s)->string.str)))_q; void *_v;})(((const char *)(STRING_CST_CHECK 
(s)->string.str))))._v))[len] = '\0';

Removing the CONST_CAST delcarlations allows compilation of gcc to complete with 
a warning (as expected)

../../gcc/gcc/tree.c: In function 'build_string':
../../gcc/gcc/tree.c:1197: warning: passing argument 1 of âmemcpyâ discards 
qualifiers from pointer target type

Best Regards,

Brian Sidebotham.



More information about the Gcc mailing list