This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix misuse of always_inline attribute in 3 hotpatch tests


On Mon, Jun 01, 2015 at 12:29:31PM +0200, Jakub Jelinek wrote:
> On Mon, Jun 01, 2015 at 11:20:29AM +0100, Dominik Vogt wrote:
> > There are many more
> > test cases that forget the "inline" and filter the warning with
> > "-Wno-attributes".  I'll post an add-on patch later after testing
> > it.
> 
> Well, we need some testcases that actually verify we don't ICE
> when the inline keyword is not missed.
> But if you mean tests like e.g. i386/mpx/, or some other s390/
> tests, then indeed, those should be fixed.

Patches attached, split into three separate parts:

0001-*
  Tests which I'm quite sure that the inline keyword should be
  added.

0002-*
  Specific inline tests that lack the inline keyword, but that may
  be on purpose.  Unfortunately the comments in the tests don't
  allow to decide this; the tests need to be check by someone who
  knows what they are about.

0003-*
  Tests for specific problem reports.  The inline keyword was
  missing in the original code in the PR, fixing that might break
  the regression test.  On the other hand the regression test
  relies on undefined behaviour.  I'm not sure what should be done
  about these test cases.

gcc/testsuite/ChangeLog
-----------------------

2015-06-02  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* gcc/testsuite/g++.dg/ipa/devirt-c-7.C:  Add "inline" to functions with
	attribute((always_inline)).  Remove -Wnoattribues from compiler options.
	* gcc/testsuite/g++.dg/tree-prof/morefunc.C: Likewise.
	* gcc/testsuite/g++.dg/tree-prof/reorder.C: Likewise.
	* gcc/testsuite/gcc.dg/20051201-1.c: Likewise.
	* gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c: Likewise.
	* gcc/testsuite/gcc.dg/uninit-pred-5_a.c: Likewise.
	* gcc/testsuite/gcc.dg/uninit-pred-5_b.c: Likewise.
	* gcc/testsuite/gcc.target/i386/chkp-always_inline.c: Likewise.
	* gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-lbv.c: Likewise.
	* gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-nov.c: Likewise.
	* gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-ubv.c: Likewise.
	* gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-lbv.c: Likewise.
	* gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-nov.c: Likewise.
	* gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-ubv.c: Likewise.
	* gcc/testsuite/gcc.target/s390/20090223-1.c: Likewise.

2015-06-02  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* gcc/testsuite/gcc.dg/inline-22.c:  Add "inline" to functions with
	attribute((always_inline)).  Remove -Wnoattribues from compiler options.
	* gcc/testsuite/gcc.dg/inline-36.c: Likewise.
	* gcc/testsuite/gcc.dg/inline-37.c: Likewise.
	* gcc/testsuite/gcc.dg/inline-38.c: Likewise.
	* gcc/testsuite/gcc.dg/inline-39.c: Likewise.

2015-06-02  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* gcc/testsuite/g++.dg/torture/pr51436.C: Add "inline" to functions with
	attribute((always_inline)).
	* gcc/testsuite/gcc.c-torture/execute/pr33992.c: Likewise.
	* gcc/testsuite/gcc.dg/tm/pr52141.c: Likewise.
	* gcc/testsuite/gcc.dg/torture/pr39204.c: Likewise.
	* gcc/testsuite/gcc.dg/debug/pr41264-1.c: Likewise.  Remove
	-Wnoattribues from compiler options
	* gcc/testsuite/gcc.dg/tree-ssa/pr40087.c: Likewise.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany
>From b0d52bdc8ea046ab65ec47dda1d1e14e5119cee8 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@linux.vnet.ibm.com>
Date: Tue, 2 Jun 2015 08:12:44 +0100
Subject: [PATCH 1/3] Add "inline" to functions with the always_inline
 attribute. I

---
 gcc/testsuite/g++.dg/ipa/devirt-c-7.C                 | 4 ++--
 gcc/testsuite/g++.dg/tree-prof/morefunc.C             | 6 +++---
 gcc/testsuite/g++.dg/tree-prof/reorder.C              | 6 +++---
 gcc/testsuite/gcc.dg/20051201-1.c                     | 6 +++---
 gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c       | 4 ++--
 gcc/testsuite/gcc.dg/uninit-pred-5_a.c                | 4 ++--
 gcc/testsuite/gcc.dg/uninit-pred-5_b.c                | 4 ++--
 gcc/testsuite/gcc.target/i386/chkp-always_inline.c    | 4 ++--
 gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-lbv.c | 4 +---
 gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-nov.c | 4 +---
 gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-ubv.c | 4 +---
 gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-lbv.c | 4 +---
 gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-nov.c | 4 +---
 gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-ubv.c | 4 +---
 gcc/testsuite/gcc.target/s390/20090223-1.c            | 6 +++---
 15 files changed, 28 insertions(+), 40 deletions(-)

