https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98969
--- Comment #8 from Martin Sebor <msebor at gcc dot gnu.org> ---
For reference, this is the change I used to test the MEM_REF formatting:
diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c
index 0800f596ab1..0f47c0c286d 100644
--- a/gcc/tree-ssa-uninit.c
+++ b/gcc/tree-ssa-uninit.c
@@ -251,6 +251,9 @@ maybe_warn_operand (ao_ref &ref, gimple *stmt, tree lhs,
tree rhs,
if (TREE_NO_WARNING (rhs))
return NULL_TREE;
+ if (TREE_CODE (rhs) == MEM_REF)
+ inform (gimple_location (stmt), "MEM_REF = %qE", rhs);
+
/* Do not warn if the base was marked so or this is a
hard register var. */
tree base = ao_ref_base (&ref);
And the reduced test case (doesn't ICE with xgcc):
$ cat a.c && g++ -O2 -S -Wall a.c
void clear_bit_region (unsigned char*, unsigned, unsigned);
void verify_clear_bit_region (void)
{
unsigned char orig[3] = { 1, 1, 1 }, in[3];
__builtin_memcpy (in, orig, sizeof in);
clear_bit_region (in, 0, 3 * (8));
}
‘
during GIMPLE pass: *early_warn_uninitialized
In function ‘void verify_clear_bit_region()’:
canonical types differ for identical types ‘unsigned char [3]’ and ‘unsigned
char [3]’
8 | }
| ^
0xe61a0a comptypes(tree_node*, tree_node*, int)
/src/gcc/master/gcc/cp/typeck.c:1540
0xe61c07 same_type_ignoring_top_level_qualifiers_p(tree_node*, tree_node*)
/src/gcc/master/gcc/cp/typeck.c:1576
0xaf4fe0 cxx_types_compatible_p(tree_node*, tree_node*)
/src/gcc/master/gcc/cp/cp-objcp-common.c:123
0xf4f98e c_fold_indirect_ref_for_warn
/src/gcc/master/gcc/c-family/c-pretty-print.c:1829
0xf50695 print_mem_ref
/src/gcc/master/gcc/c-family/c-pretty-print.c:1953
0xf515bd c_pretty_printer::unary_expression(tree_node*)
/src/gcc/master/gcc/c-family/c-pretty-print.c:2171
0xbad752 dump_expr
/src/gcc/master/gcc/cp/error.c:2422
0xbb0ed8 expr_to_string(tree_node*)
/src/gcc/master/gcc/cp/error.c:3188
0xbb4ffd cp_printer
/src/gcc/master/gcc/cp/error.c:4356
0x2cba14f pp_format(pretty_printer*, text_info*)
/src/gcc/master/gcc/pretty-print.c:1475
0x2c8ffd5 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
/src/gcc/master/gcc/diagnostic.c:1244
0x2c90675 diagnostic_impl
/src/gcc/master/gcc/diagnostic.c:1406
0x2c90ad3 inform(unsigned int, char const*, ...)
/src/gcc/master/gcc/diagnostic.c:1485
0x1c107c7 maybe_warn_operand
/src/gcc/master/gcc/tree-ssa-uninit.c:255
0x1c11bf1 warn_uninitialized_vars
/src/gcc/master/gcc/tree-ssa-uninit.c:660
0x1c17374 execute_early_warn_uninitialized
/src/gcc/master/gcc/tree-ssa-uninit.c:3092
0x1c173f2 execute
/src/gcc/master/gcc/tree-ssa-uninit.c:3127
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.