From: Steven Bosscher Date: Thu, 1 Jul 2004 12:38:20 +0000 (+0000) Subject: stmt.c (check_seenlabel): Remove. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0ae6d3b8cc84881c083dc72d76250152111dcf0;p=gcc.git stmt.c (check_seenlabel): Remove. * stmt.c (check_seenlabel): Remove. (pushcase, pushcase_range, expand_end_case_type): Don't call it. From-SVN: r83977 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 12144e81dbb..c52796b1368 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-07-01 Steven Bosscher + + * stmt.c (check_seenlabel): Remove. + (pushcase, pushcase_range, expand_end_case_type): Don't call it. + 2004-07-01 Richard Henderson * function.h (struct function): Remove x_function_call_count. diff --git a/gcc/stmt.c b/gcc/stmt.c index affeb9d5b0a..41f468de01f 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -383,7 +383,6 @@ static enum br_predictor return_prediction (rtx); static rtx shift_return_value (rtx); static void expand_value_return (rtx); static void expand_cleanups (tree, int, int); -static void check_seenlabel (void); static void do_jump_if_equal (rtx, rtx, rtx, int); static int estimate_case_costs (case_node_ptr); static bool same_case_target_p (rtx, rtx); @@ -3823,50 +3822,6 @@ expand_start_case (int exit_flag, tree expr, tree type, start_cleanup_deferral (); } - -static void -check_seenlabel (void) -{ - /* If this is the first label, warn if any insns have been emitted. */ - if (case_stack->data.case_stmt.line_number_status >= 0) - { - rtx insn; - - restore_line_number_status - (case_stack->data.case_stmt.line_number_status); - case_stack->data.case_stmt.line_number_status = -1; - - for (insn = case_stack->data.case_stmt.start; - insn; - insn = NEXT_INSN (insn)) - { - if (GET_CODE (insn) == CODE_LABEL) - break; - if (GET_CODE (insn) != NOTE - && (GET_CODE (insn) != INSN || GET_CODE (PATTERN (insn)) != USE)) - { - do - insn = PREV_INSN (insn); - while (insn && (GET_CODE (insn) != NOTE || NOTE_LINE_NUMBER (insn) < 0)); - - /* If insn is zero, then there must have been a syntax error. */ - if (insn) - { - location_t locus; -#ifdef USE_MAPPED_LOCATION - locus = NOTE_SOURCE_LOCATION (insn); -#else - locus.file = NOTE_SOURCE_FILE (insn); - locus.line = NOTE_LINE_NUMBER (insn); -#endif - warning ("%Hunreachable code at beginning of %s", &locus, - case_stack->data.case_stmt.printname); - } - break; - } - } - } -} /* Accumulate one case or default label inside a case or switch statement. VALUE is the value of the case (a null pointer, for a default label). @@ -3909,8 +3864,6 @@ pushcase (tree value, tree (*converter) (tree, tree), tree label, 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 @@ -3952,8 +3905,6 @@ pushcase_range (tree value1, tree value2, tree (*converter) (tree, tree), if (index_type == error_mark_node) return 0; - check_seenlabel (); - /* Convert VALUEs to type in which the comparisons are nominally done and replace any unspecified value with the corresponding bound. */ if (value1 == 0) @@ -4420,15 +4371,6 @@ expand_end_case_type (tree orig_index, tree orig_type) do_pending_stack_adjust (); - /* This might get a 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. */ if (index_type != error_mark_node) {