diff --git a/gcc/testsuite/g++.dg/ipa/devirt-c-7.C b/gcc/testsuite/g++.dg/ipa/devirt-c-7.C
index 2e76cbe..06fbb66 100644
--- a/gcc/testsuite/g++.dg/ipa/devirt-c-7.C
+++ b/gcc/testsuite/g++.dg/ipa/devirt-c-7.C
@@ -2,7 +2,7 @@
    object within another one when looking for dynamic type change .  */
 /* { dg-do run } */
 /* { dg-require-effective-target nonpic } */
-/* { dg-options "-O3 -Wno-attributes"  } */
+/* { dg-options "-O3"  } */
 
 extern "C" void abort (void);
 namespace std {
@@ -60,7 +60,7 @@ int __attribute__ ((noinline,noclone)) get_input(void)
   return 1;
 }
 
-__attribute__ ((always_inline)) C::C ()
+inline __attribute__ ((always_inline)) C::C ()
 {
 }
 
diff --git a/gcc/testsuite/g++.dg/tree-prof/morefunc.C b/gcc/testsuite/g++.dg/tree-prof/morefunc.C
index 722b4b0..209e6f5 100644
--- a/gcc/testsuite/g++.dg/tree-prof/morefunc.C
+++ b/gcc/testsuite/g++.dg/tree-prof/morefunc.C
@@ -1,4 +1,4 @@
-/* { dg-options "-O2 -fno-devirtualize --param=profile-func-internal-id=0 -fdump-ipa-profile -Wno-attributes -Wno-coverage-mismatch" } */
+/* { dg-options "-O2 -fno-devirtualize --param=profile-func-internal-id=0 -fdump-ipa-profile -Wno-coverage-mismatch" } */
 #include "reorder_class1.h"
 #include "reorder_class2.h"
 
@@ -15,7 +15,7 @@ new_func (int i)
 }
 #endif
 
-static __attribute__((always_inline))
+static inline __attribute__((always_inline))
 void test1 (A *tc)
 {
   int i;
@@ -24,7 +24,7 @@ void test1 (A *tc)
    if (g<100) g++;
 }
 
