aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 3ef9705..ba5eb7a 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -39,7 +39,7 @@ Boston, MA 02111-1307, USA. */
#include "langhooks.h"
#include "cgraph.h"
#include "intl.h"
-
+#include "diagnostic.h"
/* This should be eventually be generalized to other languages, but
this would require a shared function-as-trees infrastructure. */
@@ -1620,6 +1620,12 @@ optimize_inline_calls (tree fn)
inline_data id;
tree prev_fn;
+ /* There is no point in performing inlining if errors have already
+ occurred -- and we might crash if we try to inline invalid
+ code. */
+ if (errorcount || sorrycount)
+ return;
+
/* Clear out ID. */
memset (&id, 0, sizeof (id));