https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84362
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> --- Author: rguenth Date: Thu Dec 20 11:39:59 2018 New Revision: 267296 URL: https://gcc.gnu.org/viewcvs?rev=267296&root=gcc&view=rev Log: 2018-12-20 Richard Biener <rguent...@suse.de> PR tree-optimization/84362 * tree-ssa-loop-im.c: Include alias.h, builtins.h and tree-dfa.h. (struct im_mem_ref): add ref_canonical flag. (struct mem_ref_hasher): Use ao_ref as compare_type. (mem_ref_hasher::equal): Adjust and add variant comparing ao_ref parts. (mem_ref_alloc): Take ao_ref parameter, initialize ref_canonical member. (gather_mem_refs_stmt): Set up ao_ref early and do the lookup using it. If we have non-equal refs canonicalize the one in the hashtable used for insertion. (tree_ssa_lim_initialize): Adjust. * g++.dg/vect/pr84362.cc: New testcase. Added: trunk/gcc/testsuite/g++.dg/vect/pr84362.cc Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-loop-im.c