From: Jan Beulich Date: Mon, 3 Feb 2025 11:25:28 +0000 (+0100) Subject: C6x: use is_whitespace() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf0e6c6cd5cd84d3bbce6783c05f3b5b6d375e46;p=thirdparty%2Fbinutils-gdb.git C6x: use is_whitespace() Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert an ISSPACE() use. At the same time use is_end_of_stmt() instead of open-coded checks in adjacent code. --- diff --git a/gas/config/tc-tic6x.c b/gas/config/tc-tic6x.c index b256ddf34df..93a968c8f0a 100644 --- a/gas/config/tc-tic6x.c +++ b/gas/config/tc-tic6x.c @@ -489,7 +489,8 @@ s_tic6x_arch (int ignored ATTRIBUTE_UNUSED) char *arch; arch = input_line_pointer; - while (*input_line_pointer && !ISSPACE (*input_line_pointer)) + while (!is_end_of_stmt (*input_line_pointer) + && !is_whitespace (*input_line_pointer)) input_line_pointer++; c = *input_line_pointer; *input_line_pointer = 0; @@ -1180,7 +1181,7 @@ typedef struct } value; } tic6x_operand; -#define skip_whitespace(str) do { if (*(str) == ' ') ++(str); } while (0) +#define skip_whitespace(str) do { if (is_whitespace (*(str))) ++(str); } while (0) /* Parse a register operand, or part of an operand, starting at *P. If syntactically OK (including that the number is in the range 0 to @@ -3148,7 +3149,7 @@ md_assemble (char *str) char *output; p = str; - while (*p && !is_end_of_line[(unsigned char) *p] && *p != ' ') + while (!is_end_of_stmt (*p) && !is_whitespace (*p)) p++; /* This function should only have been called when there is actually @@ -3208,10 +3209,10 @@ md_assemble (char *str) if (good_func_unit) { - if (p[3] == ' ' || is_end_of_line[(unsigned char) p[3]]) + if (is_whitespace (p[3]) || is_end_of_stmt (p[3])) p += 3; else if ((p[3] == 'x' || p[3] == 'X') - && (p[4] == ' ' || is_end_of_line[(unsigned char) p[4]])) + && (is_whitespace (p[4]) || is_end_of_stmt (p[4]))) { maybe_cross = 1; p += 4; @@ -3219,7 +3220,7 @@ md_assemble (char *str) else if (maybe_base == tic6x_func_unit_d && (p[3] == 't' || p[3] == 'T') && (p[4] == '1' || p[4] == '2') - && (p[5] == ' ' || is_end_of_line[(unsigned char) p[5]])) + && (is_whitespace (p[5]) || is_end_of_stmt (p[5]))) { maybe_data_side = p[4] - '0'; p += 5;