> On December 12, 2021 1:22:09 PM GMT+01:00, Jan Hubicka via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > >Hi, > >ipa-modref is using TBAA to disambiguate memory accesses inter-procedurally. > >This sometimes breaks programs with TBAA violations including clang with LTO. > >To workaround that one can use -fno-strict-aliasing or -fno-ipa-modref which > >are both quite big hammers. So I added -fipa-strict-aliasing patch that > >controls only the TBAA based analysis in ipa-modref while keeping all other > >optimizations. > > > >Bootstrapped/regtested x86_64-linux, will commit it shortly. > > I think at the documentation level we need to clarify that TBAA exposed by > inlining is not considered IPA. The current wording is confusing in this > regard. Or we need to somehow preserve a TBAA barrier at inline instances > (like drop all inlined refs to alias set zero)
It is what I meant by: "... and does not prevent optimization across function boundary in case function has been inlined." Perhaps I should not have packed it into single sentence "This option does not affect strict aliasing rules when optimizing memory locations originating from different functions that has been inlined together" I do not think it is practical to extend representation to handle function boundaries, but I still find this flag useful (I have it in a tree for a while) Honza