Hi, I have hit a ICE and could reduce it to the following minimal example: $ cat bug-demo.c int func() { return 0; } $ build-mips/gcc/cc1 -O1 -fdump-rtl-mach-slim bug-demo.c func Analyzing compilation unit Performing interprocedural optimizations <*free_lang_data> <visibility> <early_local_cleanups> <emutls> <whole-program> <ipa-profile> <inline> <pure-const> <static-var>Assembling functions: func bug-demo.c: In function ‘func’: bug-demo.c:3:1: internal compiler error: in print_pattern, at sched-vis.c:602 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. It does not happen with -fdump-rtl-mach, i.e. without slim. I could not reproduce it by passing individual "-f..." flags instead of -O2, even though the output of "--help", which mentions which flags are enabled/disabled, is identical. This is gcc-4.6 snapshot 20101225, configured using the command line: ../gcc-4.6-20101225/configure --prefix=$PWD/../install --disable-bootstrap --disable-multilib --enable-stage1-languages=c --disable-lib{gcj,ada,ssp,mudflap,gomp} --enable-languages=c --target=mips-linux Thanks, Joachim
Confirmed. This is because we deliberately abort on SEQUENCEs here since 2002 (rev. 54497) because of: 2002-06-05 David S. Miller <davem@redhat.com> Delete SEQUENCE rtl usage outside of reorg and ssa passes. So either we reinstate the hunk deleted back there like with patch below, or we document that slim dumps cannot be requested for machine reorg and later passes. diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c index 25a0b60..331ccbf 100644 --- a/gcc/sched-vis.c +++ b/gcc/sched-vis.c @@ -599,8 +599,19 @@ print_pattern (char *buf, const_rtx x, int verbose) } break; case SEQUENCE: - /* Should never see SEQUENCE codes until after reorg. */ - gcc_unreachable (); + { + int i; + + sprintf (t1, "%%{"); + for (i = 0; i < XVECLEN (x, 0); i++) + { + print_insn (t2, XVECEXP (x, 0, i), verbose); + sprintf (t3, "%s%s;", t1, t2); + strcpy (t1, t3); + } + sprintf (buf, "%s%%}", t1); + } + break; case ASM_INPUT: sprintf (buf, "asm {%s}", XSTR (x, 0)); break;
Accidentally fixed for GCC 4.8 by r190133. (http://gcc.gnu.org/viewcvs?view=revision&revision=190113)