summaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>1998-02-17 13:21:01 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>1998-02-17 13:21:01 +0000
commit80600102607c23f06e7b17b0d74a564de79e40f3 (patch)
tree052efe64382b179485b7313fe3abcb22f0037a00 /gcc/stmt.c
parentf6abf329021edd140e592e36dcdb5b115eeb9f6d (diff)
downloadgcc-80600102607c23f06e7b17b0d74a564de79e40f3.tar.gz
Fix problems with last patch.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18033 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 57caad79ca9..012ca2be42f 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -3895,8 +3895,6 @@ pushcase (value, converter, label, duplicate)
index_type = TREE_TYPE (case_stack->data.case_stmt.index_expr);
nominal_type = case_stack->data.case_stmt.nominal_type;
- check_seenlabel ();
-
/* If the index is erroneous, avoid more problems: pretend to succeed. */
if (index_type == error_mark_node)
return 0;
@@ -3905,6 +3903,8 @@ pushcase (value, converter, label, duplicate)
if (value != 0)
value = (*converter) (nominal_type, value);
+ check_seenlabel ();
+
/* Fail if this value is out of range for the actual type of the index
(which may be narrower than NOMINAL_TYPE). */
if (value != 0 && ! int_fits_type_p (value, index_type))
@@ -4612,6 +4612,13 @@ expand_end_case (orig_index)
do_pending_stack_adjust ();
+ /* This might get an spurious warning in the presence of a syntax error;
+ it could be fixed by moving the call to check_seenlabel after the
+ check for error_mark_node, and copying the code of check_seenlabel that
+ deals with case_stack->data.case_stmt.line_number_status /
+ restore_line_number_status in front of the call to end_cleanup_deferral;
+ However, this might miss some useful warnings in the presence of
+ non-syntax errors. */
check_seenlabel ();
/* An ERROR_MARK occurs for various reasons including invalid data type. */