On Tue, 20 Sep 2016, Doug Gilmore wrote: > It looks like the original message was dropped, resending. > > Doug > ________________________________________ > From: Doug Gilmore > Sent: Tuesday, September 20, 2016 2:12 PM > To: gcc-patches@gcc.gnu.org; rgue...@gcc.gnu.org > Subject: [PATCH] Fix PR tree-optimization/77654 > > From: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77654 > > Richard Biener wrote: > > Looks good though addr_base should always be a pointer but it might > > not be an SSA name so better check that... > > I took a look at other situations where duplicate_ssa_name_ptr_info() > is called and found that there are no checks for the SSA name since > that check is done in duplicate_ssa_name_ptr_info(). Do you still > want the additional check added?
It checks for !ptr_info but it requires NAME to be an SSA name. >From the attachment in bugzilla (the attachment didn't make it here) + + if (POINTER_TYPE_P (TREE_TYPE (addr_base))) + { + duplicate_ssa_name_ptr_info (addr, SSA_NAME_PTR_INFO (addr_base)); + /* As this isn't a plain copy we have to reset alignment + information. */ + if (SSA_NAME_PTR_INFO (addr)) + mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (addr)); + } + I was talking about changing the if to if (TREE_CODE (addr_base) == SSA_NAME && TREE_CODE (addr) == SSA_NAME) because the addresses could be invariant as far as I can see. > Also does it make sense to make a test case for this? I'm not sure how to easily test this. Richard. > I was thinking of making the following change to: > > diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c > index 8051a66..b799c43 100644 > --- a/gcc/tree-ssa-alias.c > +++ b/gcc/tree-ssa-alias.c > @@ -296,7 +296,16 @@ ptr_derefs_may_alias_p (tree ptr1, tree ptr2) > pi1 = SSA_NAME_PTR_INFO (ptr1); > pi2 = SSA_NAME_PTR_INFO (ptr2); > if (!pi1 || !pi2) > - return true; > + { > + if (dump_file) > + { > + if (! pi1) > + fprintf (dump_file, "%s pi1 is NULL\n", __FUNCTION__); > + if (! pi2) > + fprintf (dump_file, "%s pi2 is NULL\n", __FUNCTION__); > + } > + return true; > + } > > Then when compiling the test case, we could scan for the RE > "pi. is NULL" in the dump file created by compiling with -fdump-rtl-sched2. > > I attached the original patch. > > Thanks, > > Doug > > gcc/ > PR tree-optimization/77654 > * tree-ssa-alias.c (issue_prefetch_ref): Add call > to duplicate_ssa_name_ptr_info. > > -- Richard Biener <rguent...@suse.de> SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)