On December 23, 2015 10:39:17 AM GMT+01:00, Uros Bizjak <ubiz...@gmail.com> wrote: >Hello! > >There is a logic error in Honza's patch "Transparent alias suport part >10" [1]. The part in memrefs_conflict_p should be changed to: > >- /* If decls are different or we know by offsets that there is no >overlap, >- we win. */ >- if (!cmp || !offset_overlap_p (c, xsize, ysize)) >+ /* If decls are different and we know by offsets that >+ there is no overlap, we win. */ >+ if (!cmp && !offset_overlap_p (c, xsize, ysize)) > return 0; >- /* Decls may or may not be different and offsets overlap....*/ >+ /* Decls are different and offsets overlap....*/ > >Even if decls are different, their offsets shouldn't overlap!
Comparing offsets of different decls does not make sense. >Addresses with alignment ANDs depend on increased xsize and ysize, so >no wonder gcc fails to bootstrap on alpha. Alpha also fails to honor the C++ memory model and introduces store data races. I wonder if alpha needs to simply pad all decls appropriately. Maybe also finally time to ditch this arch (Or affected sub-arch)? Richard. > >In addition to this, the check for SYMBOL_REFs in base_alias_check >should be moved after checks for addresses. > >The patch also adds some simplification. If >symtab_address::equal_address_to returns -1 for "unknown" (as is >otherwise customary throughout the sources), we can simplify >compare_base_decls a bit. > >2015-12-23 Uros Bizjak <ubiz...@gmail.com> > > PR middle-end/68999 > * symtab.c (symtab_node::equal_address_to): Return -1 instead of 2 > if we can't determine address equivalence. > * alias.c (compare_base_decl): Update for changed return value of > symtab_node::equal_address_to. > (memrefs_conflict_p): Return 0 when decls are different > and offsets don't overlap. > (base_alias_check): Move check for addresses with alignment ANDs > before the call for compare_base_decls. > >The patch was bootstrapped and regression tested on x86_64-linux-gnu >{,-m32} and alpha-linux-gnu [2], which is a massive user of addresses >with alignment ANDs > >OK for mainline? > >[1] https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01076.html >[2] https://gcc.gnu.org/ml/gcc-testresults/2015-12/msg02372.html > >Uros.