This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix FUNCTION_TYPE hashing problem (PR c++/33506)
- 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, 20 Sep 2007 17:51:32 -0400
- Subject: Re: [C++ PATCH] Fix FUNCTION_TYPE hashing problem (PR c++/33506)
- References: <20070920000103.GB2625@devserv.devel.redhat.com>
Jakub Jelinek wrote:
> The attached testcase issues incorrect diagnostics on valid code.
> The problem seems to be caused by type hashing.
> PR c++/33506
> * decl2.c (cplus_decl_attributes): Restore TYPE_RAISES_EXCEPTIONS
> if decl_attributes changed it.
In the long term, I think TYPE_RAISES_EXCEPTION ought to move into
generic code -- there are optimization opportunities available if you
know what exceptions can be thrown by a given function. But, we're not
doing that kind of change now, so let's not consider that for the moment.
I think you have the right idea with a hook, but I don't think it's in
the right place. In particular, decl_attributes should be taught not to
corrupt the type in this way. Instead, I think type_hash_eq should have
a language hook to allow the C++ front end to say that for a
FUNCTION_TYPE the TYPE_RAISES_EXCEPTION matters for equality.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713