i386.md (UNSPECV_NOPS): Rename from UNSPEC_NOPS and define as unspec_volatile.
authorUros Bizjak <uros@gcc.gnu.org>
Thu, 23 Sep 2010 13:25:30 +0000 (15:25 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 23 Sep 2010 13:25:30 +0000 (15:25 +0200)
* config/i386/i386.md (UNSPECV_NOPS): Rename from UNSPEC_NOPS and
define as unspec_volatile.
("nops"): Define as unspec_volatile. Use fputs to write to
asm_out_file directly.  Output NOPs on separate lines using while loop.
* config/i386/i386.c (ix86_code_end): Use fputs to write to
asm_out_file directly.  Output NOPs on separate lines using while loop.

testsuite/ChangeLog:

* gcc.target/i386/pad-1.c: Remove -S from dg-options.
* gcc.target/i386/pad-3.c: Ditto.
* gcc.target/i386/pad-7.c: Ditto.
* gcc.target/i386/pad-7.c: Ditto.
* gcc.target/i386/pr36502.c: Ditto.
* gcc.target/i386/zee.c: Ditto.
* gcc.target/i386/20060821-1.c: Ditto.
* gcc.target/i386/pad-2.c: Ditto.  Scan for NOPs on separate lines.
* gcc.target/i386/pad-5a.c: Ditto.  Do not use scan-assembler-not.
* gcc.target/i386/pad-5b.c: Ditto.
* gcc.target/i386/pad-6a.c: Ditto.
* gcc.target/i386/pad-6b.c: Ditto.
* gcc.target/i386/pad-8.c: Ditto.
* gcc.target/i386/pad-9.c: Ditto.
* gcc.target/i386/pad-10.c: Ditto.
* gcc.target/i386/pad-4.c: Ditto.  Require pic effective target.

From-SVN: r164564

19 files changed:
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/20060821-1.c
gcc/testsuite/gcc.target/i386/pad-1.c
gcc/testsuite/gcc.target/i386/pad-10.c
gcc/testsuite/gcc.target/i386/pad-2.c
gcc/testsuite/gcc.target/i386/pad-3.c
gcc/testsuite/gcc.target/i386/pad-4.c
gcc/testsuite/gcc.target/i386/pad-5a.c
gcc/testsuite/gcc.target/i386/pad-5b.c
gcc/testsuite/gcc.target/i386/pad-6a.c
gcc/testsuite/gcc.target/i386/pad-6b.c
gcc/testsuite/gcc.target/i386/pad-7.c
gcc/testsuite/gcc.target/i386/pad-8.c
gcc/testsuite/gcc.target/i386/pad-9.c
gcc/testsuite/gcc.target/i386/pr36502.c
gcc/testsuite/gcc.target/i386/zee.c

index 425e14fc2b69a9988efac66b79e83495cb67b69d..ac4745bccd478d1dc63bb47da85b953ccfde6c7c 100644 (file)
@@ -1,3 +1,12 @@
+2010-09-23  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.md (UNSPECV_NOPS): Rename from UNSPEC_NOPS and
+       define as unspec_volatile.
+       ("nops"): Define as unspec_volatile. Use fputs to write to
+       asm_out_file directly.  Output NOPs on separate lines using while loop.
+       * config/i386/i386.c (ix86_code_end): Use fputs to write to
+       asm_out_file directly.  Output NOPs on separate lines using while loop.
+
 2010-09-23  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/45565
@@ -45,8 +54,7 @@
 
 2010-09-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
-       * doc/contrib.texi (Contributors): Allow URL to wrap in PDF
-       output.
+       * doc/contrib.texi (Contributors): Allow URL to wrap in PDF output.
        * doc/cppopts.texi: Fix markup of index entry.
        * doc/extend.texi (Constructing Calls): Fix markup of
        __builtin_va_arg_pack and __builtin_va_arg_pack_len definition.
@@ -63,8 +71,7 @@
        long lines, avoid overlong pages from long @itemx lists.
        * doc/objc.texi (Garbage Collection): Allow URLs to wrap.
        * doc/standards.texi (Standards): Likewise.
-       * doc/trouble.texi (Incompatibilities): Fix markup of index
-       entry.
+       * doc/trouble.texi (Incompatibilities): Fix markup of index entry.
 
 2010-09-22  Joseph Myers  <joseph@codesourcery.com>
 
@@ -74,8 +81,7 @@
        resize option array here.
        * opts.h (prune_options): Remove prototype.
        * gcc.c (process_command): Take decoded options; don't call
-       decode_cmdline_options_to_array here.  Use decoded options for
-       argv[0].
+       decode_cmdline_options_to_array here.  Use decoded options for argv[0].
        (main): Call decode_cmdline_options_to_array here instead of
        prune_options.  Update call to process_command.
        * config/darwin-driver.c: Include opts.h.
        * postreload.c (move2add_note_store): Add reg_symbol_ref[] checks
        to update conditions. Fix reg_mode[] check.
 
-2010-09-22  Hariharan Sandanagobalane <hariharan@picochip.com>
+2010-09-22  Hariharan Sandanagobalane  <hariharan@picochip.com>
 
        * config/picochip/picochip.md (movhicc): Use expand to check whether
        movhicc is available and split it after reload.
        * tree-inline.c (copy_phis_for_bb): Delay commit of edge
        insertions until after all PHI nodes of the block are processed.
 
-2010-09-18  Tijl Coosemans <tijl@coosemans.org>
+2010-09-18  Tijl Coosemans  <tijl@coosemans.org>
 
        * config/i386/freebsd.h (SUBTARGET32_DEFAULT_CPU): Add.
 
 2010-09-15  Tejas Belagod  <tejas.belagod@arm.com>
 
        * config/arm/neon.md (vec_pack_trunc_<mode>): Instruction
-       pattern for vmovn. Expansion in case of non 
+       pattern for vmovn. Expansion in case of non
        -mvectorize-with-neon-quad.
        (neon_vec_pack_trunc_<mode>): Instruction pattern for vmovn for
        non- -mvectorize-with-neon-quad case.
index 49c3c9c240c7c81368681453a7e111897d29ba01..b2585210deddf967bcd2d5380e0afe218ba89048 100644 (file)
@@ -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);
index e3161bb7e666fd715cde6259ef0b90c14206c634..55086f3c12e455d58b8e457c1cd250bd83fc915b 100644 (file)
   UNSPEC_LD_MPIC       ; load_macho_picbase
   UNSPEC_TRUNC_NOOP
   UNSPEC_DIV_ALREADY_SPLIT
