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: [RFC PATCH] avoid applying attributes to explicit specializations (PR 83871)


On Mon, Feb 26, 2018 at 09:19:56PM -0700, Martin Sebor wrote:
> 	PR c++/83871
> 	PR c++/83503
> 	* g++.dg/Wmissing-attributes.C: New test.
> 	* g++.dg/ext/attr-const-pure.C: New test.
> 	* g++.dg/ext/attr-const.C: New test.
> 	* g++.dg/ext/attr-deprecated-2.C: New test.
> 	* g++.dg/ext/attr-malloc-2.C: New test.
> 	* g++.dg/ext/attr-malloc.C: New test.
> 	* g++.dg/ext/attr-noinline-2.C: New test.
> 	* g++.dg/ext/attr-noinline.C: New test.
> 	* g++.dg/ext/attr-nonnull.C: New test.
> 	* g++.dg/ext/attr-noreturn-2.C: New test.
> 	* g++.dg/ext/attr-noreturn.C: New test.
> 	* g++.dg/ext/attr-nothrow-2.C: New test.
> 	* g++.dg/ext/attr-nothrow.C: New test.
> 	* g++.dg/ext/attr-optimize.C: New test.
> 	* g++.dg/ext/attr-pure.C: New test.
> 	* g++.dg/ext/attr-returns-nonnull.C: New test.
> 	* g++.dg/ext/attr-warning.C: New test.

