Avoid a couple more ICEs in print_mem_ref (PR c/98597).
authorMartin Sebor <msebor@redhat.com>
Tue, 12 Jan 2021 19:58:27 +0000 (12:58 -0700)
committerMartin Sebor <msebor@redhat.com>
Tue, 12 Jan 2021 20:03:00 +0000 (13:03 -0700)
commit5a9cfad2de92f2d65585774acb524b3fa17621b5
tree2466054153dcd0396ea2b4d4b5918849c0ddfdc8
parent728fee7a7980addedfdb48e6dbcedc60054974f0
Avoid a couple more ICEs in print_mem_ref (PR c/98597).

Resolves:
PR c/98597 - ICE in -Wuninitialized printing a MEM_REF
PR c/98592 - ICE in gimple_canonical_types_compatible_p while formatting

gcc/c-family/ChangeLog:

PR c/98597
PR c/98592
* c-pretty-print.c (print_mem_ref): Avoid assuming MEM_REF operand
has pointer type.  Remove redundant code.  Avoid calling
gimple_canonical_types_compatible_p.

gcc/testsuite/ChangeLog:

PR c/98597
PR c/98592
* g++.dg/warn/Wuninitialized-13.C: New test.
 gcc.dg/uninit-39.c: New test.

#
gcc/c-family/c-pretty-print.c
gcc/testsuite/g++.dg/warn/Wuninitialized-13.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/uninit-39.c [new file with mode: 0644]