-  UNSPEC_NOPS
 
   ;; For SSE/MMX support:
   UNSPEC_FIX_NOTRUNC
   UNSPECV_LOCK
   UNSPECV_PROLOGUE_USE
   UNSPECV_CLD
+  UNSPECV_NOPS
   UNSPECV_VZEROALL
   UNSPECV_VZEROUPPER
   UNSPECV_RDTSC
 
 ;; 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")
index db8da878544bbeba8d3ec1172732a3c87664adb9..65fca966575108f55943268ba8d71dec522c1534 100644 (file)
@@ -1,3 +1,22 @@
+2010-09-23  Uros Bizjak  <ubizjak@gmail.com>
+
+       * gcc.target/i386/pad-1.c: Remove -S from dg-options.
+       * gcc.target/i386/pad-3.c: Ditto.
+       * gcc.target/i386/pad-7.c: Ditto.
+       * gcc.target/i386/pad-7.c: Ditto.
+       * gcc.target/i386/pr36502.c: Ditto.
+       * gcc.target/i386/zee.c: Ditto.
+       * gcc.target/i386/20060821-1.c: Ditto.
+       * gcc.target/i386/pad-2.c: Ditto.  Scan for NOPs on separate lines.
+       * gcc.target/i386/pad-5a.c: Ditto.  Do not use scan-assembler-not.
+       * gcc.target/i386/pad-5b.c: Ditto.
+       * gcc.target/i386/pad-6a.c: Ditto.
+       * gcc.target/i386/pad-6b.c: Ditto.
+       * gcc.target/i386/pad-8.c: Ditto.
+       * gcc.target/i386/pad-9.c: Ditto.
+       * gcc.target/i386/pad-10.c: Ditto.
+       * gcc.target/i386/pad-4.c: Ditto.  Require pic effective target.
+
 2010-09-23  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/45565
        2005-10-11  Fariborz Jahanian <fjahanian@apple.com>
 
        Radar 4291785
