On Mon, Jun 3, 2019 at 10:57 AM Jakub Jelinek <ja...@redhat.com> wrote: > > On Mon, Jun 03, 2019 at 10:36:42AM +0200, Richard Biener wrote: > > > To avoid this confusion the attached patch adds to the dump > > > a cast to the MEM_REF type for accesses whose size is not equal > > > to the size of the operand (when the sizes are the same no new > > > cast is prepended). The effect is that with store merging in > > > effect, the dump for the above becomes > > > > > > MEM[(short int *)(char *)&a] = 1; > > > > I think this is confusing syntax. Iff you absolutely refuse to > > make the -gimple dump the default for MEM_REF and you insist > > on fixing this issue then please follow how we dump VIEW_CONVERT_EXPR > > which is the only other tree code we dump the access type, thus > > I must say I prefer the current MEM[ over the -gimple for human readable > dumps.
Sure, but then why ask for all information to be present when in the cases you are curious you can look at -gimple dumps? A similar thing I've hacked the pretty printer locally for debugging in the past is alignment info. > > MEM<short int *>[(char *)&a] = 1; > > Wouldn't that be > MEM<short int>[(char *)&a] instead? Err, yes. > Couldn't we do it only if the TREE_TYPE (TREE_TYPE (TREE_OPERAND (mem, 1))) > is not compatible with TREE_TYPE (mem), so keep what we were doing in most > cases? We could. Like we dump MEM_REF as * in some cases. The question is still why fix things half-way if a complete solution is already there? Btw, VIEW_CONVERT dumping uses () instead of [], that I used [] when I introduced MEM_REF was probably a mistake... Is it just the parens kind you dislike? Richard. > > Jakub