Commit e5219642 by Jakub Jelinek Committed by Jakub Jelinek

i386.c (min_insn_size): Use get_attr_length for normal insns other than TYPE_MULTI...

	* config/i386/i386.c (min_insn_size): Use get_attr_length
	for normal insns other than TYPE_MULTI, TYPE_OTHER and TYPE_FCMP.
	For __asm return 0.

From-SVN: r148365
parent caaabe0a
2009-06-11 Jakub Jelinek <jakub@redhat.com> 2009-06-11 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.c (min_insn_size): Use get_attr_length
for normal insns other than TYPE_MULTI, TYPE_OTHER and TYPE_FCMP.
For __asm return 0.
* config/i386/i386.c (ix86_pad_returns): Use emit_jump_insn_before * config/i386/i386.c (ix86_pad_returns): Use emit_jump_insn_before
instead of emit_insn_before. instead of emit_insn_before.
......
...@@ -27571,7 +27571,7 @@ x86_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED) ...@@ -27571,7 +27571,7 @@ x86_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED)
static int static int
min_insn_size (rtx insn) min_insn_size (rtx insn)
{ {
int l = 0; int l = 0, len;
if (!INSN_P (insn) || !active_insn_p (insn)) if (!INSN_P (insn) || !active_insn_p (insn))
return 0; return 0;
...@@ -27580,7 +27580,7 @@ min_insn_size (rtx insn) ...@@ -27580,7 +27580,7 @@ min_insn_size (rtx insn)
if (GET_CODE (PATTERN (insn)) == UNSPEC_VOLATILE if (GET_CODE (PATTERN (insn)) == UNSPEC_VOLATILE
&& XINT (PATTERN (insn), 1) == UNSPECV_ALIGN) && XINT (PATTERN (insn), 1) == UNSPECV_ALIGN)
return 0; return 0;
if (JUMP_TABLE_DATA_P(insn)) if (JUMP_TABLE_DATA_P (insn))
return 0; return 0;
/* Important case - calls are always 5 bytes. /* Important case - calls are always 5 bytes.
...@@ -27589,14 +27589,31 @@ min_insn_size (rtx insn) ...@@ -27589,14 +27589,31 @@ min_insn_size (rtx insn)
&& symbolic_reference_mentioned_p (PATTERN (insn)) && symbolic_reference_mentioned_p (PATTERN (insn))
&& !SIBLING_CALL_P (insn)) && !SIBLING_CALL_P (insn))
return 5; return 5;
if (get_attr_length (insn) <= 1) len = get_attr_length (insn);
if (len <= 1)
return 1; return 1;
/* For normal instructions we may rely on the sizes of addresses /* For normal instructions we rely on get_attr_length being exact,
and the presence of symbol to require 4 bytes of encoding. with a few exceptions. */
This is not the case for jumps where references are PC relative. */
if (!JUMP_P (insn)) if (!JUMP_P (insn))
{ {
enum attr_type type = get_attr_type (insn);
switch (type)
{
case TYPE_MULTI:
if (GET_CODE (PATTERN (insn)) == ASM_INPUT
|| asm_noperands (PATTERN (insn)) >= 0)
return 0;
break;
case TYPE_OTHER:
case TYPE_FCMP:
break;
default:
/* Otherwise trust get_attr_length. */
return len;
}
l = get_attr_length_address (insn); l = get_attr_length_address (insn);
if (l < 4 && symbolic_reference_mentioned_p (PATTERN (insn))) if (l < 4 && symbolic_reference_mentioned_p (PATTERN (insn)))
l = 4; l = 4;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment