diff options
Diffstat (limited to 'gcc/final.c')
-rw-r--r-- | gcc/final.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/gcc/final.c b/gcc/final.c index 5f8de30..e8edf19 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -2965,13 +2965,26 @@ alter_cond (cond) In an `asm', it's the user's fault; otherwise, the compiler's fault. */ void -output_operand_lossage (msgid) - const char *msgid; +output_operand_lossage VPARAMS ((const char *msgid, ...)) { + char *fmt_string; + char *new_message; + char *pfx_str; + VA_OPEN (ap, msgid); + VA_FIXEDARG (ap, const char *, msgid); + + pfx_str = this_is_asm_operands ? _("invalid `asm': ") : "output_operand: "; + asprintf (&fmt_string, "%s%s", pfx_str, _(msgid)); + vasprintf (&new_message, fmt_string, ap); + if (this_is_asm_operands) - error_for_asm (this_is_asm_operands, "invalid `asm': %s", _(msgid)); + error_for_asm (this_is_asm_operands, "%s", new_message); else - internal_error ("output_operand: %s", _(msgid)); + internal_error ("%s", new_message); + + free (fmt_string); + free (new_message); + VA_CLOSE (ap); } /* Output of assembler code from a template, and its subroutines. */ @@ -3217,7 +3230,7 @@ output_asm_insn (template, operands) c = atoi (p); if (! ISDIGIT (*p)) - output_operand_lossage ("operand number missing after %-letter"); + output_operand_lossage ("operand number missing after %%-letter"); else if (this_is_asm_operands && (c < 0 || (unsigned int) c >= insn_noperands)) output_operand_lossage ("operand number out of range"); @@ -3309,7 +3322,7 @@ output_asm_label (x) && NOTE_LINE_NUMBER (x) == NOTE_INSN_DELETED_LABEL)) ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (x)); else - output_operand_lossage ("`%l' operand isn't a label"); + output_operand_lossage ("`%%l' operand isn't a label"); assemble_name (asm_out_file, buf); } |