summaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-02-22 13:12:44 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-02-22 13:12:44 +0000
commit40c98bdc9b4e5b2185beae4f46b0dd297fe77d16 (patch)
tree907ffa0caa217e06153a50f14104f9e99df06af6 /gcc/final.c
parentb26ea03346ee034c85757e3c0d1d9196394c63f2 (diff)
downloadgcc-40c98bdc9b4e5b2185beae4f46b0dd297fe77d16.tar.gz
(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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9030 138bc75d-0d04-0410-961f-82ee72b054a4
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 38e38c6d163..237cf491608 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);
}