Re: Terminate BB analysis on NULL pointer access in ipa-pure-const and ipa-modref

2021-12-13 Thread Jeff Law via Gcc-patches
On 12/12/2021 12:57 PM, Jan Hubicka wrote: On 12/12/2021 3:49 AM, Jan Hubicka via Gcc-patches wrote: Hi, As discussed in the PR, we miss some optimization becuase gimple-ssa-isolate-paths turns NULL memory accesses to volatile and adds __builtin_trap after them. This is seen as a side-effec

Re: Terminate BB analysis on NULL pointer access in ipa-pure-const and ipa-modref

2021-12-12 Thread Jan Hubicka via Gcc-patches
> > I think this is common pattern in C++ code originating from cast with > multiple inheritance. I would vote towards optimizing out the conditial > move in this case and I think it is correct. I crafted a testcse and filled in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103674 Honza > > Honza

Re: Terminate BB analysis on NULL pointer access in ipa-pure-const and ipa-modref

2021-12-12 Thread Jan Hubicka via Gcc-patches
> > > On 12/12/2021 3:49 AM, Jan Hubicka via Gcc-patches wrote: > > Hi, > > As discussed in the PR, we miss some optimization becuase > > gimple-ssa-isolate-paths turns NULL memory accesses to volatile and adds > > __builtin_trap after them. This is seen as a side-effect by IPA analysis > > and

Re: Terminate BB analysis on NULL pointer access in ipa-pure-const and ipa-modref

2021-12-12 Thread Jeff Law via Gcc-patches
On 12/12/2021 3:49 AM, Jan Hubicka via Gcc-patches wrote: Hi, As discussed in the PR, we miss some optimization becuase gimple-ssa-isolate-paths turns NULL memory accesses to volatile and adds __builtin_trap after them. This is seen as a side-effect by IPA analysis and additionally the (fully

Re: Terminate BB analysis on NULL pointer access in ipa-pure-const and ipa-modref

2021-12-12 Thread Jan Hubicka via Gcc-patches
> >+ /* NULL memory accesses terminates BB. These accesses are known > >+ to trip undefined behaviour. gimple-ssa-isolate-paths turns them > >+ to volatile accesses and adds builtin_trap call which would > >+ confuse us otherwise. */ > >+ if (infer_nonnull_range

Re: Terminate BB analysis on NULL pointer access in ipa-pure-const and ipa-modref

2021-12-12 Thread Andrew Pinski via Gcc-patches
On Sun, Dec 12, 2021 at 4:34 AM Richard Biener via Gcc-patches wrote: > > On December 12, 2021 11:49:12 AM GMT+01:00, Jan Hubicka via Gcc-patches > wrote: > >Hi, > >As discussed in the PR, we miss some optimization becuase > >gimple-ssa-isolate-paths turns NULL memory accesses to volatile and ad

Re: Terminate BB analysis on NULL pointer access in ipa-pure-const and ipa-modref

2021-12-12 Thread Richard Biener via Gcc-patches
On December 12, 2021 11:49:12 AM GMT+01:00, Jan Hubicka via Gcc-patches wrote: >Hi, >As discussed in the PR, we miss some optimization becuase >gimple-ssa-isolate-paths turns NULL memory accesses to volatile and adds >__builtin_trap after them. This is seen as a side-effect by IPA analysis >and

Terminate BB analysis on NULL pointer access in ipa-pure-const and ipa-modref

2021-12-12 Thread Jan Hubicka via Gcc-patches
Hi, As discussed in the PR, we miss some optimization becuase gimple-ssa-isolate-paths turns NULL memory accesses to volatile and adds __builtin_trap after them. This is seen as a side-effect by IPA analysis and additionally the (fully unreachable) builtin_trap is believed to load all global memor