-static __attribute__((always_inline))
+static inline __attribute__((always_inline))
 void test2 (B *tc)
 {
   int i;
diff --git a/gcc/testsuite/g++.dg/tree-prof/reorder.C b/gcc/testsuite/g++.dg/tree-prof/reorder.C
index 41d6a15..f1dd7e8 100644
--- a/gcc/testsuite/g++.dg/tree-prof/reorder.C
+++ b/gcc/testsuite/g++.dg/tree-prof/reorder.C
@@ -1,4 +1,4 @@
-/* { dg-options "-O2 -fno-devirtualize --param=profile-func-internal-id=0 -fdump-ipa-profile -Wno-coverage-mismatch -Wno-attributes" } */
+/* { dg-options "-O2 -fno-devirtualize --param=profile-func-internal-id=0 -fdump-ipa-profile -Wno-coverage-mismatch" } */
 
 #ifdef _PROFILE_USE
 #include "reorder_class1.h"
@@ -9,7 +9,7 @@
 #endif
 
 int g;
-static __attribute__((always_inline))
+static inline __attribute__((always_inline))
 void test1 (A *tc)
 {
   int i;
@@ -18,7 +18,7 @@ void test1 (A *tc)
    if (g<100) g++;
 }
 
-static __attribute__((always_inline))
+static inline __attribute__((always_inline))
 void test2 (B *tc)
 {
   int i;
diff --git a/gcc/testsuite/gcc.dg/20051201-1.c b/gcc/testsuite/gcc.dg/20051201-1.c
index c029205..792ce95 100644
--- a/gcc/testsuite/gcc.dg/20051201-1.c
+++ b/gcc/testsuite/gcc.dg/20051201-1.c
@@ -3,14 +3,14 @@
 
 /* { dg-do compile } */
 /* { dg-require-profiling "-fprofile-generate" } */
-/* { dg-options "-O1 -fprofile-generate -Wno-attributes" } */
+/* { dg-options "-O1 -fprofile-generate" } */
 
-static __attribute__ ((always_inline)) void 
+static __attribute__ ((always_inline)) inline void
 baz ()
 {
 }
 
-static __attribute__ ((always_inline)) int
+static __attribute__ ((always_inline)) inline int
 bar ()
 {
  out:
diff --git a/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c b/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c
index 4846dd6..ae30013 100644
--- a/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-fdump-tree-ealias -Wno-attributes" } */
+/* { dg-options "-fdump-tree-ealias" } */
 /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
 
 struct X
@@ -12,7 +12,7 @@ struct X
     } y;
 };
 int i;
-static int __attribute__((always_inline))
+static inline int __attribute__((always_inline))
 foo (struct X *x)
 {
   struct Y y = x->y;
diff --git a/gcc/testsuite/gcc.dg/uninit-pred-5_a.c b/gcc/testsuite/gcc.dg/uninit-pred-5_a.c
index 5ced897..55c7298 100644
--- a/gcc/testsuite/gcc.dg/uninit-pred-5_a.c
+++ b/gcc/testsuite/gcc.dg/uninit-pred-5_a.c
@@ -1,12 +1,12 @@
 /* { dg-do compile } */
-/* { dg-options "-Wuninitialized -Wno-attributes -O2" } */
+/* { dg-options "-Wuninitialized -O2" } */
 
 int g;
 int bar();
 int blah(int);
 void t(int);
 
-static int
+static inline int
 __attribute__((always_inline)) 
 foo (int n, int* v, int r)
 {
diff --git a/gcc/testsuite/gcc.dg/uninit-pred-5_b.c b/gcc/testsuite/gcc.dg/uninit-pred-5_b.c
index e8da256..73fe6d8 100644
--- a/gcc/testsuite/gcc.dg/uninit-pred-5_b.c
+++ b/gcc/testsuite/gcc.dg/uninit-pred-5_b.c
@@ -1,12 +1,12 @@
 /* { dg-do compile } */
-/* { dg-options "-Wuninitialized -Wno-attributes -O2" } */
+/* { dg-options "-Wuninitialized -O2" } */
 
 int g;
 int bar();
 int blah(int);
 void t(int);
 
-static int
+static inline int
 __attribute__((always_inline)) 
 foo (int n, int* v, int r)
 {
diff --git a/gcc/testsuite/gcc.target/i386/chkp-always_inline.c b/gcc/testsuite/gcc.target/i386/chkp-always_inline.c
index 26e80fe..a0d03c5 100644
--- a/gcc/testsuite/gcc.target/i386/chkp-always_inline.c
+++ b/gcc/testsuite/gcc.target/i386/chkp-always_inline.c
@@ -1,8 +1,8 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target mpx } */
-/* { dg-options "-fcheck-pointer-bounds -mmpx -O2 -Wno-attributes" } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -O2" } */
 
-static __attribute__((always_inline)) int f1 (int *p)
+static inline __attribute__((always_inline)) int f1 (int *p)
 {
   return *p;
 }
diff --git a/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-lbv.c b/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-lbv.c
index 5aa6007..c413886 100644
--- a/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-lbv.c
+++ b/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-lbv.c
@@ -2,8 +2,6 @@
 /* { dg-shouldfail "bounds violation" } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
 
-/* { dg-additional-options "-Wno-attributes" } */
-
 #define SHOULDFAIL
 
 #include "mpx-check.h"
@@ -25,7 +23,7 @@ foo2 (int i1, int *p1, ...)
   return res;
 }
 
-static __attribute__((always_inline)) int
+static inline __attribute__((always_inline)) int
 foo1 (int *p1, ...)
 {
   return foo2 (10, p1, __va_arg_pack ());
diff --git a/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-nov.c b/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-nov.c
index 55c65d9..129cbcc 100644
--- a/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-nov.c
+++ b/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-nov.c
@@ -1,8 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
 
-/* { dg-additional-options "-Wno-attributes" } */
-
 #include "mpx-check.h"
 #include <stdarg.h>
 
@@ -22,7 +20,7 @@ foo2 (int i1, int *p1, ...)
   return res;
 }
 
-static __attribute__((always_inline)) int
+static inline __attribute__((always_inline)) int
 foo1 (int *p1, ...)
 {
   return foo2 (10, p1, __va_arg_pack ());
diff --git a/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-ubv.c b/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-ubv.c
index 11b498e..c0164e9 100644
--- a/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-ubv.c
+++ b/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-1-ubv.c
@@ -2,8 +2,6 @@
 /* { dg-shouldfail "bounds violation" } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
 
-/* { dg-additional-options "-Wno-attributes" } */
-
 #define SHOULDFAIL
 
 #include "mpx-check.h"
@@ -25,7 +23,7 @@ foo2 (int i1, int *p1, ...)
   return res;
 }
 
-static __attribute__((always_inline)) int
+static inline __attribute__((always_inline)) int
 foo1 (int *p1, ...)
 {
   return foo2 (10, p1, __va_arg_pack ());
diff --git a/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-lbv.c b/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-lbv.c
index 9f1941d..d060937 100644
--- a/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-lbv.c
+++ b/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-lbv.c
@@ -2,8 +2,6 @@
 /* { dg-shouldfail "bounds violation" } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
 
-/* { dg-additional-options "-Wno-attributes" } */
-
 #define SHOULDFAIL
 
 #include "mpx-check.h"
@@ -27,7 +25,7 @@ foo2 (int i1, int *p1, ...)
   return res;
 }
 
-static __attribute__((always_inline)) int
+static inline __attribute__((always_inline)) int
 foo1 (int *p1, ...)
 {
   return foo2 (10, p1, __va_arg_pack ());
diff --git a/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-nov.c b/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-nov.c
index 903afbc..1d381fd 100644
--- a/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-nov.c
+++ b/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-nov.c
@@ -1,8 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
 
-/* { dg-additional-options "-Wno-attributes" } */
-
 #include "mpx-check.h"
 #include <stdarg.h>
 
@@ -24,7 +22,7 @@ foo2 (int i1, int *p1, ...)
   return res;
 }
 
-static __attribute__((always_inline)) int
+static inline __attribute__((always_inline)) int
 foo1 (int *p1, ...)
 {
   return foo2 (10, p1, __va_arg_pack ());
diff --git a/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-ubv.c b/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-ubv.c
index f5d842a..cece782 100644
--- a/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-ubv.c
+++ b/gcc/testsuite/gcc.target/i386/mpx/va-arg-pack-2-ubv.c
@@ -2,8 +2,6 @@
 /* { dg-shouldfail "bounds violation" } */
 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
 
-/* { dg-additional-options "-Wno-attributes" } */
-
 #define SHOULDFAIL
 
 #include "mpx-check.h"
@@ -27,7 +25,7 @@ foo2 (int i1, int *p1, ...)
   return res;
 }
 
-static __attribute__((always_inline)) int
+static inline __attribute__((always_inline)) int
 foo1 (int *p1, ...)
 {
   return foo2 (10, p1, __va_arg_pack ());
diff --git a/gcc/testsuite/gcc.target/s390/20090223-1.c b/gcc/testsuite/gcc.target/s390/20090223-1.c
index 18355f9..f22be0a 100644
--- a/gcc/testsuite/gcc.target/s390/20090223-1.c
+++ b/gcc/testsuite/gcc.target/s390/20090223-1.c
@@ -3,11 +3,11 @@
    register asm ("0").  */
 
 /* { dg-do run } */
-/* { dg-options "-O2 -Wno-attributes -Wno-implicit-function-declaration" } */
+/* { dg-options "-O2 -Wno-implicit-function-declaration" } */
 
 extern void abort (void);
 
-static unsigned char __attribute__ ((always_inline))
+static inline unsigned char __attribute__ ((always_inline))
 mytoupper (unsigned char c)
 {
   if (c >= 'a' && c <= 'z')
@@ -15,7 +15,7 @@ mytoupper (unsigned char c)
   return c;
 }
 
-static unsigned long __attribute__ ((always_inline))
+static inline unsigned long __attribute__ ((always_inline))
 strlen (const char *s)
 {
   register unsigned long r0 asm ("0");
-- 
2.3.0

>From b6c61c692098a4894576700490c1c9a98c53ffa8 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@linux.vnet.ibm.com>
Date: Tue, 2 Jun 2015 08:12:44 +0100
Subject: [PATCH 2/3] Add "inline" to functions with the always_inline
 attribute. II

---
 gcc/testsuite/gcc.dg/inline-22.c | 6 +++---
 gcc/testsuite/gcc.dg/inline-36.c | 4 ++--
 gcc/testsuite/gcc.dg/inline-37.c | 4 ++--
 gcc/testsuite/gcc.dg/inline-38.c | 4 ++--
 gcc/testsuite/gcc.dg/inline-39.c | 4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/inline-22.c b/gcc/testsuite/gcc.dg/inline-22.c
index 6795c5f..08511b5 100644
--- a/gcc/testsuite/gcc.dg/inline-22.c
+++ b/gcc/testsuite/gcc.dg/inline-22.c
@@ -1,8 +1,8 @@
 /* { dg-do compile } */
-/* { dg-options "-funit-at-a-time -Wno-attributes" } */
+/* { dg-options "-funit-at-a-time" } */
 /* { dg-add-options bind_pic_locally } */
 /* Verify we can inline without a complete prototype and with promoted
    arguments.  See also PR32492.  */
-__attribute__((always_inline)) void f1() {}
-__attribute__((always_inline)) void f2(char x) {}
+__attribute__((always_inline)) inline void f1() {}
+__attribute__((always_inline)) inline void f2(char x) {}
 void f3() { f1(); f2(0); }
diff --git a/gcc/testsuite/gcc.dg/inline-36.c b/gcc/testsuite/gcc.dg/inline-36.c
index 0301381..993cfaf 100644
--- a/gcc/testsuite/gcc.dg/inline-36.c
+++ b/gcc/testsuite/gcc.dg/inline-36.c
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-optimized -fdisable-tree-einline -fdisable-ipa-inline -Wno-attributes" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdisable-tree-einline -fdisable-ipa-inline" } */
 int g;
-__attribute__((always_inline)) void bar (void)
+__attribute__((always_inline)) inline void bar (void)
 {
   g++;
 }
diff --git a/gcc/testsuite/gcc.dg/inline-37.c b/gcc/testsuite/gcc.dg/inline-37.c
index e3b1df4..7233e1d 100644
--- a/gcc/testsuite/gcc.dg/inline-37.c
+++ b/gcc/testsuite/gcc.dg/inline-37.c
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-optimized -fdisable-tree-einline=0:100 -fdisable-ipa-inline -Wno-attributes" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdisable-tree-einline=0:100 -fdisable-ipa-inline" } */
 int g;
-__attribute__((always_inline)) void bar (void)
+__attribute__((always_inline)) inline void bar (void)
 {
   g++;
 }
diff --git a/gcc/testsuite/gcc.dg/inline-38.c b/gcc/testsuite/gcc.dg/inline-38.c
index 773c301..15bc2e6 100644
--- a/gcc/testsuite/gcc.dg/inline-38.c
+++ b/gcc/testsuite/gcc.dg/inline-38.c
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-optimized -fdisable-tree-einline=foo,foo2 -fdisable-ipa-inline -Wno-attributes" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdisable-tree-einline=foo,foo2 -fdisable-ipa-inline" } */
 int g;
-__attribute__((always_inline)) void bar (void)
+__attribute__((always_inline)) inline void bar (void)
 {
   g++;
 }
diff --git a/gcc/testsuite/gcc.dg/inline-39.c b/gcc/testsuite/gcc.dg/inline-39.c
index ebd57e9..3db5054 100644
--- a/gcc/testsuite/gcc.dg/inline-39.c
+++ b/gcc/testsuite/gcc.dg/inline-39.c
@@ -1,8 +1,8 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-optimized -fdisable-tree-einline=foo2 -fdisable-ipa-inline -Wno-attributes" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdisable-tree-einline=foo2 -fdisable-ipa-inline" } */
 /* { dg-add-options bind_pic_locally } */
 int g;
