mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 19:50:13 +08:00
gas: avoid bogus warnings in false branches of conditional
The construct being added to the cond.s test case otherwise triggered both the "missing closing ..." and the "stray ..." (twice) warnings in _find_end_of_line(). As that code fragments suggests, this is needed to support (include) files that can be used for both assembler .include and compiler #include directives.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2014-10-21 Jan Beulich <jbeulich@suse.com>
|
||||||
|
|
||||||
|
* read.c (HANDLE_CONDITIONAL_ASSEMBLY): New parameter "num_read".
|
||||||
|
(read_a_source_file): Adjust HANDLE_CONDITIONAL_ASSEMBLY
|
||||||
|
invocations.
|
||||||
|
(_find_end_of_line): Don't issue "stray '\\'" warning when in
|
||||||
|
false branch of conditional.
|
||||||
|
|
||||||
2014-10-21 Jan Beulich <jbeulich@suse.com>
|
2014-10-21 Jan Beulich <jbeulich@suse.com>
|
||||||
|
|
||||||
* config/tc-aarch64.c (output_operand_error_record): Move down
|
* config/tc-aarch64.c (output_operand_error_record): Move down
|
||||||
|
15
gas/read.c
15
gas/read.c
@ -557,10 +557,11 @@ pobegin (void)
|
|||||||
cfi_pop_insert ();
|
cfi_pop_insert ();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define HANDLE_CONDITIONAL_ASSEMBLY() \
|
#define HANDLE_CONDITIONAL_ASSEMBLY(num_read) \
|
||||||
if (ignore_input ()) \
|
if (ignore_input ()) \
|
||||||
{ \
|
{ \
|
||||||
char *eol = find_end_of_line (input_line_pointer, flag_m68k_mri); \
|
char *eol = find_end_of_line (input_line_pointer - (num_read), \
|
||||||
|
flag_m68k_mri); \
|
||||||
input_line_pointer = (input_line_pointer <= buffer_limit \
|
input_line_pointer = (input_line_pointer <= buffer_limit \
|
||||||
&& eol >= buffer_limit) \
|
&& eol >= buffer_limit) \
|
||||||
? buffer_limit \
|
? buffer_limit \
|
||||||
@ -834,7 +835,7 @@ read_a_source_file (char *name)
|
|||||||
char *line_start = input_line_pointer;
|
char *line_start = input_line_pointer;
|
||||||
int mri_line_macro;
|
int mri_line_macro;
|
||||||
|
|
||||||
HANDLE_CONDITIONAL_ASSEMBLY ();
|
HANDLE_CONDITIONAL_ASSEMBLY (0);
|
||||||
|
|
||||||
c = get_symbol_end ();
|
c = get_symbol_end ();
|
||||||
|
|
||||||
@ -905,7 +906,7 @@ read_a_source_file (char *name)
|
|||||||
if (is_name_beginner (c))
|
if (is_name_beginner (c))
|
||||||
{
|
{
|
||||||
/* Want user-defined label or pseudo/opcode. */
|
/* Want user-defined label or pseudo/opcode. */
|
||||||
HANDLE_CONDITIONAL_ASSEMBLY ();
|
HANDLE_CONDITIONAL_ASSEMBLY (1);
|
||||||
|
|
||||||
s = --input_line_pointer;
|
s = --input_line_pointer;
|
||||||
c = get_symbol_end (); /* name's delimiter. */
|
c = get_symbol_end (); /* name's delimiter. */
|
||||||
@ -1119,7 +1120,7 @@ read_a_source_file (char *name)
|
|||||||
/* local label ("4:") */
|
/* local label ("4:") */
|
||||||
char *backup = input_line_pointer;
|
char *backup = input_line_pointer;
|
||||||
|
|
||||||
HANDLE_CONDITIONAL_ASSEMBLY ();
|
HANDLE_CONDITIONAL_ASSEMBLY (1);
|
||||||
|
|
||||||
temp = c - '0';
|
temp = c - '0';
|
||||||
|
|
||||||
@ -1266,7 +1267,7 @@ read_a_source_file (char *name)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
HANDLE_CONDITIONAL_ASSEMBLY ();
|
HANDLE_CONDITIONAL_ASSEMBLY (1);
|
||||||
|
|
||||||
#ifdef tc_unrecognized_line
|
#ifdef tc_unrecognized_line
|
||||||
if (tc_unrecognized_line (c))
|
if (tc_unrecognized_line (c))
|
||||||
@ -6138,7 +6139,7 @@ _find_end_of_line (char *s, int mri_string, int insn ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
if (inquote)
|
if (inquote)
|
||||||
as_warn (_("missing closing `%c'"), inquote);
|
as_warn (_("missing closing `%c'"), inquote);
|
||||||
if (inescape)
|
if (inescape && !ignore_input ())
|
||||||
as_warn (_("stray `\\'"));
|
as_warn (_("stray `\\'"));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2014-10-21 Jan Beulich <jbeulich@suse.com>
|
||||||
|
|
||||||
|
* gas/gas/all/cond.s: Also test processing of leading double
|
||||||
|
quote and trailing backslash in false branch of conditional.
|
||||||
|
* gas/gas/all/cond.l: Adjust accordingly.
|
||||||
|
|
||||||
2014-10-21 Jan Beulich <jbeulich@suse.com>
|
2014-10-21 Jan Beulich <jbeulich@suse.com>
|
||||||
|
|
||||||
* gas/ppc/power8.s: Test msgclr and msgsnd.
|
* gas/ppc/power8.s: Test msgclr and msgsnd.
|
||||||
|
@ -67,5 +67,8 @@
|
|||||||
[ ]*[1-9][0-9]*[ ]+[0-9a-f]+[048c] 0[0C] ?00 ?00 ?0[0C][ ]+m[ ]+12,[ ]*13[ ]*
|
[ ]*[1-9][0-9]*[ ]+[0-9a-f]+[048c] 0[0C] ?00 ?00 ?0[0C][ ]+m[ ]+12,[ ]*13[ ]*
|
||||||
[ ]*[1-9][0-9]*[ ]+0[0D] ?00 ?00 ?0[0D][ ]*
|
[ ]*[1-9][0-9]*[ ]+0[0D] ?00 ?00 ?0[0D][ ]*
|
||||||
[ ]*[1-9][0-9]*[ ]+
|
[ ]*[1-9][0-9]*[ ]+
|
||||||
|
[ ]*[1-9][0-9]*[ ]+\.if[ ]+0[ ]*
|
||||||
|
[ ]*[1-9][0-9]*[ ]+\.endif[ ]*
|
||||||
|
[ ]*[1-9][0-9]*[ ]+
|
||||||
[ ]*[1-9][0-9]*[ ]+.*\.p2align 5,0
|
[ ]*[1-9][0-9]*[ ]+.*\.p2align 5,0
|
||||||
#pass
|
#pass
|
||||||
|
@ -89,4 +89,15 @@
|
|||||||
m 11,
|
m 11,
|
||||||
m 12, 13
|
m 12, 13
|
||||||
|
|
||||||
|
.if 0
|
||||||
|
#define x "m" \
|
||||||
|
(x)
|
||||||
|
#define y \
|
||||||
|
"m" \
|
||||||
|
(y)
|
||||||
|
#define z \
|
||||||
|
((z) \
|
||||||
|
+ 1)
|
||||||
|
.endif
|
||||||
|
|
||||||
.p2align 5,0
|
.p2align 5,0
|
||||||
|
Reference in New Issue
Block a user