On 5/31/19 1:56 PM, Martin Sebor wrote: > Given a poiner to array p, tree dumps for expressions like &(*p)[2] > actually show &*p[2]. That's not right -- the parentheses are > important to differentiate indexing into the array the pointer > points to from indexing into the pointer. > > The attached patch adjusts the tree pretty printer to add the parens > when the pointer points to an array. > > Tested on x86_64-linux. > > Martin > > gcc-90694.diff > > PR middle-end/90694 - incorrect representation of ADDR_EXPR involving a > pointer to array > > gcc/ChangeLog: > > PR middle-end/90694 > * tree-pretty-print.c (dump_generic_node): Add parentheses. > > gcc/testsuite/ChangeLog: > > PR middle-end/90694 > * gcc.dg/tree-ssa/dump-5.c: New test. OK. I'm going to assume that the gimple parser already does the right thing since it's supposed to already handle C expressions correctly.
Jeff