$ ./bin/gfortran -static gcc/gcc/testsuite/gfortran.dg/pr19657.f -O2 && ./a.out $ ./bin/gfortran -static gcc/gcc/testsuite/gfortran.dg/pr19657.f -O3 gcc/gcc/testsuite/gfortran.dg/pr19657.f: In function ‘MAIN__’: gcc/gcc/testsuite/gfortran.dg/pr19657.f:11: internal compiler error: in tree_verify_flow_info, at tree-cfg.c:3716 Appeared on i386-linux, i686-freebsd and x86_64-linux between 20050615 and 20050616. Same thing happens with gfortran.dg/select_2.f90; no patch was committed in the fortran directory during these two days.
Investigating...
Confirmed. Not fixed by RTH's recent patch to fix vectorizer failures, but still most likely related to Honza's patch to kill RBI.
Honza messed up.
It happened with me on 20050618 snapshot bootstrap. It didn't happen on 20050611 stage1/xgcc -Bstage1/ -B/usr/i686-pc-linux-gnu/bin/ -c -O2 -march=pentium3 -pipe -fprofile-generate -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/gcc-4.1.0_beta20050618/work/gcc-4.1-20050618/gcc -I/var/tmp/portage/gcc-4.1.0_beta20050618/work/gcc-4.1-20050618/gcc/. -I/var/tmp/portage/gcc-4.1.0_beta20050618/work/gcc-4.1-20050618/gcc/../include -I/var/tmp/portage/gcc-4.1.0_beta20050618/work/gcc-4.1-20050618/gcc/../libcpp/include /var/tmp/portage/gcc-4.1.0_beta20050618/work/gcc-4.1-20050618/gcc/sdbout.c -o sdbout.o stage1/xgcc -Bstage1/ -B/usr/i686-pc-linux-gnu/bin/ -c -O2 -march=pentium3 -pipe -fprofile-generate -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/gcc-4.1.0_beta20050618/work/gcc-4.1-20050618/gcc -I/var/tmp/portage/gcc-4.1.0_beta20050618/work/gcc-4.1-20050618/gcc/. -I/var/tmp/portage/gcc-4.1.0_beta20050618/work/gcc-4.1-20050618/gcc/../include -I/var/tmp/portage/gcc-4.1.0_beta20050618/work/gcc-4.1-20050618/gcc/../libcpp/include /var/tmp/portage/gcc-4.1.0_beta20050618/work/gcc-4.1-20050618/gcc/simplify-rtx.c -o simplify-rtx.o /var/tmp/portage/gcc-4.1.0_beta20050618/work/gcc-4.1-20050618/gcc/simplify-rtx.c: In function 'simplify_const_binary_operation': /var/tmp/portage/gcc-4.1.0_beta20050618/work/gcc-4.1-20050618/gcc/simplify-rtx.c:2073: internal compiler error: in tree_verify_flow_info, at tree-cfg.c:3716 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugs.gentoo.org/> for instructions. make[2]: *** [simplify-rtx.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/gcc-4.1.0_beta20050618/work/build/gcc' make[1]: *** [stageprofile_build] Error 2 make[1]: Leaving directory `/var/tmp/portage/gcc-4.1.0_beta20050618/work/build/gcc' make: *** [profiledbootstrap] Error 2
Created attachment 9113 [details] Test case (needs -O3), can probably be reduced further
Subject: Re: [4.1 regression] internal compiler error: in tree_verify_flow_info Hi, this is patch I am testing... 2005-06-19 Jan Hubicka <jh@suse.cz> * cfgloop.h (DLTHE_RECORD_COPY_NUMBER): New flag. * cfgloopmanip.c (duplicate_loop_to_header_edge): Set aux flags only when asked for. * loop-unroll.c (peel_loop_completely, unroll_loop_constant_iterations, unroll_loop_runtime_iterations, peel_loop_simple, unroll_loop_stupid): Update call of duplicate_loop_to_header_edge. (apply_opt_in_copies): Clear out aux pointers. Index: cfgloop.h =================================================================== RCS file: /cvs/gcc/gcc/gcc/cfgloop.h,v retrieving revision 1.46 diff -c -3 -p -r1.46 cfgloop.h *** cfgloop.h 2 Jun 2005 10:19:12 -0000 1.46 --- cfgloop.h 19 Jun 2005 14:47:09 -0000 *************** extern bool can_duplicate_loop_p (struct *** 296,301 **** --- 296,303 ---- #define DLTHE_FLAG_UPDATE_FREQ 1 /* Update frequencies in duplicate_loop_to_header_edge. */ + #define DLTHE_RECORD_COPY_NUMBER 2 /* Record copy number in the aux + field of newly create BB. */ extern struct loop * duplicate_loop (struct loops *, struct loop *, struct loop *); Index: cfgloopmanip.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/cfgloopmanip.c,v retrieving revision 1.48 diff -c -3 -p -r1.48 cfgloopmanip.c *** cfgloopmanip.c 15 Jun 2005 23:05:19 -0000 1.48 --- cfgloopmanip.c 19 Jun 2005 14:47:09 -0000 *************** duplicate_loop_to_header_edge (struct lo *** 982,992 **** /* Copy bbs. */ copy_bbs (bbs, n, new_bbs, spec_edges, 2, new_spec_edges, loop); ! for (i = 0; i < n; i++) ! { ! gcc_assert (!new_bbs[i]->aux); ! new_bbs[i]->aux = (void *)(size_t)(j + 1); ! } /* Note whether the blocks and edges belong to an irreducible loop. */ if (add_irreducible_flag) --- 982,993 ---- /* Copy bbs. */ copy_bbs (bbs, n, new_bbs, spec_edges, 2, new_spec_edges, loop); ! if (flags & DLTHE_RECORD_COPY_NUMBER) ! for (i = 0; i < n; i++) ! { ! gcc_assert (!new_bbs[i]->aux); ! new_bbs[i]->aux = (void *)(size_t)(j + 1); ! } /* Note whether the blocks and edges belong to an irreducible loop. */ if (add_irreducible_flag) Index: loop-unroll.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/loop-unroll.c,v retrieving revision 1.34 diff -c -3 -p -r1.34 loop-unroll.c *** loop-unroll.c 15 Jun 2005 23:05:22 -0000 1.34 --- loop-unroll.c 19 Jun 2005 14:47:09 -0000 *************** peel_loop_completely (struct loops *loop *** 519,525 **** loops, npeel, wont_exit, desc->out_edge, remove_edges, &n_remove_edges, ! DLTHE_FLAG_UPDATE_FREQ); gcc_assert (ok); free (wont_exit); --- 519,527 ---- loops, npeel, wont_exit, desc->out_edge, remove_edges, &n_remove_edges, ! DLTHE_FLAG_UPDATE_FREQ ! | (opt_info ! ? DLTHE_RECORD_COPY_NUMBER : 0)); gcc_assert (ok); free (wont_exit); *************** unroll_loop_constant_iterations (struct *** 717,723 **** loops, exit_mod, wont_exit, desc->out_edge, remove_edges, &n_remove_edges, ! DLTHE_FLAG_UPDATE_FREQ); gcc_assert (ok); if (opt_info && exit_mod > 1) --- 719,728 ---- loops, exit_mod, wont_exit, desc->out_edge, remove_edges, &n_remove_edges, ! DLTHE_FLAG_UPDATE_FREQ ! | (opt_info && exit_mod > 1 ! ? DLTHE_RECORD_COPY_NUMBER ! : 0)); gcc_assert (ok); if (opt_info && exit_mod > 1) *************** unroll_loop_constant_iterations (struct *** 753,759 **** loops, exit_mod + 1, wont_exit, desc->out_edge, remove_edges, &n_remove_edges, ! DLTHE_FLAG_UPDATE_FREQ); gcc_assert (ok); if (opt_info && exit_mod > 0) --- 758,767 ---- loops, exit_mod + 1, wont_exit, desc->out_edge, remove_edges, &n_remove_edges, ! DLTHE_FLAG_UPDATE_FREQ ! | (opt_info && exit_mod > 0 ! ? DLTHE_RECORD_COPY_NUMBER ! : 0)); gcc_assert (ok); if (opt_info && exit_mod > 0) *************** unroll_loop_constant_iterations (struct *** 777,783 **** loops, max_unroll, wont_exit, desc->out_edge, remove_edges, &n_remove_edges, ! DLTHE_FLAG_UPDATE_FREQ); gcc_assert (ok); if (opt_info) --- 785,794 ---- loops, max_unroll, wont_exit, desc->out_edge, remove_edges, &n_remove_edges, ! DLTHE_FLAG_UPDATE_FREQ ! | (opt_info ! ? DLTHE_RECORD_COPY_NUMBER ! : 0)); gcc_assert (ok); if (opt_info) *************** unroll_loop_runtime_iterations (struct l *** 1097,1103 **** loops, max_unroll, wont_exit, desc->out_edge, remove_edges, &n_remove_edges, ! DLTHE_FLAG_UPDATE_FREQ); gcc_assert (ok); if (opt_info) --- 1108,1117 ---- loops, max_unroll, wont_exit, desc->out_edge, remove_edges, &n_remove_edges, ! DLTHE_FLAG_UPDATE_FREQ ! | (opt_info ! ? DLTHE_RECORD_COPY_NUMBER ! : 0)); gcc_assert (ok); if (opt_info) *************** peel_loop_simple (struct loops *loops, s *** 1274,1280 **** ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), loops, npeel, wont_exit, NULL, NULL, ! NULL, DLTHE_FLAG_UPDATE_FREQ); gcc_assert (ok); free (wont_exit); --- 1288,1297 ---- ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), loops, npeel, wont_exit, NULL, NULL, ! NULL, DLTHE_FLAG_UPDATE_FREQ ! | (opt_info ! ? DLTHE_RECORD_COPY_NUMBER ! : 0)); gcc_assert (ok); free (wont_exit); *************** unroll_loop_stupid (struct loops *loops, *** 1422,1428 **** ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop), loops, nunroll, wont_exit, NULL, NULL, NULL, ! DLTHE_FLAG_UPDATE_FREQ); gcc_assert (ok); if (opt_info) --- 1439,1448 ---- ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop), loops, nunroll, wont_exit, NULL, NULL, NULL, ! DLTHE_FLAG_UPDATE_FREQ ! | (opt_info ! ? DLTHE_RECORD_COPY_NUMBER ! : 0)); gcc_assert (ok); if (opt_info) *************** apply_opt_in_copies (struct opt_info *op *** 2064,2069 **** --- 2084,2090 ---- duplicate_loop_to_header_edge. */ delta = determine_split_iv_delta ((size_t)bb->aux, n_copies, unrolling); + bb->aux = 0; orig_insn = BB_HEAD (orig_bb); for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb)); insn = next) {
*** Bug 22122 has been marked as a duplicate of this bug. ***
See PR 22122 for C testcase and with -ftree-vectorize.
Patch was posted here: <http://gcc.gnu.org/ml/gcc-patches/2005-06/msg01649.html>.
Fixed.