From: Nick Clifton Date: Tue, 27 Jan 1998 19:13:49 +0000 (+0000) Subject: Fix PRs 14721, 14722, 14723 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=38a8f434a8fcd09104330235fd4474518e69dc60;p=binutils-gdb.git Fix PRs 14721, 14722, 14723 --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 8915e505fc0..61def896611 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -5,6 +5,11 @@ Tue Jan 27 13:32:01 1998 Robert Lipe (i386-*-sco3.2*): New target. * configure: Rebuild. +Tue Jan 27 11:06:52 1998 Nick Clifton + + * config/tc-v850.c: Fix PRs 14721, 14722, 14723, tidying error + message production. + Tue Jan 27 12:24:32 1998 Ian Lance Taylor * config/tc-arm.c (md_apply_fix3): Add new variable newimm to hold diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c index de7a7d0c043..97043c8ee0d 100644 --- a/gas/config/tc-v850.c +++ b/gas/config/tc-v850.c @@ -475,7 +475,7 @@ set_machine (int number) case 0: processor_mask = PROCESSOR_V850; break; /* start-sanitize-v850e */ case bfd_mach_v850e: processor_mask = PROCESSOR_V850E; break; - case bfd_mach_v850eq: processor_mask = PROCESSOR_V850EQ; break; + case bfd_mach_v850ea: processor_mask = PROCESSOR_V850EA; break; /* end-sanitize-v850e */ } } @@ -502,7 +502,7 @@ const pseudo_typeS md_pseudo_table[] = {"call_table_data", v850_call_table_data, 0}, {"call_table_text", v850_call_table_text, 0}, {"v850e", set_machine, bfd_mach_v850e}, - {"v850eq", set_machine, bfd_mach_v850eq}, + {"v850ea", set_machine, bfd_mach_v850ea}, /* end-sanitize-v850e */ { NULL, NULL, 0} }; @@ -1076,7 +1076,7 @@ parse_register_list break; } - skip_white_space(); + skip_white_space (); } return NULL; @@ -1097,12 +1097,12 @@ md_show_usage (stream) FILE * stream; { fprintf (stream, "V850 options:\n"); - fprintf (stream, "\t-mwarn_signed_overflow Warn if signed immediate values overflow\n"); - fprintf (stream, "\t-mwarn_unsigned_overflow Warn if unsigned immediate values overflow\n"); + fprintf (stream, "\t-mwarn-signed-overflow Warn if signed immediate values overflow\n"); + fprintf (stream, "\t-mwarn-unsigned-overflow Warn if unsigned immediate values overflow\n"); fprintf (stream, "\t-mv850 The code is targeted at the v850\n"); /* start-sanitize-v850e */ fprintf (stream, "\t-mv850e The code is targeted at the v850e\n"); - fprintf (stream, "\t-mv850eq The code is targeted at the v850eq\n"); + fprintf (stream, "\t-mv850ea The code is targeted at the v850ea\n"); /* end-sanitize-v850e */ } @@ -1112,13 +1112,16 @@ md_parse_option (c, arg) char * arg; { if (c != 'm') - return 0; + { + fprintf (stderr, "unknown command line option: -%c%s\n", c, arg); + return 0; + } - if (strcmp (arg, "warn_signed_overflow") == 0) + if (strcmp (arg, "warn-signed-overflow") == 0) { warn_signed_overflows = TRUE; } - else if (strcmp (arg, "warn_unsigned_overflow") == 0) + else if (strcmp (arg, "warn-unsigned-overflow") == 0) { warn_unsigned_overflows = TRUE; } @@ -1133,14 +1136,17 @@ md_parse_option (c, arg) machine = bfd_mach_v850e; processor_mask = PROCESSOR_V850E; } - else if (strcmp (arg, "v850eq") == 0) + else if (strcmp (arg, "v850ea") == 0) { - machine = bfd_mach_v850eq; - processor_mask = PROCESSOR_V850EQ; + machine = bfd_mach_v850ea; + processor_mask = PROCESSOR_V850EA; } /* end-sanitize-v850e */ else - return 0; + { + fprintf (stderr, "unknown command line option: -%c%s\n", c, arg); + return 0; + } return 1; } @@ -1264,13 +1270,13 @@ md_begin () flagword applicable; /* start-sanitize-v850e */ - if (strncmp (TARGET_CPU, "v850eq", 6) == 0) + if (strncmp (TARGET_CPU, "v850ea", 6) == 0) { if (machine == -1) - machine = bfd_mach_v850eq; + machine = bfd_mach_v850ea; if (processor_mask == -1) - processor_mask = PROCESSOR_V850EQ; + processor_mask = PROCESSOR_V850EA; } else if (strncmp (TARGET_CPU, "v850e", 5) == 0) { @@ -1568,7 +1574,7 @@ md_assemble (str) errmsg = NULL; while (*str == ' ' || *str == ',' || *str == '[' || *str == ']') - ++str; + ++ str; if (operand->flags & V850_OPERAND_RELAX) relaxable = 1; @@ -1625,7 +1631,7 @@ md_assemble (str) case BFD_RELOC_32: if ((operand->flags & V850E_IMMEDIATE32) == 0) { - errmsg = "use bigger instruction"; + errmsg = "immediate operand is too large"; goto error; } @@ -1652,7 +1658,7 @@ md_assemble (str) { if ((operand->flags & V850E_IMMEDIATE32) == 0) { - errmsg = "use bigger instruction"; + errmsg = "immediate operand is too large"; goto error; } @@ -1686,6 +1692,14 @@ md_assemble (str) && ex.X_add_number == 0) { errmsg = "register r0 cannot be used here"; + + /* Force an error message to be generated by + skipping over any following potential matches + for this opcode. */ + opcode += 3; + + if (* input_line_pointer == ']') + ++ input_line_pointer; } } else if ((operand->flags & V850_OPERAND_SRG) != 0) @@ -1815,7 +1829,7 @@ md_assemble (str) if (((insn & 0x07e0) == 0x0200) && ex.X_op == O_constant && (ex.X_add_number < (- (1 << (operand->bits - 1))) || ex.X_add_number > ((1 << operand->bits) - 1))) - errmsg = "use bigger instruction"; + errmsg = "immediate constant is too large"; /* end-sanitize-v850e */ } @@ -2186,10 +2200,25 @@ v850_insert_operand (insn, operand, val, file, line) insn = (*operand->insert) (insn, val, & message); if (message != NULL) { - if (file == (char *) NULL) - as_warn (message); + if ((operand->flags & V850_OPERAND_SIGNED) + && ! warn_signed_overflows + && strstr (message, "out of range") != NULL) + { + /* skip warning... */ + } + else if ((operand->flags & V850_OPERAND_SIGNED) == 0 + && ! warn_unsigned_overflows + && strstr (message, "out of range") != NULL) + { + /* skip warning... */ + } else - as_warn_where (file, line, message); + { + if (file == (char *) NULL) + as_warn (message); + else + as_warn_where (file, line, message); + } } } else