MIPS PATCH: fix ICE inside mips_set_current_function

Sandra Loosemore sandra@codesourcery.com
Thu Sep 6 18:43:00 GMT 2007


Richard Sandiford wrote:
> Sandra Loosemore <sandra@codesourcery.com> writes:
>> 	gcc/
>> 	* config/mips/mips.c:  Include diagnostic.h.
>> 	(mips_set_current_function): Check errorcount and sorrycount
>> 	before generating RTL.
> 
> OK.  I was going to suggest it should be done by the caller instead,
> but I suppose the reliance on DECL_RTL is MIPS-specific.  

That's the conclusion I came to, as well.  In addition, the action to be 
taken in an error situation is target-specific as well, and just 
ignoring the change to cfun might be the wrong behavior.

> It might be
> technically better to fall back on non-mips16 mode instead, because
> selecting mips16 mode for a nomips16 function is likely to lead to some
> strange secondary errors, such as complaints about using DSP functions.
> (This could happen to nomips16 functions that are completely unrelated
> to the reported error.)  

Good idea.  I've implemented that.

> I was going to suggest using mips_mips16_type_p
> or mips_nomips16_type_p, but I suppose we have to cope with the case
> where the fndecl's type is erroneous.

Yeah, I thought about this as well, and whether it was possible to 
easily tell by inspecting a tree whether it's erroneous or not (other 
than the usual equality comparison to error_mark_node), but in the end 
it seemed like too much work for not much benefit.

I've committed the version of the patch attached.

-Sandra

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 38a-set-cfun-errorcount.patch
Type: text/x-patch
Size: 1212 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070906/179d4b60/attachment.bin>


More information about the Gcc-patches mailing list