This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix regressions introduced by my PR34094 fix (PR c++/34238, c++/34340)
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 06 Dec 2007 20:31:17 -0800
- Subject: Re: [C++ PATCH] Fix regressions introduced by my PR34094 fix (PR c++/34238, c++/34340)
- References: <20071126233015.GP16835@devserv.devel.redhat.com> <20071205150141.GN16835@devserv.devel.redhat.com>
Jakub Jelinek wrote:
> The following patch (which obsoletes my earlier 34238 patch) fixes all of
> this, but letting cgraph_optimize actually emit all the vars into assembly
> and only checking afterwards if we emitted something we shouldn't, which
> seems to be much more reliable.
The diagnostic is not about what the compiler happens to end up spitting
out; it's about the user's program. If you do:
namespace { struct A { static int i; }; }
static int foo() { return A::i; }
the program is still erroneous, even though the compiler may likely
optimize away foo, and the reference to A::i. So, I don't think we
should be doing this check after cgraph_optimize.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713