Use attached preprocessed file com_mpi.c, which is extracted from SPEC mpi 2007. Then with gcc 4.4.0: gcc -c com_mpi.c -O3 com_mpi.c:1215: warning: conflicting types for built-in function âcexpâ com_mpi.c:1216: warning: conflicting types for built-in function âclogâ com_mpi.c:1217: warning: conflicting types for built-in function âcsqrtâ com_mpi.c:4906: internal compiler error: in build_function_type_skip_args, at tree.c:5954 Please submit a full bug report, with preprocessed source if appropriate. -O2 is fine. gcc 4.1.2 -O3 is fine. Verbose: Target: x86_64-unknown-linux-gnu Configured with: /net/hs-usca-01.sfbay/export/home1/12/dgh/gnu-linux/gcc-4.4.0/configure --prefix=/net/hs-usca-01.sfbay/export/home1/12/dgh/gnu-linux/local --exec-prefix=/net/hs-usca-01.sfbay/export/home1/12/dgh/gnu-linux/local --enable-languages=c++,fortran --with-gmp-include=/net/hs-usca-01.sfbay/export/home1/12/dgh/gnu-linux/local/include --with-mpfr-include=/net/hs-usca-01.sfbay/export/home1/12/dgh/gnu-linux/local/include --with-gmp-lib=/net/hs-usca-01.sfbay/export/home1/12/dgh/gnu-linux/local/lib64 --with-mpfr-lib=/net/hs-usca-01.sfbay/export/home1/12/dgh/gnu-linux/local/lib64 Thread model: posix gcc version 4.4.0 (GCC) COLLECT_GCC_OPTIONS='-c' '-O3' '-v' '-mtune=generic' /home/dgh/gnu-linux/local/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.4.0/cc1 -quiet -v -iprefix /home/dgh/gnu-linux/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.0/ com_mpi.c -quiet -dumpbase com_mpi.c -mtune=generic -auxbase com_mpi -O3 -version -o /tmp/ccYOwHWM.s ignoring nonexistent directory "/home/dgh/gnu-linux/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../x86_64-unknown-linux-gnu/include" ignoring duplicate directory "/home/dgh/gnu-linux/local/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.4.0/include" ignoring duplicate directory "/home/dgh/gnu-linux/local/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.4.0/include-fixed" ignoring nonexistent directory "/home/dgh/gnu-linux/local/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /home/dgh/gnu-linux/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.0/include /home/dgh/gnu-linux/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.0/include-fixed /usr/local/include /home/dgh/gnu-linux/local/bin/../lib/gcc/../../include /usr/include End of search list. GNU C (GCC) version 4.4.0 (x86_64-unknown-linux-gnu) compiled by GNU C version 4.4.0, GMP version 4.3.1, MPFR version 2.4.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 3d0e0887103ac420bddd7fc530a7193e com_mpi.c:1215: warning: conflicting types for built-in function âcexpâ com_mpi.c:1216: warning: conflicting types for built-in function âclogâ com_mpi.c:1217: warning: conflicting types for built-in function âcsqrtâ com_mpi.c:4906: internal compiler error: in build_function_type_skip_args, at tree.c:5954 Please submit a full bug report, with preprocessed source if appropriate. gcc 4.1.2 --verbose: Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux Thread model: posix gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)
Created attachment 18215 [details] preprocessed source file com_mpi.c to display bug
Reducing. The trunk seems to work, -O2 -fipa-cp-clone is enough to trigger it (thus, -fno-ipa-cp-clone or -fno-ipa-cp is a workaround).
Reduced testcase: typedef struct ompi_communicator_t *MPI_Comm; void err_func(MPI_Comm *comm, int *stat, ...) { int len; char err_string[256]; MPI_Error_string(*stat, err_string, &len); } static MPI_Comm comm; static int flag; void fixup_ranks(int n) { err_func(&comm, &flag); }
The assert doesn't make any sense.
Patch posted: http://gcc.gnu.org/ml/gcc-patches/2009-07/msg01116.html
Subject: Bug 40792 Author: jakub Date: Mon Jul 20 14:38:46 2009 New Revision: 149822 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149822 Log: PR tree-optimization/40792 * tree.c (build_function_type_skip_args): Remove bogus assert. * gcc.dg/pr40792.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr40792.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree.c
Subject: Bug 40792 Author: jakub Date: Mon Jul 20 14:39:32 2009 New Revision: 149823 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149823 Log: PR tree-optimization/40792 * tree.c (build_function_type_skip_args): Remove bogus assert. * gcc.dg/pr40792.c: New test. Added: branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr40792.c Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/testsuite/ChangeLog branches/gcc-4_4-branch/gcc/tree.c
Fixed.