-       objc.dg/naming-4.m: New
-       objc.dg/naming-5.m: New
-       obj-c++.dg/naming-1.mm: New
-       obj-c++.dg/naming-2.mm: New
+       objc.dg/naming-4.m: New
+       objc.dg/naming-5.m: New
+       obj-c++.dg/naming-1.mm: New
+       obj-c++.dg/naming-2.mm: New
 
 2010-09-21  Jonathan Wakely  <redi@gcc.gnu.org>
            Jack Howarth  <howarth@bromo.med.uc.edu>
index 56e980fddfbb29eef7be5de47541f5e5f6952491..29a9afe876c5d59a989c7d6dc38e93201f5d4dcf 100644 (file)
@@ -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>
index 87a9d6c81f1ff7238302c120de8c7b356d450436..770c44d8900d76473a0bf6bf3f07be7208e45cc2 100644 (file)
@@ -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" } } */
 
index 6ba3b787402dac753d3b5df898442e37ea3e95fd..e10d24c7da61930b79de95f32cc9cbb2892d307b 100644 (file)
@@ -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" } } */
 
index 964547cc9045a2ea323369f3ef6fcae34cdbc6cb..37743c483a8305924cb004e9e5ccb5072ed97b57 100644 (file)
@@ -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
index 28db2cce657bc02a3a28a76d453e0f882953bd33..b9a547d07d85054dc0b470030f6d200c2fa0b782 100644 (file)
@@ -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" } } */
 
index a7033fae3aff3e1d4fa4aaa397d0c1c6ba71d275..ad6b029e2cb63e8f768e16f1306c44d8ba21e9c0 100644 (file)
@@ -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;
 }
index 9d0aa2a8000671db94555a4f5e2b01c6425c5e02..d29e62816f0885c2e7283a07764a6130373149b0 100644 (file)
@@ -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
index 2e1cf129d89a8e0c6d206db004c78fa39491159b..1d95bf32d2f1fb5a0cf210d629f6b23572eb8c96 100644 (file)
@@ -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
index e865967a7a761bc974b440cb445d4b155be4fe4a..e2db5ad1f43a8c174a4bc6acafec377965f6f061 100644 (file)
@@ -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
index 41aeaee7ce0a0d06d4e389d4c051a8e5d81a2e15..d8f9bec5d4f2c07256743b8eb187f62e9a7ee4bf 100644 (file)
@@ -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
index 7a7493d05bcf0818c7b5fa6f232ad3fc513e0397..8904eca0bc70eb2609f5d07244951a873f5c4bbd 100644 (file)
@@ -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" } } */
 
index 873a0a4fa2fc8fb945933400f0aa600d4e031219..0e939fa7890c23036e555ea34be3eaf7728d2959 100644 (file)
@@ -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
index 3d68805d143cdb02553fa921e8ce8124348384f3..69e33446b756ae9cef391e55a20cce136882a424 100644 (file)
@@ -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);
index 5794159d8e72b5753d5141bbb21b97dbe3b1a800..bc4c7ccf1c8ed91938ea49158db2dcae4ff4d64b 100644 (file)
@@ -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" } } */
index 4ed3aa87b9fef9d16ee2e4526a2b47ba7d1281a5..b46e890e2b0a759616149852532ae5535ad501a7 100644 (file)
@@ -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)