From 6a90d232abb6815994146ecc0ebbfc83d37f6d8a Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 18 May 2009 17:21:13 +0000 Subject: [PATCH] re PR target/39942 (Nonoptimal code - leaveq; xchg %ax,%ax; retq) 2009-05-18 H.J. Lu PR target/39942 * config/i386/i386.c (ix86_avoid_jump_misspredicts): Replace gen_align with gen_pad. (ix86_reorg): Check ASM_OUTPUT_MAX_SKIP_PAD instead of #ifdef ASM_OUTPUT_MAX_SKIP_ALIGN. * config/i386/i386.h (ASM_OUTPUT_MAX_SKIP_PAD): New. * config/i386/x86-64.h (ASM_OUTPUT_MAX_SKIP_PAD): Likewise. * config/i386/i386.md (align): Renamed to ... (pad): This. Replace ASM_OUTPUT_MAX_SKIP_ALIGN with ASM_OUTPUT_MAX_SKIP_PAD. From-SVN: r147671 --- gcc/ChangeLog | 15 +++++++++++++++ gcc/config/i386/i386.c | 4 ++-- gcc/config/i386/i386.h | 16 ++++++++++++++++ gcc/config/i386/i386.md | 8 ++++---- gcc/config/i386/x86-64.h | 9 +++++++++ 5 files changed, 46 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 68b3419..8260f92 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2009-05-18 H.J. Lu + + PR target/39942 + * config/i386/i386.c (ix86_avoid_jump_misspredicts): Replace + gen_align with gen_pad. + (ix86_reorg): Check ASM_OUTPUT_MAX_SKIP_PAD instead of + #ifdef ASM_OUTPUT_MAX_SKIP_ALIGN. + + * config/i386/i386.h (ASM_OUTPUT_MAX_SKIP_PAD): New. + * config/i386/x86-64.h (ASM_OUTPUT_MAX_SKIP_PAD): Likewise. + + * config/i386/i386.md (align): Renamed to ... + (pad): This. Replace ASM_OUTPUT_MAX_SKIP_ALIGN with + ASM_OUTPUT_MAX_SKIP_PAD. + 2009-05-18 Andreas Schwab * config.gcc: Fix variable syntax. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index acd3069..e9f8b95 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -27334,7 +27334,7 @@ ix86_avoid_jump_mispredicts (void) if (dump_file) fprintf (dump_file, "Padding insn %i by %i bytes!\n", INSN_UID (insn), padsize); - emit_insn_before (gen_align (GEN_INT (padsize)), insn); + emit_insn_before (gen_pad (GEN_INT (padsize)), insn); } } } @@ -27402,7 +27402,7 @@ ix86_reorg (void) { if (TARGET_PAD_RETURNS) ix86_pad_returns (); -#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN +#ifdef ASM_OUTPUT_MAX_SKIP_PAD if (TARGET_FOUR_JUMP_LIMIT) ix86_avoid_jump_mispredicts (); #endif diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index f41ed7d..e42686b 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2175,6 +2175,22 @@ do { \ #define ASM_OUTPUT_OPCODE(STREAM, PTR) \ ASM_OUTPUT_AVX_PREFIX ((STREAM), (PTR)) +/* A C statement to output to the stdio stream FILE an assembler + command to pad the location counter to a multiple of 1<