[Bug tree-optimization/98597] New: [11 Regression] ICE in print_mem_ref since r11-6508-gabb1b6058c09a7c0

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jan 8 08:20:37 GMT 2021


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

            Bug ID: 98597
           Summary: [11 Regression] ICE in print_mem_ref since
                    r11-6508-gabb1b6058c09a7c0
           Product: gcc
           Version: 11.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
                CC: msebor at gcc dot gnu.org
  Target Milestone: ---

One more ICE I found:

$ cat x.C
struct shared_count {
  shared_count() {}
  shared_count(shared_count &r) : pi(r.pi) {}
  int pi;
};
struct shared_ptr {
  int ptr;
  shared_count refcount;
};
struct Bar {
  Bar(int, shared_ptr);
};
void g() {
  shared_ptr foo;
  Bar(0, foo);
}

$ g++ x.C -O2 -Wuninitialized -c
In copy constructor ‘shared_ptr::shared_ptr(shared_ptr&)’,
    inlined from ‘void g()’ at x.C:15:13:
x.C:6:8: warning: ‘foo.shared_ptr::ptr’ is used uninitialized [-Wuninitialized]
    6 | struct shared_ptr {
      |        ^~~~~~~~~~
x.C: In function ‘void g()’:
x.C:14:14: note: ‘foo’ declared here
   14 |   shared_ptr foo;
      |              ^~~
‘
during GIMPLE pass: uninit
Segmentation fault
   13 | void g() {
      |      ^
0x10bf64f crash_signal
        /home/marxin/Programming/gcc/gcc/toplev.c:327
0xbc57bc print_mem_ref
        /home/marxin/Programming/gcc/gcc/c-family/c-pretty-print.c:1851
0x9c4b2f dump_expr
        /home/marxin/Programming/gcc/gcc/cp/error.c:2366
0x9c97d0 expr_to_string(tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/error.c:3187
0x9c9f0c cp_printer
        /home/marxin/Programming/gcc/gcc/cp/error.c:4355
0x1c30a8c pp_format(pretty_printer*, text_info*)
        /home/marxin/Programming/gcc/gcc/pretty-print.c:1475
0x1c148e6 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        /home/marxin/Programming/gcc/gcc/diagnostic.c:1216
0x1c16e48 diagnostic_impl
        /home/marxin/Programming/gcc/gcc/diagnostic.c:1366
0x1c16e48 warning_at(unsigned int, int, char const*, ...)
        /home/marxin/Programming/gcc/gcc/diagnostic.c:1503
0x12d0e16 maybe_warn_operand
        /home/marxin/Programming/gcc/gcc/tree-ssa-uninit.c:418
0x12d423f warn_uninitialized_vars
        /home/marxin/Programming/gcc/gcc/tree-ssa-uninit.c:657
0x12d83f2 execute
        /home/marxin/Programming/gcc/gcc/tree-ssa-uninit.c:3019
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


More information about the Gcc-bugs mailing list