public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Change default for --param allow-...-data-races to off
@ 2014-06-19 16:18 Bernd Edlinger
  2014-06-20 11:44 ` Martin Jambor
  0 siblings, 1 reply; 14+ messages in thread
From: Bernd Edlinger @ 2014-06-19 16:18 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 344 bytes --]

Hi,

from a recent discussion on gcc@gcc.gnu.org I have learned that the default of
--param allow-store-data-races is still 1, and it is causing problems.
Therefore I would like to suggest to change the default of this option to 0.

Boot-strapped and regression tested on x86_64-linux-gnu.
Ok for trunk?


Thanks
Bernd.
 		 	   		  

[-- Attachment #2: changelog-allow-races.txt --]
[-- Type: text/plain, Size: 1239 bytes --]

gcc/ChangeLog:
2014-06-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	Set default for --param allow-...-data-races to off.
	* params.def (PARAM_ALLOW_LOAD_DATA_RACES,
	PARAM_ALLOW_STORE_DATA_RACES, PARAM_ALLOW_PACKED_LOAD_DATA_RACES,
	PARAM_ALLOW_PACKED_STORE_DATA_RACES): Set default to off.

testsuite/ChangeLog:
2014-06-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	Adjust to new default for --param allow-...-data-races.
	* c-c++-common/cxxbitfields-3.c: Adjust.
	* c-c++-common/cxxbitfields-6.c: Adjust.
	* c-c++-common/simulate-thread/bitfields-1.c: Adjust.
	* c-c++-common/simulate-thread/bitfields-2.c: Adjust.
	* c-c++-common/simulate-thread/bitfields-3.c: Adjust.
	* c-c++-common/simulate-thread/bitfields-4.c: Adjust.
	* g++.dg/simulate-thread/bitfields.C: Adjust.
	* g++.dg/simulate-thread/bitfields-2.C: Adjust.
	* gcc.dg/lto/pr52097_0.c: Adjust.
	* gcc.dg/simulate-thread/speculative-store.c: Adjust.
	* gcc.dg/simulate-thread/speculative-store-2.c: Adjust.
	* gcc.dg/simulate-thread/speculative-store-3.c: Adjust.
	* gcc.dg/simulate-thread/speculative-store-4.c: Adjust.
	* gcc.dg/simulate-thread/strict-align-global.c: Adjust.
	* gcc.dg/simulate-thread/subfields.c: Adjust.
	* gcc.dg/tree-ssa/20050314-1.c: Adjust.


[-- Attachment #3: patch-allow-races.diff --]
[-- Type: application/octet-stream, Size: 9333 bytes --]

Index: gcc/params.def
===================================================================
--- gcc/params.def	(revision 211799)
+++ gcc/params.def	(working copy)
@@ -1005,22 +1005,22 @@
 DEFPARAM (PARAM_ALLOW_LOAD_DATA_RACES,
 	  "allow-load-data-races",
 	  "Allow new data races on loads to be introduced",
-	  1, 0, 1)
+	  0, 0, 1)
 
 DEFPARAM (PARAM_ALLOW_STORE_DATA_RACES,
 	  "allow-store-data-races",
 	  "Allow new data races on stores to be introduced",
-	  1, 0, 1)
+	  0, 0, 1)
 
 DEFPARAM (PARAM_ALLOW_PACKED_LOAD_DATA_RACES,
 	  "allow-packed-load-data-races",
 	  "Allow new data races on packed data loads to be introduced",
-	  1, 0, 1)
+	  0, 0, 1)
 
 DEFPARAM (PARAM_ALLOW_PACKED_STORE_DATA_RACES,
 	  "allow-packed-store-data-races",
 	  "Allow new data races on packed data stores to be introduced",
-	  1, 0, 1)
+	  0, 0, 1)
 
 /* Reassociation width to be used by tree reassoc optimization.  */
 DEFPARAM (PARAM_TREE_REASSOC_WIDTH,
Index: gcc/testsuite/c-c++-common/cxxbitfields-3.c
===================================================================
--- gcc/testsuite/c-c++-common/cxxbitfields-3.c	(revision 211799)
+++ gcc/testsuite/c-c++-common/cxxbitfields-3.c	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O2 --param allow-store-data-races=0" } */
+/* { dg-options "-O2" } */
 
 /* Make sure we don't narrow down to a QI or HI to store into VAR.J,
    but instead use an SI.  */
Index: gcc/testsuite/c-c++-common/cxxbitfields-6.c
===================================================================
--- gcc/testsuite/c-c++-common/cxxbitfields-6.c	(revision 211799)
+++ gcc/testsuite/c-c++-common/cxxbitfields-6.c	(working copy)
@@ -1,6 +1,6 @@
 /* PR middle-end/50141 */
 /* { dg-do compile } */
-/* { dg-options "-O2 --param allow-store-data-races=0" } */
+/* { dg-options "-O2" } */
 
 struct S
 {
Index: gcc/testsuite/c-c++-common/simulate-thread/bitfields-1.c
===================================================================
--- gcc/testsuite/c-c++-common/simulate-thread/bitfields-1.c	(revision 211799)
+++ gcc/testsuite/c-c++-common/simulate-thread/bitfields-1.c	(working copy)
@@ -1,5 +1,4 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-store-data-races=0" } */
 /* { dg-final { simulate-thread } } */
 
 #include <stdio.h>
Index: gcc/testsuite/c-c++-common/simulate-thread/bitfields-2.c
===================================================================
--- gcc/testsuite/c-c++-common/simulate-thread/bitfields-2.c	(revision 211799)
+++ gcc/testsuite/c-c++-common/simulate-thread/bitfields-2.c	(working copy)
@@ -1,5 +1,4 @@
 /* { dg-do link { target { ! int16 } } } */
-/* { dg-options "--param allow-store-data-races=0" } */
 /* { dg-final { simulate-thread } } */
 
 #include <stdio.h>
Index: gcc/testsuite/c-c++-common/simulate-thread/bitfields-3.c
===================================================================
--- gcc/testsuite/c-c++-common/simulate-thread/bitfields-3.c	(revision 211799)
+++ gcc/testsuite/c-c++-common/simulate-thread/bitfields-3.c	(working copy)
@@ -1,5 +1,4 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-store-data-races=0" } */
 /* { dg-final { simulate-thread } } */
 
 #include <stdio.h>
Index: gcc/testsuite/c-c++-common/simulate-thread/bitfields-4.c
===================================================================
--- gcc/testsuite/c-c++-common/simulate-thread/bitfields-4.c	(revision 211799)
+++ gcc/testsuite/c-c++-common/simulate-thread/bitfields-4.c	(working copy)
@@ -1,5 +1,4 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-store-data-races=0" } */
 /* { dg-final { simulate-thread } } */
 
 #include <stdio.h>
Index: gcc/testsuite/g++.dg/simulate-thread/bitfields.C
===================================================================
--- gcc/testsuite/g++.dg/simulate-thread/bitfields.C	(revision 211799)
+++ gcc/testsuite/g++.dg/simulate-thread/bitfields.C	(working copy)
@@ -1,5 +1,4 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-load-data-races=0 --param allow-store-data-races=0" } */
 /* { dg-final { simulate-thread } } */
 
 /* Test that setting <var.a> does not touch either <var.b> or <var.c>.
Index: gcc/testsuite/g++.dg/simulate-thread/bitfields-2.C
===================================================================
--- gcc/testsuite/g++.dg/simulate-thread/bitfields-2.C	(revision 211799)
+++ gcc/testsuite/g++.dg/simulate-thread/bitfields-2.C	(working copy)
@@ -1,5 +1,4 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-load-data-races=0 --param allow-store-data-races=0" } */
 /* { dg-final { simulate-thread } } */
 
 /* Test that setting <var.a> does not touch either <var.b> or <var.c>.
Index: gcc/testsuite/gcc.dg/lto/pr52097_0.c
===================================================================
--- gcc/testsuite/gcc.dg/lto/pr52097_0.c	(revision 211799)
+++ gcc/testsuite/gcc.dg/lto/pr52097_0.c	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-lto-do link } */
-/* { dg-lto-options { { -O -flto -fexceptions -fnon-call-exceptions --param allow-store-data-races=0 } } } */
+/* { dg-lto-options { { -O -flto -fexceptions -fnon-call-exceptions } } } */
 
 typedef struct { unsigned int e0 : 16; } s1;
 typedef struct { unsigned int e0 : 16; } s2;
Index: gcc/testsuite/gcc.dg/simulate-thread/speculative-store.c
===================================================================
--- gcc/testsuite/gcc.dg/simulate-thread/speculative-store.c	(revision 211799)
+++ gcc/testsuite/gcc.dg/simulate-thread/speculative-store.c	(working copy)
@@ -1,5 +1,4 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-store-data-races=0" } */
 /* { dg-final { simulate-thread } } */
 
 #include <stdio.h>
@@ -6,7 +5,7 @@
 #include "simulate-thread.h"
 
 /* This file tests that speculative store movement out of a loop doesn't 
-   happen.  This is disallowed when --param allow-store-data-races is 0.  */
+   happen.  */
 
 int global = 100;
 
Index: gcc/testsuite/gcc.dg/simulate-thread/speculative-store-2.c
===================================================================
--- gcc/testsuite/gcc.dg/simulate-thread/speculative-store-2.c	(revision 211799)
+++ gcc/testsuite/gcc.dg/simulate-thread/speculative-store-2.c	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-store-data-races=0 -O2" } */
+/* { dg-options "-O2" } */
 /* { dg-final { simulate-thread } } */
 
 #include <stdio.h>
@@ -7,8 +7,7 @@
 
 #include "simulate-thread.h"
 
-/* Test that speculative stores do not happen for --param
-   allow-store-data-races=0.  */
+/* Test that speculative stores do not happen.  */
 
 int count, insns;
 
Index: gcc/testsuite/gcc.dg/simulate-thread/speculative-store-3.c
===================================================================
--- gcc/testsuite/gcc.dg/simulate-thread/speculative-store-3.c	(revision 211799)
+++ gcc/testsuite/gcc.dg/simulate-thread/speculative-store-3.c	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-store-data-races=0 -O2" } */
+/* { dg-options "-O2" } */
 /* { dg-final { simulate-thread } } */
 
 #include <stdio.h>
Index: gcc/testsuite/gcc.dg/simulate-thread/speculative-store-4.c
===================================================================
--- gcc/testsuite/gcc.dg/simulate-thread/speculative-store-4.c	(revision 211799)
+++ gcc/testsuite/gcc.dg/simulate-thread/speculative-store-4.c	(working copy)
@@ -1,5 +1,4 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-store-data-races=0" } */
 /* { dg-final { simulate-thread } } */
 
 #include <stdio.h>
@@ -8,8 +7,7 @@
 #include "simulate-thread.h"
 
 /* PR 54139 */
-/* Test that speculative stores do not happen for --param
-   allow-store-data-races=0.  */
+/* Test that speculative stores do not happen.  */
 
 int g_13=1, insns=1;
 
Index: gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c
===================================================================
--- gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c	(revision 211799)
+++ gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c	(working copy)
@@ -1,5 +1,4 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-packed-store-data-races=0" } */
 /* { dg-final { simulate-thread } } */
 
 #include <stdio.h>
Index: gcc/testsuite/gcc.dg/simulate-thread/subfields.c
===================================================================
--- gcc/testsuite/gcc.dg/simulate-thread/subfields.c	(revision 211799)
+++ gcc/testsuite/gcc.dg/simulate-thread/subfields.c	(working copy)
@@ -1,5 +1,4 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-packed-store-data-races=0" } */
 /* { dg-final { simulate-thread } } */
 
 #include <stdio.h>
Index: gcc/testsuite/gcc.dg/tree-ssa/20050314-1.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/20050314-1.c	(revision 211799)
+++ gcc/testsuite/gcc.dg/tree-ssa/20050314-1.c	(working copy)
@@ -15,7 +15,7 @@
 }
 
 /* Store motion may be applied to the assignment to a[k], since sinf
-   cannot read nor write the memory.  */
+   cannot read nor write the memory.  Add one for the store flag.  */
 
-/* { dg-final { scan-tree-dump-times "Moving statement" 1 "lim1" } } */
+/* { dg-final { scan-tree-dump-times "Moving statement" 2 "lim1" } } */
 /* { dg-final { cleanup-tree-dump "lim1" } } */

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-06-26  7:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-19 16:18 [PATCH] Change default for --param allow-...-data-races to off Bernd Edlinger
2014-06-20 11:44 ` Martin Jambor
2014-06-23  8:03   ` Bernd Edlinger
2014-06-23  8:50     ` Richard Biener
2014-06-23 13:35       ` Bernd Edlinger
2014-06-24 20:19         ` Martin Jambor
2014-06-25  8:14           ` Richard Biener
2014-06-25  8:54             ` Jakub Jelinek
2014-06-25  8:56               ` Richard Biener
2014-06-25  9:48                 ` Marc Glisse
2014-06-25 21:14           ` Jeff Law
2014-06-25 22:03             ` Martin Jambor
2014-06-26  6:43               ` Richard Biener
2014-06-26  7:53                 ` Bernd Edlinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).