This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] Fix FUNCTION_TYPE hashing problem (PR c++/33506)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]