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.
> MEM<short int *>[(char *)&a] = 1;
Wouldn't that be
MEM<short int>[(char *)&a] instead?
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?
Jakub