This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Alternative number in output_asm_name
- From: "Ye, Joey" <joey dot ye at intel dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 21 May 2008 17:06:30 +0800
- Subject: [PATCH] Alternative number in output_asm_name
It is well known which_alternative is from 0 to N-1. Where as in .s file
generated with option -dp, alternative number is from 1 to N. This is
very confusing.
For example, i386.md has
(define_insn "*movsf_1"
...
switch (which_alternative)
...
case 7: case 8:
return "movss\t{%1, %0|%0, %1}";
But the output .s is:
movss %xmm0, (%rax) # 10 *movsf_1/9 [length = 4]
^^^
Confusing
I'd suggest to follow C convention to output 0 to N-1 in .s file. OK to
mainline?
Thanks - Joey
2008-05-21 Joey Ye <joey.ye@intel.com>
* final.c (output_asm_name): Don't plus one to
which_alternative.
Index: gcc/final.c
===================================================================
--- gcc/final.c (revision 134775)
+++ gcc/final.c (working copy)
@@ -3000,7 +3000,7 @@ output_asm_name (void)
ASM_COMMENT_START, INSN_UID (debug_insn),
insn_data[num].name);
if (insn_data[num].n_alternatives > 1)
- fprintf (asm_out_file, "/%d", which_alternative + 1);
+ fprintf (asm_out_file, "/%d", which_alternative);
#ifdef HAVE_ATTR_length
fprintf (asm_out_file, "\t[length = %d]",
get_attr_length (debug_insn));