I'm getting:
+UNRESOLVED: g++.dg/ext/attr-const.C  -std=gnu++11  scan-tree-dump-not optimized "test_const_none_failed"
+UNRESOLVED: g++.dg/ext/attr-const.C  -std=gnu++11  scan-tree-dump-not optimized "test_const_none_failed"
+UNRESOLVED: g++.dg/ext/attr-const.C  -std=gnu++11  scan-tree-dump-not optimized "test_none_const_failed"
+UNRESOLVED: g++.dg/ext/attr-const.C  -std=gnu++11  scan-tree-dump-not optimized "test_none_const_failed"
+UNRESOLVED: g++.dg/ext/attr-const.C  -std=gnu++14  scan-tree-dump-not optimized "test_const_none_failed"
+UNRESOLVED: g++.dg/ext/attr-const.C  -std=gnu++14  scan-tree-dump-not optimized "test_const_none_failed"
+UNRESOLVED: g++.dg/ext/attr-const.C  -std=gnu++14  scan-tree-dump-not optimized "test_none_const_failed"
+UNRESOLVED: g++.dg/ext/attr-const.C  -std=gnu++14  scan-tree-dump-not optimized "test_none_const_failed"
+UNRESOLVED: g++.dg/ext/attr-const.C  -std=gnu++98  scan-tree-dump-not optimized "test_const_none_failed"
+UNRESOLVED: g++.dg/ext/attr-const.C  -std=gnu++98  scan-tree-dump-not optimized "test_const_none_failed"
+UNRESOLVED: g++.dg/ext/attr-const.C  -std=gnu++98  scan-tree-dump-not optimized "test_none_const_failed"
+UNRESOLVED: g++.dg/ext/attr-const.C  -std=gnu++98  scan-tree-dump-not optimized "test_none_const_failed"
+UNRESOLVED: g++.dg/ext/attr-noinline-2.C  -std=gnu++11  scan-tree-dump-not optimized" "fnoinline_always_inline<Special> *\\\\(\\\\);"
+UNRESOLVED: g++.dg/ext/attr-noinline-2.C  -std=gnu++14  scan-tree-dump-not optimized" "fnoinline_always_inline<Special> *\\\\(\\\\);"
+UNRESOLVED: g++.dg/ext/attr-noinline-2.C  -std=gnu++98  scan-tree-dump-not optimized" "fnoinline_always_inline<Special> *\\\\(\\\\);"
+UNRESOLVED: g++.dg/ext/attr-noinline.C  -std=gnu++11  scan-tree-dump-not optimized" "fnoinline_always_inline<Special> *\\\\(\\\\);"
+UNRESOLVED: g++.dg/ext/attr-noinline.C  -std=gnu++11  scan-tree-dump-not optimized" "fnone_always_inline<Special> *\\\\(\\\\);"
+UNRESOLVED: g++.dg/ext/attr-noinline.C  -std=gnu++14  scan-tree-dump-not optimized" "fnoinline_always_inline<Special> *\\\\(\\\\);"
+UNRESOLVED: g++.dg/ext/attr-noinline.C  -std=gnu++14  scan-tree-dump-not optimized" "fnone_always_inline<Special> *\\\\(\\\\);"
+UNRESOLVED: g++.dg/ext/attr-noinline.C  -std=gnu++98  scan-tree-dump-not optimized" "fnoinline_always_inline<Special> *\\\\(\\\\);"
+UNRESOLVED: g++.dg/ext/attr-noinline.C  -std=gnu++98  scan-tree-dump-not optimized" "fnone_always_inline<Special> *\\\\(\\\\);"
+UNRESOLVED: g++.dg/ext/attr-noreturn-2.C  -std=gnu++11  scan-tree-dump-not optimized "fnone_noreturn_failed"
+UNRESOLVED: g++.dg/ext/attr-noreturn-2.C  -std=gnu++11  scan-tree-dump-not optimized "fnoreturn_failed"
+UNRESOLVED: g++.dg/ext/attr-noreturn-2.C  -std=gnu++11  scan-tree-dump-not optimized "fnoreturn_none_failed"
+UNRESOLVED: g++.dg/ext/attr-noreturn-2.C  -std=gnu++14  scan-tree-dump-not optimized "fnone_noreturn_failed"
+UNRESOLVED: g++.dg/ext/attr-noreturn-2.C  -std=gnu++14  scan-tree-dump-not optimized "fnoreturn_failed"
+UNRESOLVED: g++.dg/ext/attr-noreturn-2.C  -std=gnu++14  scan-tree-dump-not optimized "fnoreturn_none_failed"
+UNRESOLVED: g++.dg/ext/attr-noreturn-2.C  -std=gnu++98  scan-tree-dump-not optimized "fnone_noreturn_failed"
+UNRESOLVED: g++.dg/ext/attr-noreturn-2.C  -std=gnu++98  scan-tree-dump-not optimized "fnoreturn_failed"
+UNRESOLVED: g++.dg/ext/attr-noreturn-2.C  -std=gnu++98  scan-tree-dump-not optimized "fnoreturn_none_failed"
+UNRESOLVED: g++.dg/ext/attr-pure.C  -std=gnu++11  scan-tree-dump-not optimized "test_none_pure_failed"
+UNRESOLVED: g++.dg/ext/attr-pure.C  -std=gnu++11  scan-tree-dump-not optimized "test_none_pure_failed"
+UNRESOLVED: g++.dg/ext/attr-pure.C  -std=gnu++11  scan-tree-dump-not optimized "test_pure_none_failed"
+UNRESOLVED: g++.dg/ext/attr-pure.C  -std=gnu++11  scan-tree-dump-not optimized "test_pure_none_failed"
+UNRESOLVED: g++.dg/ext/attr-pure.C  -std=gnu++14  scan-tree-dump-not optimized "test_none_pure_failed"
+UNRESOLVED: g++.dg/ext/attr-pure.C  -std=gnu++14  scan-tree-dump-not optimized "test_none_pure_failed"
+UNRESOLVED: g++.dg/ext/attr-pure.C  -std=gnu++14  scan-tree-dump-not optimized "test_pure_none_failed"
+UNRESOLVED: g++.dg/ext/attr-pure.C  -std=gnu++14  scan-tree-dump-not optimized "test_pure_none_failed"
+UNRESOLVED: g++.dg/ext/attr-pure.C  -std=gnu++98  scan-tree-dump-not optimized "test_none_pure_failed"
+UNRESOLVED: g++.dg/ext/attr-pure.C  -std=gnu++98  scan-tree-dump-not optimized "test_none_pure_failed"
+UNRESOLVED: g++.dg/ext/attr-pure.C  -std=gnu++98  scan-tree-dump-not optimized "test_pure_none_failed"
+UNRESOLVED: g++.dg/ext/attr-pure.C  -std=gnu++98  scan-tree-dump-not optimized "test_pure_none_failed"

after this commit.  The following patch fixes the easy part of it,
redundant -fdump-tree-* options when there is nothing that scans the file,
syntax errors in scan-tree-dump-not which cause the UNRESOLVED messages
as well -fdump-tree-eh in dg-options while scan-tree* scanning optimized
dump instead.

