diff mbox

Fix misuse of always_inline attribute in 3 hotpatch tests

Message ID 20150602073034.GA18488@linux.vnet.ibm.com
State New
Headers show

Commit Message

Dominik Vogt June 2, 2015, 7:30 a.m. UTC
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 ^_^  ^_^
diff mbox

Patch

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