[PATCH] Speed-up use-after-scope (re-writing to SSA) (version 2)

Jakub Jelinek jakub@redhat.com
Thu Jan 26 10:55:00 GMT 2017


On Thu, Jan 26, 2017 at 09:57:14AM +0100, Thomas Schwinge wrote:
> Hi!
> 
> On Mon, 23 Jan 2017 10:19:33 +0100, Martin Liška <mliska@suse.cz> wrote:
> > --- a/gcc/testsuite/gcc.dg/asan/use-after-scope-3.c
> > +++ b/gcc/testsuite/gcc.dg/asan/use-after-scope-3.c
> > @@ -1,5 +1,6 @@
> >  // { dg-do run }
> >  // { dg-shouldfail "asan" }
> > +// { dg-additional-options "-O0" }
> 
> As these tests per "gcc/testsuite/gcc.dg/asan/asan.exp" are run with
> "gcc-dg-runtest", which will "cycle through a list of optimization
> options as c-torture does", is it really appropriate to hard-code "-O0"
> here?  Shouldn't instead be all testing be "dg-skip"ped (or similar)
> unless "-O0" is in effect?

Indeed, I see
UNRESOLVED: gcc.dg/asan/use-after-scope-9.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects   scan-tree-dump-times asan1 "= ASAN_POISON \\\\(\\\\)" 1
too.

For that kind of thing, the standard way is to add -ffat-lto-objects.
As for -O* in */asan/* tests, that is indeed a bug, most tests do it right.

The following patch should fix that, ok for trunk?

2017-01-26  Jakub Jelinek  <jakub@redhat.com>

	* c-c++-common/asan/pr63316.c: Use dg-skip-if instead of dg-options.
	* c-c++-common/asan/misalign-1.c: Likewise.
	* c-c++-common/asan/misalign-2.c: Likewise.
	* g++.dg/asan/pr69276.C: Add dg-skip-if, remove -O0 from
	dg-additional-options.
	* gcc.dg/asan/pr66314.c: Remove -Os from dg-options, add dg-skip-if.
	* gcc.dg/asan/use-after-scope-3.c: Use dg-skip-if instead of dg-options.
	* gcc.dg/asan/use-after-scope-9.c: Add dg-skip-if, remove -O2 and
	add -ffat-lto-objects from/to dg-additional-options.
	* gcc.dg/asan/use-after-scope-10.c: Add dg-skip-if, remove -O2 from
	dg-additional-options.

--- gcc/testsuite/c-c++-common/asan/pr63316.c.jj	2014-09-24 11:13:43.000000000 +0200
+++ gcc/testsuite/c-c++-common/asan/pr63316.c	2017-01-26 11:38:32.172060026 +0100
@@ -1,6 +1,6 @@
 /* PR sanitizer/63316 */
 /* { dg-do run } */
-/* { dg-options "-fsanitize=address -O2" } */
+/* { dg-skip-if "" { *-*-* }  { "*" } { "-O2" } } */
 
 #ifdef __cplusplus
 extern "C" {
--- gcc/testsuite/c-c++-common/asan/misalign-1.c.jj	2014-11-20 08:32:14.000000000 +0100
+++ gcc/testsuite/c-c++-common/asan/misalign-1.c	2017-01-26 11:37:57.964508495 +0100
@@ -1,5 +1,5 @@
 /* { dg-do run { target { ilp32 || lp64 } } } */
-/* { dg-options "-O2" } */
+/* { dg-skip-if "" { *-*-* }  { "*" } { "-O2" } } */
 /* { dg-additional-options "-fno-omit-frame-pointer" { target *-*-darwin* } } */
 /* { dg-shouldfail "asan" } */
 
--- gcc/testsuite/c-c++-common/asan/misalign-2.c.jj	2014-11-20 08:32:14.000000000 +0100
+++ gcc/testsuite/c-c++-common/asan/misalign-2.c	2017-01-26 11:38:06.756393231 +0100
@@ -1,5 +1,5 @@
 /* { dg-do run { target { ilp32 || lp64 } } } */
-/* { dg-options "-O2" } */
+/* { dg-skip-if "" { *-*-* }  { "*" } { "-O2" } } */
 /* { dg-additional-options "-fno-omit-frame-pointer" { target *-*-darwin* } } */
 /* { dg-shouldfail "asan" } */
 
--- gcc/testsuite/g++.dg/asan/pr69276.C.jj	2016-02-04 23:14:18.000000000 +0100
+++ gcc/testsuite/g++.dg/asan/pr69276.C	2017-01-26 11:40:10.490771046 +0100
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-shouldfail "asan" } */
-/* { dg-additional-options "-O0 -fno-lto" } */
+/* { dg-skip-if "" { *-*-* }  { "*" } { "-O0" } } */
+/* { dg-additional-options "-fno-lto" } */
 
 #include <stdlib.h>
 
--- gcc/testsuite/gcc.dg/asan/pr66314.c.jj	2015-08-24 18:26:58.000000000 +0200
+++ gcc/testsuite/gcc.dg/asan/pr66314.c	2017-01-26 11:31:13.234814878 +0100
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
-/* { dg-options "-std=gnu89 -Os -fprofile-arcs -fno-sanitize=all -fsanitize=kernel-address" } */
+/* { dg-options "-std=gnu89 -fprofile-arcs -fno-sanitize=all -fsanitize=kernel-address" } */
+/* { dg-skip-if "" { *-*-* }  { "*" } { "-Os" } } */
 
 char *a;
 int d;
--- gcc/testsuite/gcc.dg/asan/use-after-scope-3.c.jj	2017-01-23 18:09:36.000000000 +0100
+++ gcc/testsuite/gcc.dg/asan/use-after-scope-3.c	2017-01-26 11:36:56.510314173 +0100
@@ -1,6 +1,6 @@
 // { dg-do run }
 // { dg-shouldfail "asan" }
-// { dg-additional-options "-O0" }
+// { dg-skip-if "" { *-*-* }  { "*" } { "-O0" } }
 
 int
 main (void)
--- gcc/testsuite/gcc.dg/asan/use-after-scope-9.c.jj	2017-01-23 18:09:36.000000000 +0100
+++ gcc/testsuite/gcc.dg/asan/use-after-scope-9.c	2017-01-26 11:37:03.891217408 +0100
@@ -1,6 +1,7 @@
 // { dg-do run }
 // { dg-shouldfail "asan" }
-// { dg-additional-options "-O2 -fdump-tree-asan1" }
+// { dg-skip-if "" { *-*-* }  { "*" } { "-O2" } }
+// { dg-additional-options "-fdump-tree-asan1 -ffat-lto-objects" }
 
 int
 main (int argc, char **argv)
--- gcc/testsuite/gcc.dg/asan/use-after-scope-10.c.jj	2017-01-23 18:09:36.000000000 +0100
+++ gcc/testsuite/gcc.dg/asan/use-after-scope-10.c	2017-01-26 11:36:43.924479176 +0100
@@ -1,6 +1,7 @@
 // { dg-do run }
 // { dg-shouldfail "asan" }
-// { dg-additional-options "-O2 -fdump-tree-asan1" }
+// { dg-skip-if "" { *-*-* }  { "*" } { "-O2" } }
+// { dg-additional-options "-fdump-tree-asan1" }
 
 int
 main (int argc, char **argv)


	Jakub



More information about the Gcc-patches mailing list