When compiling the attached testcase, current trunk gcc uses all available memory on my system (4GB) and then swaps until I interrupt the process. This only happens with -O3; using -O2 works as expected. gcc 4.5 comiles the file as expected with -O3. /scratch/tmp/devel2/build.linux_gcc/libcfitsio>gcc -c -O3 -v checksum.i Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/afs/mpa/data/martin/ugcc/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /scratch/martin/gcc/configure --disable-bootstrap --enable-gold --enable-plugins --prefix=/afs/mpa/data/martin/ugcc --with-ppl=/afs/mpa/data/martin/numlibs64 --with-cloog=/afs/mpa/data/martin/numlibs64 --with-libelf=/afs/mpa/data/martin/numlibs64 --enable-languages=c++,fortran --enable-target=all --enable-checking=release Thread model: posix gcc version 4.6.0 20100609 (experimental) [trunk revision 160476] (GCC) COLLECT_GCC_OPTIONS='-c' '-O3' '-v' '-mtune=generic' '-march=x86-64' /afs/mpa/data/martin/ugcc/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/cc1 -fpreprocessed checksum.i -quiet -dumpbase checksum.i -mtune=generic -march=x86-64 -auxbase checksum -O3 -version -o /tmp/ccibJbLw.s GNU C (GCC) version 4.6.0 20100609 (experimental) [trunk revision 160476] (x86_64-unknown-linux-gnu) compiled by GNU C version 4.4.2, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1 warning: GMP header version 4.3.2 differs from library version 4.3.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU C (GCC) version 4.6.0 20100609 (experimental) [trunk revision 160476] (x86_64-unknown-linux-gnu) compiled by GNU C version 4.4.2, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1 warning: GMP header version 4.3.2 differs from library version 4.3.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: f4e23293da4cc17049a858a32373cf07 ^C /scratch/tmp/devel2/build.linux_gcc/libcfitsio>
Created attachment 20879 [details] test case
Confirmed, seems to be in if-conv. Here's a smaller test case: int ffesum (void) { int ch[4], ii, jj, kk; char asc[32]; for (ii = 0; ii < 4; ii++) { for (jj = 0; jj < 4; jj++) ch[jj] = ii; for (kk = 0; kk < 13; kk++) for (jj = 0; jj < 4; jj += 2) if ((unsigned char) ch[jj] || (unsigned char) ch[jj + 1]) ch[jj]++; for (jj = 0; jj < 4; jj++) asc[4 * jj + ii] = ch[jj]; } return asc[0]; }
It is caused by revision 159886: http://gcc.gnu.org/ml/gcc-cvs/2010-05/msg00942.html
Mine.
Patch http://gcc.gnu.org/ml/gcc-patches/2010-06/msg01155.html
Subject: Bug 44483 Author: spop Date: Fri Jun 11 18:28:17 2010 New Revision: 160625 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160625 Log: Fix PR44483: incrementally gimplify BB predicates to avoid redundant computations. 2010-06-11 Sebastian Pop <sebastian.pop@amd.com> PR middle-end/44483 * tree-if-conv.c (bb_predicate_s): New struct. (bb_predicate_p): New. (bb_has_predicate): New. (bb_predicate): New. (set_bb_predicate): New. (bb_predicate_gimplified_stmts): New. (set_bb_predicate_gimplified_stmts): New. (add_bb_predicate_gimplified_stmts): New. (init_bb_predicate): New. (free_bb_predicate): New. (is_predicated): Use bb_predicate. (add_to_predicate_list): Use bb_predicate and set_bb_predicate. (predicate_bbs): Same. Gimplify the condition of the basic blocks before processing their successors. (clean_predicate_lists): Removed. (find_phi_replacement_condition): Use bb_predicate. (process_phi_nodes): Renamed ifconvert_phi_nodes. Avoid useless computations. (insert_gimplified_predicates): New. (combine_blocks): Call insert_gimplified_predicates. (tree_if_conversion): Call free_bb_predicate instead of clean_predicate_lists. * gcc.dg/tree-ssa/pr44483.c: New. Added: trunk/gcc/testsuite/gcc.dg/tree-ssa/pr44483.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-if-conv.c
Fixed.