aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-05-16 09:12:02 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2009-05-16 09:12:02 +0200
commit40a8f07a47f1192d06e895ce1a4d0fc91a723743 (patch)
tree6e8f264af352b2d4f86c2430ec273c272f874f45 /gcc/final.c
parenta99c6711f83e23596c5fdbf575484e3fa34d6e45 (diff)
downloadgcc-40a8f07a47f1192d06e895ce1a4d0fc91a723743.zip
gcc-40a8f07a47f1192d06e895ce1a4d0fc91a723743.tar.gz
gcc-40a8f07a47f1192d06e895ce1a4d0fc91a723743.tar.bz2
re PR target/39942 (Nonoptimal code - leaveq; xchg %ax,%ax; retq)
PR target/39942 * final.c (label_to_max_skip): New function. (label_to_alignment): Only use LABEL_TO_ALIGNMENT if CODE_LABEL_NUMBER <= max_labelno. * output.h (label_to_max_skip): New prototype. * config/i386/i386.c (ix86_avoid_jump_misspredicts): Renamed to... (ix86_avoid_jump_mispredicts): ... this. Don't define if ASM_OUTPUT_MAX_SKIP_ALIGN isn't defined. Update comment. Handle CODE_LABELs with >= 16 byte alignment or with max_skip == (1 << align) - 1. (ix86_reorg): Don't call ix86_avoid_jump_mispredicts if ASM_OUTPUT_MAX_SKIP_ALIGN isn't defined. From-SVN: r147607
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/final.c b/gcc/final.c
index 30ccc85..3c2e364 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -553,7 +553,17 @@ static int min_labelno, max_labelno;
int
label_to_alignment (rtx label)
{
- return LABEL_TO_ALIGNMENT (label);
+ if (CODE_LABEL_NUMBER (label) <= max_labelno)
+ return LABEL_TO_ALIGNMENT (label);
+ return 0;
+}
+
+int
+label_to_max_skip (rtx label)
+{
+ if (CODE_LABEL_NUMBER (label) <= max_labelno)
+ return LABEL_TO_MAX_SKIP (label);
+ return 0;
}
#ifdef HAVE_ATTR_length