===================================================================
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fomit-frame-pointer -march=atom -fno-pic -S" } */
+/* { dg-options "-O2 -fomit-frame-pointer -march=atom -fno-pic" } */
/* { dg-final { scan-assembler-not "nop" } } */
/* { dg-final { scan-assembler-not "rep" } } */
===================================================================
@@ -1,8 +1,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-O2 -fomit-frame-pointer -march=atom -S" } */
-/* { dg-final { scan-assembler-times "nop; nop" 1 } } */
-/* { dg-final { scan-assembler-not "nop; nop; nop" } } */
+/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
+/* { dg-final { scan-assembler-times "nop" 2 } } */
/* { dg-final { scan-assembler-not "rep" } } */
int
===================================================================
@@ -1,8 +1,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target lp64 } */
-/* { dg-options "-O2 -fomit-frame-pointer -march=atom -S" } */
-/* { dg-final { scan-assembler-times "nop; nop; nop; nop; nop; nop" 1 } } */
-/* { dg-final { scan-assembler-not "nop; nop; nop; nop; nop; nop; nop" } } */
+/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
+/* { dg-final { scan-assembler-times "nop" 6 } } */
/* { dg-final { scan-assembler-not "rep" } } */
int
===================================================================
@@ -1,6 +1,6 @@
/* PR target/36502 */
/* { dg-do compile { target { *-*-darwin* && ilp32 } } } */
-/* { dg-options "-O -fomit-frame-pointer -fno-pic -S" } */
+/* { dg-options "-O -fomit-frame-pointer -fno-pic" } */
int a;
void f() {a++;}
/* { dg-final { scan-assembler-not "esp" } } */
===================================================================
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-O2 -fomit-frame-pointer -march=atom -S" } */
+/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
/* { dg-final { scan-assembler-not "nop" } } */
/* { dg-final { scan-assembler-not "rep" } } */
===================================================================
@@ -1,8 +1,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target lp64 } */
-/* { dg-options "-O2 -fomit-frame-pointer -march=atom -S" } */
-/* { dg-final { scan-assembler-times "nop; nop; nop; nop" 1 } } */
-/* { dg-final { scan-assembler-not "nop; nop; nop; nop; nop" } } */
+/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
+/* { dg-final { scan-assembler-times "nop" 4 } } */
/* { dg-final { scan-assembler-not "rep" } } */
extern void bar (void);
===================================================================
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target lp64 } */
-/* { dg-options "-O2 -fzee -S" } */
+/* { dg-options "-O2 -fzee" } */
/* { dg-final { scan-assembler-not "mov\[\\t \]+\(%\[\^,\]+\),\[\\t \]*\\1" } } */
int mask[100];
int foo(unsigned x)
===================================================================
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fomit-frame-pointer -march=atom -S" } */
-/* { dg-final { scan-assembler-times "nop; nop; nop; nop; nop; nop; nop; nop" 1 } } */
+/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
+/* { dg-final { scan-assembler-times "nop" 8 } } */
/* { dg-final { scan-assembler-not "rep" } } */
void
===================================================================
@@ -1,7 +1,8 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-O2 -fomit-frame-pointer -march=atom -S -fPIC" } */
-/* { dg-final { scan-assembler-times "nop; nop; nop; nop; nop; nop; nop; nop" 1 } } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fomit-frame-pointer -march=atom -fPIC" } */
+/* { dg-final { scan-assembler-times "nop" 8 } } */
/* { dg-final { scan-assembler-not "rep" } } */
extern int bar;
@@ -9,5 +10,6 @@ extern int bar;
int
foo ()
{
+ asm volatile ("");
return bar;
}
===================================================================
@@ -1,8 +1,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target lp64 } */
-/* { dg-options "-O2 -fomit-frame-pointer -march=atom -S" } */
-/* { dg-final { scan-assembler-times "nop; nop; nop; nop" 1 } } */
-/* { dg-final { scan-assembler-not "nop; nop; nop; nop; nop" } } */
+/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
+/* { dg-final { scan-assembler-times "nop" 4 } } */
/* { dg-final { scan-assembler-not "rep" } } */
int
===================================================================
@@ -1,8 +1,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-O2 -fomit-frame-pointer -march=atom -S" } */
-/* { dg-final { scan-assembler-times "nop; nop; nop; nop" 1 } } */
-/* { dg-final { scan-assembler-not "nop; nop; nop; nop; nop" } } */
+/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
+/* { dg-final { scan-assembler-times "nop" 4 } } */
/* { dg-final { scan-assembler-not "rep" } } */
int
===================================================================
@@ -1,7 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fomit-frame-pointer -march=atom -S" } */
-/* { dg-final { scan-assembler-times "nop; nop; nop; nop; nop; nop" 1 } } */
-/* { dg-final { scan-assembler-not "nop; nop; nop; nop; nop; nop; nop" } } */
+/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
+/* { dg-final { scan-assembler-times "nop" 6 } } */
/* { dg-final { scan-assembler-not "rep" } } */
int
===================================================================
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -msse3 -S" } */
+/* { dg-options "-O2 -msse3" } */
/* { dg-final { scan-assembler-not "%mm" } } */
/* PR 28825 */
#include <pmmintrin.h>
===================================================================
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fomit-frame-pointer -march=atom -S" } */
+/* { dg-options "-O2 -fomit-frame-pointer -march=atom" } */
/* { dg-final { scan-assembler-not "nop" } } */
/* { dg-final { scan-assembler-not "rep" } } */
===================================================================
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fomit-frame-pointer -mtune=generic -S" } */
+/* { dg-options "-O2 -fomit-frame-pointer -mtune=generic" } */
/* { dg-final { scan-assembler "rep" } } */
/* { dg-final { scan-assembler-not "nop" } } */
===================================================================
@@ -104,7 +104,6 @@
UNSPEC_LD_MPIC ; load_macho_picbase
UNSPEC_TRUNC_NOOP
UNSPEC_DIV_ALREADY_SPLIT
- UNSPEC_NOPS
;; For SSE/MMX support:
UNSPEC_FIX_NOTRUNC
@@ -248,6 +247,7 @@
UNSPECV_LOCK
UNSPECV_PROLOGUE_USE
UNSPECV_CLD
+ UNSPECV_NOPS
UNSPECV_VZEROALL
UNSPECV_VZEROUPPER
UNSPECV_RDTSC
@@ -11468,32 +11468,18 @@
;; Generate nops. Operand 0 is the number of nops, up to 8.
(define_insn "nops"
- [(unspec [(match_operand 0 "const_int_operand" "")]
- UNSPEC_NOPS)]
+ [(unspec_volatile [(match_operand 0 "const_int_operand" "")]
+ UNSPECV_NOPS)]
"reload_completed"
{
- switch (INTVAL (operands[0]))
- {
- case 1:
- return "nop";
- case 2:
- return "nop; nop";
- case 3:
- return "nop; nop; nop";
- case 4:
- return "nop; nop; nop; nop";
- case 5:
- return "nop; nop; nop; nop; nop";
- case 6:
- return "nop; nop; nop; nop; nop; nop";
- case 7:
- return "nop; nop; nop; nop; nop; nop; nop";
- case 8:
- return "nop; nop; nop; nop; nop; nop; nop; nop";
- default:
- gcc_unreachable ();
- break;
- }
+ int num = INTVAL (operands[0]);
+
+ gcc_assert (num >= 1 && num <= 8);
+
+ while (num--)
+ fputs ("\tnop\n", asm_out_file);
+
+ return "";
}
[(set (attr "length") (symbol_ref "INTVAL (operands[0])"))
(set_attr "length_immediate" "0")
===================================================================
@@ -8024,13 +8024,18 @@ ix86_code_end (void)
xops[0] = gen_rtx_REG (Pmode, regno);
xops[1] = gen_rtx_MEM (Pmode, stack_pointer_rtx);
- /* Pad stack IP move with 4 instructions. 2 NOPs count as 1
- instruction. */
+ /* Pad stack IP move with 4 instructions (two NOPs count
+ as one instruction.) */
if (TARGET_PAD_SHORT_FUNCTION)
- output_asm_insn ("nop; nop; nop; nop; nop; nop; nop; nop",
- xops);
+ {
+ int i = 8;
+
+ while (i--)
+ fputs ("\tnop\n", asm_out_file);
+ }
+
output_asm_insn ("mov%z0\t{%1, %0|%0, %1}", xops);
- output_asm_insn ("ret", xops);
+ fputs ("\tret\n", asm_out_file);
final_end_function ();
init_insn_lengths ();
free_after_compilation (cfun);