S/390: Hotpatch: Remove special handling of nested functions.
authorDominik Vogt <vogt@linux.vnet.ibm.com>
Tue, 31 Mar 2015 12:07:06 +0000 (12:07 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Tue, 31 Mar 2015 12:07:06 +0000 (12:07 +0000)
gcc/
2015-03-31  Dominik Vogt  <vogt@linux.vnet.ibm.com>

    * config/s390/s390.c (s390_function_num_hotpatch_hw): Allow hotpatching
    nested functions.
    (s390_reorg): Adapt to new signature of s390_function_num_hotpatch_hw.
    (s390_asm_output_function_label): Adapt to new signature of
    s390_function_num_hotpatch_hw
    Optimise the code generating assembler output.
    Add comments to assembler file.

gcc/testsuite/
2015-03-31  Dominik Vogt  <vogt@linux.vnet.ibm.com>

    * gcc.target/s390/hotpatch-25.c: New test.
    * gcc.target/s390/hotpatch-1.c: Update test.
    * gcc.target/s390/hotpatch-10.c: Update test.
    * gcc.target/s390/hotpatch-11.c: Update test.
    * gcc.target/s390/hotpatch-12.c: Update test.
    * gcc.target/s390/hotpatch-13.c: Update test.
    * gcc.target/s390/hotpatch-14.c: Update test.
    * gcc.target/s390/hotpatch-15.c: Update test.
    * gcc.target/s390/hotpatch-16.c: Update test.
    * gcc.target/s390/hotpatch-17.c: Update test.
    * gcc.target/s390/hotpatch-18.c: Update test.
    * gcc.target/s390/hotpatch-19.c: Update test.
    * gcc.target/s390/hotpatch-2.c: Update test.
    * gcc.target/s390/hotpatch-21.c: Update test.
    * gcc.target/s390/hotpatch-22.c: Update test.
    * gcc.target/s390/hotpatch-23.c: Update test.
    * gcc.target/s390/hotpatch-24.c: Update test.
    * gcc.target/s390/hotpatch-3.c: Update test.
    * gcc.target/s390/hotpatch-4.c: Update test.
    * gcc.target/s390/hotpatch-5.c: Update test.
    * gcc.target/s390/hotpatch-6.c: Update test.
    * gcc.target/s390/hotpatch-7.c: Update test.
    * gcc.target/s390/hotpatch-8.c: Update test.
    * gcc.target/s390/hotpatch-9.c: Update test.
    * gcc.target/s390/hotpatch-compile-16.c: Update test.

From-SVN: r221794

28 files changed:
gcc/ChangeLog
gcc/config/s390/s390.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/s390/hotpatch-1.c
gcc/testsuite/gcc.target/s390/hotpatch-10.c
gcc/testsuite/gcc.target/s390/hotpatch-11.c
gcc/testsuite/gcc.target/s390/hotpatch-12.c
gcc/testsuite/gcc.target/s390/hotpatch-13.c
gcc/testsuite/gcc.target/s390/hotpatch-14.c
gcc/testsuite/gcc.target/s390/hotpatch-15.c
gcc/testsuite/gcc.target/s390/hotpatch-16.c
gcc/testsuite/gcc.target/s390/hotpatch-17.c
gcc/testsuite/gcc.target/s390/hotpatch-18.c
gcc/testsuite/gcc.target/s390/hotpatch-19.c
gcc/testsuite/gcc.target/s390/hotpatch-2.c
gcc/testsuite/gcc.target/s390/hotpatch-21.c
gcc/testsuite/gcc.target/s390/hotpatch-22.c
gcc/testsuite/gcc.target/s390/hotpatch-23.c
gcc/testsuite/gcc.target/s390/hotpatch-24.c
gcc/testsuite/gcc.target/s390/hotpatch-25.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/hotpatch-3.c
gcc/testsuite/gcc.target/s390/hotpatch-4.c
gcc/testsuite/gcc.target/s390/hotpatch-5.c
gcc/testsuite/gcc.target/s390/hotpatch-6.c
gcc/testsuite/gcc.target/s390/hotpatch-7.c
gcc/testsuite/gcc.target/s390/hotpatch-8.c
gcc/testsuite/gcc.target/s390/hotpatch-9.c
gcc/testsuite/gcc.target/s390/hotpatch-compile-16.c

index 36d83706a8de465e08d5fdf97019c1aaea4fb8a1..72389ee4e7a82f9ec5b6dfe5f21cb9c3632fb8fb 100644 (file)
@@ -1,3 +1,13 @@
+2015-03-31  Dominik Vogt  <vogt@linux.vnet.ibm.com>
+
+       * config/s390/s390.c (s390_function_num_hotpatch_hw): Allow hotpatching
+       nested functions.
+       (s390_reorg): Adapt to new signature of s390_function_num_hotpatch_hw.
+       (s390_asm_output_function_label): Adapt to new signature of
+       s390_function_num_hotpatch_hw
+       Optimise the code generating assembler output.
+       Add comments to assembler file.
+
 2015-03-31  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/65626
index d2b87046b3a4b39dd90e2962097cd4381a06c3ff..7d16048db8e206a7cf1bcc08c1e5275ba4d68c43 100644 (file)
@@ -5234,21 +5234,18 @@ print_shift_count_operand (FILE *file, rtx op)
     fprintf (file, "(%s)", reg_names[REGNO (base)]);
 }
 
