http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47900
--- Comment #2 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2011-02-27 19:57:01 UTC --- A null pointer check (... && ! &p->i) is not eliminated, notwithstanding the fact that the pointer has been dereferenced. If it is not null, bar is not called; otherwise, there is an undefined behavior, and bar is not called. Or is it too an unimportant problem? (It's interesting, after changing S_ptr p to struct S *p, the non-LTO build also fails with "undefined reference to `bar'".)