From: Sandra Loosemore Date: Thu, 6 Sep 2007 18:20:37 +0000 (-0400) Subject: mips.c: Include diagnostic.h. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=566dfd713db9d71de2e1ff4ee176df4aacda7e6f;p=gcc.git mips.c: Include diagnostic.h. 2007-09-06 Sandra Loosemore gcc/ * config/mips/mips.c: Include diagnostic.h. (mips_set_current_function): Check errorcount and sorrycount before generating RTL. From-SVN: r128200 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d95fa4715b7..e304f1df927 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-09-06 Sandra Loosemore + + * config/mips/mips.c: Include diagnostic.h. + (mips_set_current_function): Check errorcount and sorrycount + before generating RTL. + 2007-09-06 Richard Sandiford PR target/33256 diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 82986cae398..cf8c337afa7 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -57,6 +57,7 @@ along with GCC; see the file COPYING3. If not see #include "sched-int.h" #include "tree-gimple.h" #include "bitmap.h" +#include "diagnostic.h" /* True if X is an unspec wrapper around a SYMBOL_REF or LABEL_REF. */ #define UNSPEC_ADDRESS_P(X) \ @@ -5327,7 +5328,12 @@ static void mips_set_current_function (tree fndecl) { int mips16p; - if (fndecl) + if (errorcount || sorrycount) + /* Avoid generating RTL when fndecl is possibly invalid. Best to fall + back on non-MIPS16 mode to avoid any strange secondary errors about + use of unsupported features in MIPS16 mode. */ + mips16p = false; + else if (fndecl) mips16p = SYMBOL_REF_MIPS16_FUNC_P (XEXP (DECL_RTL (fndecl), 0)); else mips16p = mips_base_mips16;