Tested on x86_64-linux with:
make check-c++-all RUNTESTFLAGS="--target_board=unix\{-m32,-m64\} dg.exp='attr*.C'"
committed to trunk as obvious.

2018-02-28  Jakub Jelinek  <jakub@redhat.com>

	PR c++/83871
	PR c++/83503
	* g++.dg/ext/attr-warning.C: Remove -fdump-tree-optimized from
	dg-options.
	* g++.dg/ext/attr-nonnull.C: Likewise.
	* g++.dg/ext/attr-noinline.C: Fix syntax in scan-tree-dump-not directives.
	* g++.dg/ext/attr-noinline-2.C: Likewise.
	* g++.dg/ext/attr-noreturn-2.C: Use -fdump-tree-optimized instead of
	-fdump-tree-eh in dg-options.

--- gcc/testsuite/g++.dg/ext/attr-warning.C.jj	2018-02-28 09:55:57.234897906 +0100
+++ gcc/testsuite/g++.dg/ext/attr-warning.C	2018-02-28 10:21:43.195091237 +0100
@@ -4,7 +4,7 @@
 // "inherit" attribute warning from a primary template declared with
 // it.
 // { dg-do compile }
-// { dg-options "-Wall -fdump-tree-optimized" }
+// { dg-options "-Wall" }
 
 struct Special;
 
--- gcc/testsuite/g++.dg/ext/attr-nonnull.C.jj	2018-02-28 09:55:57.236897905 +0100
+++ gcc/testsuite/g++.dg/ext/attr-nonnull.C	2018-02-28 10:24:41.550989113 +0100
@@ -4,7 +4,7 @@
 // does not "inherit" attribute nonnull from an argument declared with
 // one in the primary template.
 // { dg-do compile }
-// { dg-options "-O -Wall -fdump-tree-optimized" }
+// { dg-options "-O -Wall" }
 
 template <class T>
 void __attribute__ ((nonnull (1)))
--- gcc/testsuite/g++.dg/ext/attr-noinline.C.jj	2018-02-28 09:55:57.234897906 +0100
+++ gcc/testsuite/g++.dg/ext/attr-noinline.C	2018-02-28 10:26:44.132918927 +0100
@@ -94,7 +94,7 @@ void test_keep_primary_3 (void)
 void test_elim_special_3 (void)
 {
   fnone_always_inline<Special>();
-// { dg-final { scan-tree-dump-not "fnone_always_inline<Special> *\\(\\);" optimized" } }
+// { dg-final { scan-tree-dump-not "fnone_always_inline<Special> *\\(\\);" "optimized" } }
 }
 
 
@@ -124,5 +124,5 @@ void test_keep_primary_4 (void)
 void test_elim_special_4 (void)
 {
   fnoinline_always_inline<Special>();
-// { dg-final { scan-tree-dump-not "fnoinline_always_inline<Special> *\\(\\);" optimized" } }
+// { dg-final { scan-tree-dump-not "fnoinline_always_inline<Special> *\\(\\);" "optimized" } }
 }
--- gcc/testsuite/g++.dg/ext/attr-noinline-2.C.jj	2018-02-28 09:55:57.235897906 +0100
+++ gcc/testsuite/g++.dg/ext/attr-noinline-2.C	2018-02-28 10:27:01.777908823 +0100
@@ -69,5 +69,5 @@ void test_elim_special_2 (void)
 {
   // Should be inlined.
   fnoinline_always_inline<Special>();
-// { dg-final { scan-tree-dump-not "fnoinline_always_inline<Special> *\\(\\);" optimized" } }
+// { dg-final { scan-tree-dump-not "fnoinline_always_inline<Special> *\\(\\);" "optimized" } }
 }
--- gcc/testsuite/g++.dg/ext/attr-noreturn-2.C.jj	2018-02-28 09:55:57.235897906 +0100
+++ gcc/testsuite/g++.dg/ext/attr-noreturn-2.C	2018-02-28 10:16:03.767285586 +0100
@@ -3,7 +3,7 @@
     Test to verify that attributes noreturn on multiple declarations of
     the same function are merged.
     { dg-do compile }
-    { dg-options "-O -fdump-tree-eh" } */
+    { dg-options "-O -fdump-tree-optimized" } */
 
 int __attribute__ ((noreturn)) fnoreturn ();
 

	Jakub


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