This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/47900] Missed optimization with LTO
- From: "d.g.gorbachev at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 27 Feb 2011 19:57:08 +0000
- Subject: [Bug lto/47900] Missed optimization with LTO
- Auto-submitted: auto-generated
- References: <bug-47900-4@http.gcc.gnu.org/bugzilla/>
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'".)