-/* Returns false if the function should not be made hotpatchable.
-   Otherwise it assigns the number of NOP halfwords to be emitted
-   before and after the function label to hw_before and hw_after.
-   Both must not be NULL.  */
+/* Assigns the number of NOP halfwords to be emitted before and after the
+   function label to *HW_BEFORE and *HW_AFTER.  Both pointers must not be NULL.
+   If hotpatching is disabled for the function, the values are set to zero.
+*/
 
-static bool
+static void
 s390_function_num_hotpatch_hw (tree decl,
                               int *hw_before,
                               int *hw_after)
 {
   tree attr;
 
-  *hw_before = 0;
-  *hw_after = 0;
-
   attr = lookup_attribute ("hotpatch", DECL_ATTRIBUTES (decl));
 
   /* Handle the arguments of the hotpatch attribute.  The values
@@ -5267,18 +5264,6 @@ s390_function_num_hotpatch_hw (tree decl,
       *hw_before = s390_hotpatch_hw_before_label;
       *hw_after = s390_hotpatch_hw_after_label;
     }
-
-  if (*hw_before == 0 && *hw_after == 0)
-    return false;
-
-  if (decl_function_context (decl) != NULL_TREE)
-    {
-      warning_at (DECL_SOURCE_LOCATION (decl), OPT_mhotpatch_,
-                 "hotpatching is not compatible with nested functions");
-      return false;
-    }
-
-  return true;
 }
 
 /* Write the extra assembler code needed to declare a function properly.  */
@@ -5288,12 +5273,9 @@ s390_asm_output_function_label (FILE *asm_out_file, const char *fname,
                                tree decl)
 {
   int hw_before, hw_after;
-  bool hotpatch_p = (decl
-                    ? s390_function_num_hotpatch_hw (decl,
-                                                     &hw_before, &hw_after)
-                    : false);
 
-  if (hotpatch_p)
+  s390_function_num_hotpatch_hw (decl, &hw_before, &hw_after);
+  if (hw_before > 0)
     {
       unsigned int function_alignment;
       int i;
@@ -5301,22 +5283,35 @@ s390_asm_output_function_label (FILE *asm_out_file, const char *fname,
       /* Add a trampoline code area before the function label and initialize it
         with two-byte nop instructions.  This area can be overwritten with code
         that jumps to a patched version of the function.  */
-      for (i = 0; i < hw_before; i++)
-       asm_fprintf (asm_out_file, "\tnopr\t%%r7\n");
+      asm_fprintf (asm_out_file, "\tnopr\t%%r7"
+                  "\t# pre-label NOPs for hotpatch (%d halfwords)\n",
+                  hw_before);
+      for (i = 1; i < hw_before; i++)
+       fputs ("\tnopr\t%r7\n", asm_out_file);
+
       /* Note:  The function label must be aligned so that (a) the bytes of the
         following nop do not cross a cacheline boundary, and (b) a jump address
         (eight bytes for 64 bit targets, 4 bytes for 32 bit targets) can be
         stored directly before the label without crossing a cacheline
         boundary.  All this is necessary to make sure the trampoline code can
-        be changed atomically.  */
+        be changed atomically.
+        This alignment is done automatically using the FOUNCTION_BOUNDARY, but
+        if there are NOPs before the function label, the alignment is placed
+        before them.  So it is necessary to duplicate the alignment after the
+        NOPs.  */
       function_alignment = MAX (8, DECL_ALIGN (decl) / BITS_PER_UNIT);
       if (! DECL_USER_ALIGN (decl))
        function_alignment = MAX (function_alignment,
                                  (unsigned int) align_functions);
+      fputs ("\t# alignment for hotpatch\n", asm_out_file);
       ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (function_alignment));
     }
 
   ASM_OUTPUT_LABEL (asm_out_file, fname);
+  if (hw_after > 0)
+    asm_fprintf (asm_out_file,
+                "\t# post-label NOPs for hotpatch (%d halfwords)\n",
+                hw_after);
 }
 
 /* Output machine-dependent UNSPECs occurring in address constant X
@@ -11491,7 +11486,7 @@ s390_reorg (void)
     {
       rtx_insn *insn;
 
-      /* Inject nops for hotpatching. */
+      /* Insert NOPs for hotpatching. */
       for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
        {
          if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_FUNCTION_BEG)
index f8adda1955382c38ec4b986da31d16fd90369430..b6236369291e1819ad8558a4525e1e45340b1a05 100644 (file)
@@ -1,3 +1,31 @@
+2015-03-31  Dominik Vogt  <vogt@linux.vnet.ibm.com>
+
+       * gcc.target/s390/hotpatch-25.c: New test.
+       * gcc.target/s390/hotpatch-1.c: Update test.
+       * gcc.target/s390/hotpatch-10.c: Update test.
+       * gcc.target/s390/hotpatch-11.c: Update test.
+       * gcc.target/s390/hotpatch-12.c: Update test.
+       * gcc.target/s390/hotpatch-13.c: Update test.
+       * gcc.target/s390/hotpatch-14.c: Update test.
+       * gcc.target/s390/hotpatch-15.c: Update test.
+       * gcc.target/s390/hotpatch-16.c: Update test.
+       * gcc.target/s390/hotpatch-17.c: Update test.
+       * gcc.target/s390/hotpatch-18.c: Update test.
+       * gcc.target/s390/hotpatch-19.c: Update test.
+       * gcc.target/s390/hotpatch-2.c: Update test.
+       * gcc.target/s390/hotpatch-21.c: Update test.
+       * gcc.target/s390/hotpatch-22.c: Update test.
+       * gcc.target/s390/hotpatch-23.c: Update test.
+       * gcc.target/s390/hotpatch-24.c: Update test.
+       * gcc.target/s390/hotpatch-3.c: Update test.
+       * gcc.target/s390/hotpatch-4.c: Update test.
+       * gcc.target/s390/hotpatch-5.c: Update test.
+       * gcc.target/s390/hotpatch-6.c: Update test.
+       * gcc.target/s390/hotpatch-7.c: Update test.
+       * gcc.target/s390/hotpatch-8.c: Update test.
+       * gcc.target/s390/hotpatch-9.c: Update test.
+       * gcc.target/s390/hotpatch-compile-16.c: Update test.
+
 2015-03-31  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/65626
index 4e29817991eb04d5f79b70e5e15e6e69b24910fe..b14fa9010a8cce02218e3f41093c725948da1e73 100644 (file)
@@ -11,6 +11,9 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler-not "post-label NOPs" } } */
 /* { dg-final { scan-assembler-not "nopr\t%r7" } } */
 /* { dg-final { scan-assembler-not "nop\t0" } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
index 352c9d500d708ca4b5533b105f059cebc7f067b0..a990c4cad6e3421b17dbf04dc9db66ea3ded61bf 100644 (file)
@@ -11,6 +11,9 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler-not "post-label NOPs" } } */
 /* { dg-final { scan-assembler-not "nopr\t%r7" } } */
 /* { dg-final { scan-assembler-not "nop\t0" } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
index beb8738c653a58ffa15478778014f7111bd0f6dd..6f8a52b26d341b1d817f4d8cb95ec7f0d5a24350 100644 (file)
@@ -11,6 +11,8 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
+/* { dg-final { scan-assembler-not "post-label NOPs" } } */
 /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
 /* { dg-final { scan-assembler-not "nop\t0" } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
index d109478b04f509096923193c58cd18f4e2d6aa48..b73ca90fd3dd20de9e4d699eed7f0571a542820c 100644 (file)
@@ -11,6 +11,8 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler "pre-label.*(999 halfwords)" } } */
+/* { dg-final { scan-assembler-not "post-label NOPs" } } */
 /* { dg-final { scan-assembler-times "nopr\t%r7" 999 } } */
 /* { dg-final { scan-assembler-not "nop\t0" } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
index 9ac9f842d63396961da130ea363ed366d7997b5b..150667a1c66bf79a702dc70c57b56f80614116a0 100644 (file)
@@ -12,6 +12,10 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
+/* { dg-final { scan-assembler-not "post-label NOPs" } } */
 /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
 /* { dg-final { scan-assembler-not "nop\t0" } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
+/* { dg-final { scan-assembler "alignment for hotpatch" } } */
+/* { dg-final { scan-assembler-times "\.align\t8" 2 } } */
index 209e4ac5e47a3ba727f7d4e603d681871ba0e3e3..c5f118c1cc6d79b1e8a457dbe2cb9d491519034f 100644 (file)
@@ -12,6 +12,9 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
 /* { dg-final { scan-assembler-not "nopr\t%r7" } } */
 /* { dg-final { scan-assembler-times "nop\t0" 1 } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
index 109034ef019b78d625a18a62fb5ddda9c350cd5d..ef0fb746227e6ed4d684942815c80a925197f22b 100644 (file)
@@ -12,6 +12,8 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
+/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
 /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
 /* { dg-final { scan-assembler-times "nop\t0" 1 } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
index b01c1c32254497b0a7901375d9b2060bf1b70174..a34bf95c3cb539558e28d191c8c6c4daff388306 100644 (file)
@@ -12,6 +12,8 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
+/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
 /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
 /* { dg-final { scan-assembler-times "nop\t0" 1 } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
index ce0b950f8d3a5d57f1521216d3733b75629229c8..66ac725d16a042f423a1fa3dac840455ba97542b 100644 (file)
@@ -12,6 +12,9 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler-not "post-label NOPs" } } */
 /* { dg-final { scan-assembler-not "nopr\t%r7" } } */
 /* { dg-final { scan-assembler-not "nop\t0" } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
index 9a24d5e6a776edaf49d9c85e4ed6ea2d4e61a851..8b076a4e175fadc33876320aa29028d87a976750 100644 (file)
@@ -11,6 +11,9 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler-not "post-label NOPs" } } */
 /* { dg-final { scan-assembler-not "nopr\t%r7" } } */
 /* { dg-final { scan-assembler-not "nop\t0" } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
index 3586da29a896e5d5edf8cbd8f012a1295a8d9ff0..6993c7e855ced3d0b9a1b7fd247db0bf85692950 100644 (file)
@@ -18,6 +18,8 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
+/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
 /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
 /* { dg-final { scan-assembler-times "nop\t0" 1 } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
index 18be5aa23831a7e13ae6efaa3b561175546e346b..67189f8a28b1123f1c10fc5ac168721ea701759d 100644 (file)
@@ -11,7 +11,9 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(1 halfwords)" } } */
 /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
 /* { dg-final { scan-assembler-not "nop\t0" } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
-/* { dg-final { scan-assembler-times "\.align\t8" 2 } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
index d72dee318cfb574bad6995ddc9d5732cd65837f0..e90999008550ff2020be68580b0204e5802b6ba3 100644 (file)
@@ -11,4 +11,4 @@ void __attribute__ ((aligned(512))) hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
-/* { dg-final { scan-assembler-times "\.align\t512" 2 } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
index 650746610238c22435044166c79a560aba00b1be..d89d7790426f680061a6955103790beeca7c9e84 100644 (file)
@@ -11,4 +11,4 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
-/* { dg-final { scan-assembler-times "\.align\t1024" 2 } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
index 7dce5b8b0fa3a1bc4f48dab9b9f66a00685151f9..1e05d123c22a64770099f6d295338cfbf8c9e16d 100644 (file)
@@ -11,4 +11,4 @@ void __attribute__ ((aligned(2048))) hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
-/* { dg-final { scan-assembler-times "\.align\t2048" 2 } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
index 4d6815cb516171e7a39db2f3f6dd21b614a8eca6..fc6427479d8edbcb6177156f42a337115a42f8a0 100644 (file)
@@ -11,4 +11,4 @@ void __attribute__ ((aligned(4096))) hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
-/* { dg-final { scan-assembler-times "\.align\t4096" 2 } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-25.c b/gcc/testsuite/gcc.target/s390/hotpatch-25.c
new file mode 100644 (file)
index 0000000..e9257e3
--- /dev/null
@@ -0,0 +1,33 @@
+/* Functional tests for the function hotpatching feature.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch" } */
+
+typedef long (*fn_t)(void);
+
+__attribute__ ((hotpatch(1,2)))
+fn_t outer(void)
+{
+  __attribute__ ((hotpatch(4,8)))
+  long nested1(void)
+  {
+    __attribute__ ((hotpatch(16,32)))
+    long nested2(void)
+    {
+      return 2;
+    }
+    return (long)(void *)nested2;
+  }
+
+  return nested1;
+}
+
+/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
+/* { dg-final { scan-assembler "pre-label.*(4 halfwords)" } } */
+/* { dg-final { scan-assembler "pre-label.*(16 halfwords)" } } */
+/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
+/* { dg-final { scan-assembler "post-label.*(8 halfwords)" } } */
+/* { dg-final { scan-assembler "post-label.*(32 halfwords)" } } */
+/* { dg-final { scan-assembler-times "alignment for hotpatch" 3 } } */
+/* { dg-final { scan-assembler-times "\.align\t8" 6 } } */
+/* { dg-final { scan-assembler "nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr" } } */
index 8a2ab538e8dccff0e1aec9b0f6f131065a9e5d34..ec4a978f72eaffe285eb2af2a1178cc69dad0d9c 100644 (file)
@@ -11,6 +11,8 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
 /* { dg-final { scan-assembler-not "nopr\t%r7" } } */
 /* { dg-final { scan-assembler-times "nop\t0" 1 } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
index 9a69459797e27e6d32689845cbc262793cdbd0d7..d55e71d3d69c53faf7a6f872fd3dea01baf1dcc4 100644 (file)
@@ -11,6 +11,8 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(3 halfwords)" } } */
 /* { dg-final { scan-assembler-not "nopr\t%r7" } } */
 /* { dg-final { scan-assembler-not "nop\t0" } } */
 /* { dg-final { scan-assembler-times "brcl\t0, 0" 1 } } */
