From 9d5baf966b6861e550dfed9014db548d283fb9a9 Mon Sep 17 00:00:00 2001 From: mmitchel Date: Sun, 29 Feb 2004 23:43:29 +0000 Subject: PR middle-end/13448 * c-tree.h (readonly_warning): Rename to ... (readonly_error): ... this. * c-typeck.c (build_unary_op): Adjust accordingly. (readonly_warning): Rename to ... (readonly_error): ... this and issue errors, not warnings. (build_modify_expr): Call readonly_error, not readonly_warning. (c_expand_asm_operands): Likewise. * tree-inline.c (optimize_inline_calls): Do not inline functions after errors have occurred. PR middle-end/13448 * gcc.dg/inline-5.c: New test. * gcc.dg/always-inline.c: Split out tests into ... * gcc.dg/always-inline2.c: ... this and ... * gcc.dg/always-inline3.c: ... this. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78682 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-inline.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc/tree-inline.c') diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 3ef97051ebc..ba5eb7ab055 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)); -- cgit v1.2.1