From 0ff576b901c1d35d382abef6472c003809bbe585 Mon Sep 17 00:00:00 2001 From: jakub Date: Fri, 3 Jan 2014 12:22:17 +0000 Subject: PR target/59625 * config/i386/i386.c (ix86_avoid_jump_mispredicts): Don't consider asm goto as jump. * gcc.target/i386/pr59625.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206314 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/gcc.target/i386/pr59625.c | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/pr59625.c (limited to 'gcc/testsuite/gcc.target') diff --git a/gcc/testsuite/gcc.target/i386/pr59625.c b/gcc/testsuite/gcc.target/i386/pr59625.c new file mode 100644 index 00000000000..8e1a7794bc4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr59625.c @@ -0,0 +1,36 @@ +/* PR target/59625 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mtune=atom" } */ + +int +foo (void) +{ + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + asm goto ("" : : : : lab); + return 0; +lab: + return 1; +} + +/* Verify we don't consider asm goto as a jump for four jumps limit + optimization. asm goto doesn't have to contain a jump at all, + the branching to labels can happen through different means. */ +/* { dg-final { scan-assembler-not "(p2align\[^\n\r\]*\[\n\r]*\[^\n\r\]*){8}p2align" } } */ -- cgit v1.2.1