aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-02-22 08:12:44 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1995-02-22 08:12:44 -0500
commitcb64953075c20b6e004949206c3d7cdd6795d773 (patch)
tree907ffa0caa217e06153a50f14104f9e99df06af6 /gcc/final.c
parent57e1b65caaf247d5ac9022ff20586c7d43a1931c (diff)
downloadgcc-cb64953075c20b6e004949206c3d7cdd6795d773.zip
gcc-cb64953075c20b6e004949206c3d7cdd6795d773.tar.gz
gcc-cb64953075c20b6e004949206c3d7cdd6795d773.tar.bz2
(output_asm_name): New function, using code taken from output_asm_insn.
(output_asm_insn): If flag_print_asm_name, print the comment after the first assembler instruction even in multi-instruction templates. From-SVN: r9030
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c46
1 files changed, 27 insertions, 19 deletions
diff --git a/gcc/final.c b/gcc/final.c
index 38e38c6..237cf49 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -276,6 +276,7 @@ static int add_bb_string PROTO((char *, int));
static void output_source_line PROTO((FILE *, rtx));
static rtx walk_alter_subreg PROTO((rtx));
static int alter_cond PROTO((rtx));
+static void output_asm_name PROTO((void));
static void output_operand PROTO((rtx, int));
static void leaf_renumber_regs PROTO((rtx));
@@ -2313,6 +2314,28 @@ output_operand_lossage (str)
and print a constant expression for minus the value
of the operand, with no other punctuation. */
+static void
+output_asm_name ()
+{
+ if (flag_print_asm_name)
+ {
+ /* Annotate the assembly with a comment describing the pattern and
+ alternative used. */
+ if (debug_insn)
+ {
+ register int num = INSN_CODE (debug_insn);
+ fprintf (asm_out_file, " %s %d %s",
+ ASM_COMMENT_START, INSN_UID (debug_insn), insn_name[num]);
+ if (insn_n_alternatives[num] > 1)
+ fprintf (asm_out_file, "/%d", which_alternative + 1);
+
+ /* Clear this so only the first assembler insn
+ of any rtl insn will get the special comment for -dp. */
+ debug_insn = 0;
+ }
+ }
+}
+
void
output_asm_insn (template, operands)
char *template;
@@ -2336,17 +2359,18 @@ output_asm_insn (template, operands)
while (c = *p++)
switch (c)
{
-#ifdef ASM_OUTPUT_OPCODE
case '\n':
+ output_asm_name ();
putc (c, asm_out_file);
+#ifdef ASM_OUTPUT_OPCODE
while ((c = *p) == '\t')
{
putc (c, asm_out_file);
p++;
}
ASM_OUTPUT_OPCODE (asm_out_file, p);
- break;
#endif
+ break;
#ifdef ASSEMBLER_DIALECT
case '{':
@@ -2459,23 +2483,7 @@ output_asm_insn (template, operands)
putc (c, asm_out_file);
}
- if (flag_print_asm_name)
- {
- /* Annotate the assembly with a comment describing the pattern and
- alternative used. */
- if (debug_insn)
- {
- register int num = INSN_CODE (debug_insn);
- fprintf (asm_out_file, " %s %d %s",
- ASM_COMMENT_START, INSN_UID (debug_insn), insn_name[num]);
- if (insn_n_alternatives[num] > 1)
- fprintf (asm_out_file, "/%d", which_alternative + 1);
-
- /* Clear this so only the first assembler insn
- of any rtl insn will get the special comment for -dp. */
- debug_insn = 0;
- }
- }
+ output_asm_name ();
putc ('\n', asm_out_file);
}