https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82059

            Bug ID: 82059
           Summary: [8 Regression] ICE in dump_profile, at
                    gimple-pretty-print.c:89
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---

Starting from r249277 we ICE on:

$ cat /tmp/obstack2.i
struct a
{
  char b;
  struct a *c;
} d (), f;
void *e;
long g;
void
h ()
{
  struct a *i = 0;
  if (g)
    i = e;
  if (!i)
    d ();
  i->c = &f;
  i->b = *(char *) h;
}

$ ./gcc/xgcc -O2 -fdump-tree-all -Bgcc /tmp/obstack2.i
during GIMPLE pass: isolate-paths
dump file: obstack2.i.120t.isolate-paths

/tmp/obstack2.i: In function ‘_obstack_newchunk’:
/tmp/obstack2.i:15:6: internal compiler error: in dump_profile, at
gimple-pretty-print.c:89
 void _obstack_newchunk() {
      ^~~~~~~~~~~~~~~~~
0x623202 dump_profile
        ../../gcc/gimple-pretty-print.c:89
0x623202 dump_gimple_bb_header
        ../../gcc/gimple-pretty-print.c:2700
0x623202 gimple_dump_bb(_IO_FILE*, basic_block_def*, int, unsigned long)
        ../../gcc/gimple-pretty-print.c:2862
0x98414f dump_bb(_IO_FILE*, basic_block_def*, int, unsigned long)
        ../../gcc/cfghooks.c:276
0xd5e8c4 dump_function_to_file(tree_node*, _IO_FILE*, unsigned long)
        ../../gcc/tree-cfg.c:7766
0xc65a53 execute_function_dump
        ../../gcc/passes.c:1760
0x142333c diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        ../../gcc/diagnostic.c:963
0x142358e diagnostic_impl
        ../../gcc/diagnostic.c:1099
0x1424214 internal_error(char const*, ...)
        ../../gcc/diagnostic.c:1422
0x843bc6 fancy_abort(char const*, int, char const*)
        ../../gcc/diagnostic.c:1488
0x623202 dump_profile
        ../../gcc/gimple-pretty-print.c:89
0x623202 dump_gimple_bb_header
        ../../gcc/gimple-pretty-print.c:2700
0x623202 gimple_dump_bb(_IO_FILE*, basic_block_def*, int, unsigned long)
        ../../gcc/gimple-pretty-print.c:2862
0x98414f dump_bb(_IO_FILE*, basic_block_def*, int, unsigned long)
        ../../gcc/cfghooks.c:276
0xd5e8c4 dump_function_to_file(tree_node*, _IO_FILE*, unsigned long)
        ../../gcc/tree-cfg.c:7766
0xc65a53 execute_function_dump
        ../../gcc/passes.c:1760

I've got patch for that.

Reply via email to