Bug 43771 - [4.5/4.6 Regression] ICE on valid when compiling ParMetis with gcc 4.5.0 and -O3
Summary: [4.5/4.6 Regression] ICE on valid when compiling ParMetis with gcc 4.5.0 and -O3
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: 4.5.1
Assignee: Ira Rosen
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2010-04-16 21:00 UTC by Martin Audet
Modified: 2010-04-19 07:48 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-04-18 08:12:31


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Audet 2010-04-16 21:00:14 UTC
The following inocent looking C function:

void KWayNodeRefine__(int nparts, int *gpwgts, int *badminpwgt, int *badmaxpwgt)
{
   int i;

   for (i=0; i<nparts; i+=2) {
       badminpwgt[i] = badminpwgt[i+1] = gpwgts[i]+gpwgts[i+1];
       badmaxpwgt[i] = badmaxpwgt[i+1] = gpwgts[i]+gpwgts[i+1];
   }
}

when compiled with gcc 4.5.0 generate an internal compiler error:

[audet@mc1 experiences]$ g++ -O3 -c nr.c
nr.c: In function 'void KWayNodeRefine__(int, int*, int*, int*)':
nr.c:2:6: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[audet@mc1 experiences]$

Note that there is no such error with -O2 or without options or when gcc 4.4.2 is used. Note also that the code above originate from ParMetis (parallel graph partitionner). I simplified it the most I could (and I think we cannot simplify it further to still triger the gcc ICE).

Now here are some information about my system:
[audet@mc1 experiences]$ gcc --version
gcc (GCC) 4.5.0
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[audet@mc1 experiences]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/publique/gcc45/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.5.0/configure --prefix=/usr/local/gcc45 --enable-shared --enable-threads=posix --with-system-zlib --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-2.4.2 --with-mpc=/usr/local/mpc-0.8.1 --with-ppl=/usr/local/ppl-0.10.2 --with-cloog=/usr/local/cloog-ppl-0.15.9 --with-libelf=/usr/local/libelf-0.8.12 --enable-__cxa_atexit --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.5.0 (GCC)
[audet@mc1 experiences]$ uname -a
Linux mc1 2.6.22.9-91.fc7 #1 SMP Thu Jun 18 16:01:22 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
[audet@mc1 experiences]$

As you can see my system uses Fedora Linux 7 distribution. gcc was compiled and tested (make -k check) this morning on this machine. Only a small fraction of the tests failled.

Regards,
Comment 1 Andrew Pinski 2010-04-16 21:16:37 UTC
Confirmed, it is crashing in the vectorizer (vect_analyze_slp).
Comment 2 Wolfgang Bangerth 2010-04-17 02:55:20 UTC
Ouch. ParMetis is one of the most widely used libraries in the
parallel scientific computing area...
Comment 3 H.J. Lu 2010-04-17 04:00:30 UTC
It is caused by revision 154667:

http://gcc.gnu.org/ml/gcc-cvs/2009-11/msg00890.html
Comment 4 irar 2010-04-18 12:20:50 UTC
Subject: Bug 43771

Author: irar
Date: Sun Apr 18 12:20:34 2010
New Revision: 158484

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158484
Log:

	PR tree-optimization/43771
	* tree-vect-slp.c (vect_supported_load_permutation_p): Check that
	load permutation doesn't have gaps.


Added:
    trunk/gcc/testsuite/g++.dg/vect/pr43771.cc
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-slp.c

Comment 5 irar 2010-04-19 06:02:45 UTC
Subject: Bug 43771

Author: irar
Date: Mon Apr 19 06:02:27 2010
New Revision: 158503

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158503
Log:

	PR tree-optimization/43771
	* tree-vect-slp.c (vect_supported_load_permutation_p): Check that
	load permutation doesn't have gaps.


Added:
    branches/gcc-4_5-branch/gcc/testsuite/g++.dg/vect/pr43771.cc
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_5-branch/gcc/tree-vect-slp.c

Comment 6 irar 2010-04-19 06:18:18 UTC
Subject: Bug 43771

Author: irar
Date: Mon Apr 19 06:17:56 2010
New Revision: 158504

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158504
Log:

	PR tree-optimization/43771
	* tree-vect-analyze.c (vect_supported_load_permutation_p): Check
	that load permutation doesn't have gaps.


Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/vect/pr43771.cc
Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_4-branch/gcc/tree-vect-analyze.c

Comment 7 Ira Rosen 2010-04-19 07:48:10 UTC
Fixed on 4.6, 4.5 and 4.4.