Attached is another revision of a patch I posted last July to keep the pretty-printer from crashing on MEM_REFs with void* arguments: https://gcc.gnu.org/pipermail/gcc-patches/2020-July/549746.html Besides avoiding the ICE and enhancing the MEM_REF detail and improving its format, this revision implements the suggestions in that discussion. To avoid code duplication it moves the handling to the C pretty-printer and changes the C++ front end to delegate to it. In addition, it includes a cast to the accessed type if it's different from/incompatible with (according to GIMPLE) that of the dereferenced pointer, or if the object is typeless. Lastly, it replaces the in the output with either VLA names or the RHS of the GIMPLE expression (this improves the output when for dynamically allocated objects). As an aside, In my experience, MEM_REFs in warnings are limited to -Wuninitialized. I think other middle end warnings tend to avoid them. Those that involve invalid/out-of-bounds accesses replace them with either the target DECL (e.g., local variable, or FIELD_DECL), the allocation call (e.g., malloc), or the DECL of the pointer (e.g., PARM_DECL), followed by a note mentioning the offset into the object. I'd like to change -Wuninitialized at some point to follow the same style. So I see the value of the MEM_REF formatting enhancement mainly as a transient solution until that happens. Martin