-__attribute__((always_inline)) void bar (void)
+__attribute__((always_inline)) inline void bar (void)
 {
   g++;
 }
-- 
2.3.0

>From cf2a780ef4d47a2f91f5fc6ca0333c2b386e2235 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@linux.vnet.ibm.com>
Date: Tue, 2 Jun 2015 08:12:44 +0100
Subject: [PATCH 3/3] Add "inline" to functions with the always_inline
 attribute. III

---
 gcc/testsuite/g++.dg/torture/pr51436.C        | 3 ++-
 gcc/testsuite/gcc.c-torture/execute/pr33992.c | 2 +-
 gcc/testsuite/gcc.dg/debug/pr41264-1.c        | 3 +--
 gcc/testsuite/gcc.dg/tm/pr52141.c             | 2 +-
 gcc/testsuite/gcc.dg/torture/pr39204.c        | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/pr40087.c       | 4 ++--
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gcc/testsuite/g++.dg/torture/pr51436.C b/gcc/testsuite/g++.dg/torture/pr51436.C
index 43d6c73..7a5fcb4 100644
--- a/gcc/testsuite/g++.dg/torture/pr51436.C
+++ b/gcc/testsuite/g++.dg/torture/pr51436.C
@@ -3,7 +3,8 @@
 typedef __SIZE_TYPE__ size_t;
 extern "C" void *memcpy (void *, __const void *, size_t);
 template < class Dest, class Source > struct BitCastHelper {
-    static Dest cast (const Source & source) __attribute__ ((always_inline)) {
+  static Dest cast (const Source & source)
+    __attribute__ ((always_inline)) {
 	Dest dest;
 	memcpy (0, &source, sizeof dest);
     }
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr33992.c b/gcc/testsuite/gcc.c-torture/execute/pr33992.c
index 92b80e5..b0f0a26 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr33992.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr33992.c
@@ -7,7 +7,7 @@ bar (unsigned long long i)
     abort ();
 }
 
-static void __attribute__((always_inline))
+static inline void __attribute__((always_inline))
 foo (unsigned long long *r)
 {
   int i;
diff --git a/gcc/testsuite/gcc.dg/debug/pr41264-1.c b/gcc/testsuite/gcc.dg/debug/pr41264-1.c
index 7d03e51..d2828bf 100644
--- a/gcc/testsuite/gcc.dg/debug/pr41264-1.c
+++ b/gcc/testsuite/gcc.dg/debug/pr41264-1.c
@@ -1,12 +1,11 @@
 /* { dg-do compile } */
-/* { dg-options "-Wno-attributes" } */
 
 #if (__SIZEOF_INT__ <= 2)	
 typedef unsigned long hashval_t;
 #else
 typedef unsigned int hashval_t;
 #endif
-static hashval_t __attribute__((always_inline))
+static inline hashval_t __attribute__((always_inline))
 iterative_hash_host_wide_int (long val, hashval_t val2)
 {
   hashval_t a = (hashval_t) val;
diff --git a/gcc/testsuite/gcc.dg/tm/pr52141.c b/gcc/testsuite/gcc.dg/tm/pr52141.c
index 0dabf76..9d54298 100644
--- a/gcc/testsuite/gcc.dg/tm/pr52141.c
+++ b/gcc/testsuite/gcc.dg/tm/pr52141.c
@@ -2,7 +2,7 @@
 /* { dg-options "-fgnu-tm -O0 -w" } */
 
 __attribute__((always_inline))
-static void asmfunc(void)
+static inline void asmfunc(void)
 {
   __asm__ (""); /* { dg-error "asm not allowed in .transaction_safe" } */
 }
diff --git a/gcc/testsuite/gcc.dg/torture/pr39204.c b/gcc/testsuite/gcc.dg/torture/pr39204.c
index 1389a52..994ca60 100644
--- a/gcc/testsuite/gcc.dg/torture/pr39204.c
+++ b/gcc/testsuite/gcc.dg/torture/pr39204.c
@@ -112,7 +112,7 @@ static void _close_html_file (FILE * file)
   for (f = 0; _word_substitution[f]; f++)
     ;
 }
-static __attribute__((always_inline))
+static inline __attribute__((always_inline))
 char * _do_text_substitution (char *input)
 {
   int start, end, middle, f;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr40087.c b/gcc/testsuite/gcc.dg/tree-ssa/pr40087.c
index 98d2437..123ce0c 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr40087.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr40087.c
@@ -1,9 +1,9 @@
 /* { dg-do run } */
-/* { dg-options "-O1 -Wno-attributes" } */
+/* { dg-options "-O1" } */
 
 extern void abort (void);
 
-static void __attribute__((always_inline))
+static inline void __attribute__((always_inline))
 reverse(int *first, int *last)
 {
   if (first == last--) 
-- 
2.3.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]