------- Comment #3 from markwright at internode dot on dot net 2007-07-17 07:14 ------- Created an attachment (id=13929) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13929&action=view) Proposed patch for bug 32787
The proposed patch compiles with Sun Studio 12. I wrote the following little test program: goanna% cat ../../gcc/config/i386/test_host_detect_local_cpu.c #include <stdio.h> #include <string.h> #include <malloc.h> #include <stdlib.h> #include "config.h" #include "system.h" #include "coretypes.h" #include "tm.h" const char *host_detect_local_cpu (int argc, const char **argv); int main(int argc, char **argv) { const char *bargv[1] = { "arch" }; const char *local_cpu = host_detect_local_cpu (1, bargv); printf("%s\n", local_cpu); return 0; } void fancy_abort(const char *a, int b, const char *c) { abort(); } goanna% Compiling it with Sun Studio 12 give the following result: goanna% /opt/SunStudio12/SUNWspro/bin/cc -c -errtags=yes +w -g -DIN_GCC -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I./../intl -I../../gcc/../libcpp/include -I../../gcc/../libdecnumber -I../libdecnumber -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I./../intl -I../../gcc/../libcpp/include -I../../gcc/../libdecnumber -I../libdecnumber ../../gcc/config/i386/test_host_detect_local_cpu.c goanna% /opt/SunStudio12/SUNWspro/bin/cc -c -errtags=yes +w -g -DIN_GCC -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I./../intl -I../../gcc/../libcpp/include -I../../gcc/../libdecnumber -I../libdecnumber -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I./../intl -I../../gcc/../libcpp/include -I../../gcc/../libdecnumber -I../libdecnumber ../../gcc/config/i386/driver-i386.c "../../gcc/config/i386/driver-i386.c", line 126: warning: integer overflow detected: op "<<" (E_INTEGER_OVERFLOW_DETECTED) goanna% cc -o t driver-i386.o test_host_detect_local_cpu.o ../libcpp/libcpp.a ./../intl/libintl.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a goanna% ./t -march=k8 goanna% After applying the patch, the gcc build with Sun Studio 12 then fails due to following Sun Studio 12 bug (Sun intend to patch this soon, and this Sun Studio 12 bug 6470247 has nothing to do with this gcc patch): http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6470247 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32787