index b3d990f499a3fb3f5306ac7b1e9ecca2376a3243..f77d83aea07132c3b0710dd504f37d417669ed10 100644 (file)
@@ -11,6 +11,8 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(4 halfwords)" } } */
 /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
 /* { dg-final { scan-assembler-not "nop\t0" } } */
 /* { dg-final { scan-assembler-times "brcl\t0, 0" 1 } } */
index 10ba5580b0d4c4427e363ff616fb3d79113aa53e..330cf5d011ff129661ddd0798aa927bebebb6bbf 100644 (file)
@@ -11,6 +11,8 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(5 halfwords)" } } */
 /* { dg-final { scan-assembler-not "nopr\t%r7" } } */
 /* { dg-final { scan-assembler-times "nop\t0" 1 } } */
 /* { dg-final { scan-assembler-times "brcl\t0, 0" 1 } } */
index edf67d3e22ec29d2b12c11bcfbdf79d5f2c83cc7..2f24e3cc15228b826f29044dd2ab0e68fff448b9 100644 (file)
@@ -11,6 +11,8 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(6 halfwords)" } } */
 /* { dg-final { scan-assembler-not "nopr\t%r7" } } */
 /* { dg-final { scan-assembler-not "nop\t0" } } */
 /* { dg-final { scan-assembler-times "brcl\t0, 0" 2 } } */
