Bug 40792 - [4.4 Regression] internal error in com_mpi.c at -O3 for gcc 4.4.0
Summary: [4.4 Regression] internal error in com_mpi.c at -O3 for gcc 4.4.0
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.1
Assignee: Jakub Jelinek
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2009-07-17 21:09 UTC by David Hough
Modified: 2009-07-20 15:39 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.3.3 4.4.1 4.5.0
Known to fail: 4.4.0
Last reconfirmed: 2009-07-20 09:14:59


Attachments
preprocessed source file com_mpi.c to display bug (31.80 KB, text/plain)
2009-07-17 21:11 UTC, David Hough
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Hough 2009-07-17 21:09:12 UTC
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)
Comment 1 David Hough 2009-07-17 21:11:26 UTC
Created attachment 18215 [details]
preprocessed source file com_mpi.c to display bug
Comment 2 Richard Biener 2009-07-17 21:37:34 UTC
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).
Comment 3 Richard Biener 2009-07-17 21:41:15 UTC
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);
}
Comment 4 Jakub Jelinek 2009-07-20 09:14:59 UTC
The assert doesn't make any sense.
Comment 5 Jakub Jelinek 2009-07-20 09:44:29 UTC
Patch posted: http://gcc.gnu.org/ml/gcc-patches/2009-07/msg01116.html
Comment 6 Jakub Jelinek 2009-07-20 14:38:59 UTC
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

Comment 7 Jakub Jelinek 2009-07-20 14:39:42 UTC
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

Comment 8 Jakub Jelinek 2009-07-20 14:40:32 UTC
Fixed.