index a179c4a633cbbecad366c6e1865913d559d1d00a..7b266bd463e18cac1bfc39014d9be8fa86e189d2 100644 (file)
@@ -11,6 +11,9 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(3 halfwords)" } } */
 /* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
 /* { dg-final { scan-assembler-times "nop\t0" 1 } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
+/* { dg-final { scan-assembler-not "alignment for hotpatch" } } */
index c4e21f2d3defdd86e3acd0d54642c14202f421dc..c0ad319c0bb758210c4d78d14826872f68247bf9 100644 (file)
@@ -11,6 +11,8 @@ void hp1(void)
 }
 
 /* Check number of occurences of certain instructions.  */
+/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
+/* { dg-final { scan-assembler "post-label.*(4 halfwords)" } } */
 /* { dg-final { scan-assembler-not "nopr\t%r7" } } */
 /* { dg-final { scan-assembler-times "nop\t0" 2 } } */
 /* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
index 3c5c782720628106fd47601c818c6f3751e0704f..2e8291ede34540b59ef619141ec7245e3808ca11 100644 (file)
@@ -1,4 +1,4 @@
-/* A warning will be issued when requesting hotpatching on a nested function.  */
+/* Functional tests for the function hotpatching feature.  */
 
 /* { dg-do compile } */
 /* { dg-options "-O3 -mzarch" } */
@@ -17,7 +17,7 @@ fn_t hp1(void)
 fn_t hp2(void)
 {
   __attribute__ ((hotpatch(1,2)))
-  int nested2(void) /* { dg-warning "hotpatching is not compatible with nested functions" } */
+  int nested2(void)
   { return 2; }
 
   return nested2;