]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2014-06-26 Martin Jambor <mjambor@suse.cz>
authorMartin Jambor <mjambor@suse.cz>
Thu, 26 Jun 2014 14:54:59 +0000 (16:54 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Thu, 26 Jun 2014 14:54:59 +0000 (16:54 +0200)
* params.def (PARAM_ALLOW_LOAD_DATA_RACES)
(PARAM_ALLOW_PACKED_LOAD_DATA_RACES)
(PARAM_ALLOW_PACKED_STORE_DATA_RACES): Removed.
(PARAM_ALLOW_STORE_DATA_RACES): Set default to zero.
* opts.c (default_options_optimization): Set
PARAM_ALLOW_STORE_DATA_RACES to one at -Ofast.
* doc/invoke.texi (allow-load-data-races)
(allow-packed-load-data-races, allow-packed-store-data-races):
Removed.
(allow-store-data-races): Document the new default.

testsuite/
* g++.dg/simulate-thread/bitfields-2.C: Remove allow-load-data-races
parameter.
* g++.dg/simulate-thread/bitfields.C: Likewise.
* gcc.dg/simulate-thread/strict-align-global.c: Remove
allow-packed-store-data-races parameter.
* gcc.dg/simulate-thread/subfields.c: Likewise.
* gcc.dg/tree-ssa/20050314-1.c: Set parameter allow-store-data-races
to one.

From-SVN: r212034

gcc/ChangeLog
gcc/doc/invoke.texi
gcc/opts.c
gcc/params.def
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/simulate-thread/bitfields-2.C
gcc/testsuite/g++.dg/simulate-thread/bitfields.C
gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c
gcc/testsuite/gcc.dg/simulate-thread/subfields.c
gcc/testsuite/gcc.dg/tree-ssa/20050314-1.c

index 29d9d888448527804f325931835d51239bd4d01d..48bebfefddad240d158cf5f1d0734096cdc92d7c 100644 (file)
@@ -1,3 +1,16 @@
+2014-06-26  Martin Jambor  <mjambor@suse.cz>
+
+       * params.def (PARAM_ALLOW_LOAD_DATA_RACES)
+       (PARAM_ALLOW_PACKED_LOAD_DATA_RACES)
+       (PARAM_ALLOW_PACKED_STORE_DATA_RACES): Removed.
+       (PARAM_ALLOW_STORE_DATA_RACES): Set default to zero.
+       * opts.c (default_options_optimization): Set
+       PARAM_ALLOW_STORE_DATA_RACES to one at -Ofast.
+       * doc/invoke.texi (allow-load-data-races)
+       (allow-packed-load-data-races, allow-packed-store-data-races):
+       Removed.
+       (allow-store-data-races): Document the new default.
+
 2014-06-26  Martin Jambor  <mjambor@suse.cz>
 
        * ipa-prop.c (ipa_impossible_devirt_target): No longer static,
index 3a02125de850bb3173b9b0745cfedc261b27c365..541fd6b545e38e18ceaccbd340299a3c87c95b1e 100644 (file)
@@ -10176,25 +10176,10 @@ The maximum number of conditional stores paires that can be sunk.  Set to 0
 if either vectorization (@option{-ftree-vectorize}) or if-conversion
 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
 
-@item allow-load-data-races
-Allow optimizers to introduce new data races on loads.
-Set to 1 to allow, otherwise to 0.  This option is enabled by default
-unless implicitly set by the @option{-fmemory-model=} option.
-
 @item allow-store-data-races
 Allow optimizers to introduce new data races on stores.
 Set to 1 to allow, otherwise to 0.  This option is enabled by default
-unless implicitly set by the @option{-fmemory-model=} option.
-
-@item allow-packed-load-data-races
-Allow optimizers to introduce new data races on packed data loads.
-Set to 1 to allow, otherwise to 0.  This option is enabled by default
-unless implicitly set by the @option{-fmemory-model=} option.
-
-@item allow-packed-store-data-races
-Allow optimizers to introduce new data races on packed data stores.
-Set to 1 to allow, otherwise to 0.  This option is enabled by default
-unless implicitly set by the @option{-fmemory-model=} option.
+at optimization level @option{-Ofast}.
 
 @item case-values-threshold
 The smallest number of different values for which it is best to use a
index 3ab06c67c398b8f7b465b3a6faac6faaf238c84e..19203dc8b5d013205225a437d10ef116b6238c09 100644 (file)
@@ -620,6 +620,13 @@ default_options_optimization (struct gcc_options *opts,
      opt2 ? default_param_value (PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP) : 1000,
      opts->x_param_values, opts_set->x_param_values);
 
+  /* At -Ofast, allow store motion to introduce potential race conditions.  */
+  maybe_set_param_value
+    (PARAM_ALLOW_STORE_DATA_RACES,
+     opts->x_optimize_fast ? 1
+     : default_param_value (PARAM_ALLOW_STORE_DATA_RACES),
+     opts->x_param_values, opts_set->x_param_values);
+
   if (opts->x_optimize_size)
     /* We want to crossjump as much as possible.  */
     maybe_set_param_value (PARAM_MIN_CROSSJUMP_INSNS, 1,
index 28ef79a0650aa3712b8ef06c61c0874973bcde42..aa1e88dd8d1c6fabc393bdc9bb809508323bb0c3 100644 (file)
@@ -1002,25 +1002,10 @@ DEFPARAM (PARAM_CASE_VALUES_THRESHOLD,
           0, 0, 0)
 
 /* Data race flags for C++0x memory model compliance.  */
-DEFPARAM (PARAM_ALLOW_LOAD_DATA_RACES,
-         "allow-load-data-races",
-         "Allow new data races on loads to be introduced",
-         1, 0, 1)
-
 DEFPARAM (PARAM_ALLOW_STORE_DATA_RACES,
          "allow-store-data-races",
          "Allow new data races on stores to be introduced",
-         1, 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)
-
-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 ff3d0b003b21fa7d3ad2d15fd83dced5b7b5d5fe..bb05f7fa8d61d90f425dc1c2af6c6c77c18a5d8a 100644 (file)
@@ -1,3 +1,14 @@
+2014-06-26  Martin Jambor  <mjambor@suse.cz>
+
+       * g++.dg/simulate-thread/bitfields-2.C: Remove allow-load-data-races
+       parameter.
+       * g++.dg/simulate-thread/bitfields.C: Likewise.
+       * gcc.dg/simulate-thread/strict-align-global.c: Remove
+       allow-packed-store-data-races parameter.
+       * gcc.dg/simulate-thread/subfields.c: Likewise.
+       * gcc.dg/tree-ssa/20050314-1.c: Set parameter allow-store-data-races
+       to one.
+
 2014-06-26  Martin Jambor  <mjambor@suse.cz>
 
        * g++.dg/ipa/pr60600.C: Fix typo.
index 077514a3ff586c3ed46b7c6e30a8f33e317429b5..be5d1eae5c421447e3e56a772987c0b4ddd33791 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-load-data-races=0 --param allow-store-data-races=0" } */
+/* { dg-options "--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 3acf21f876f08ed4bf7482d677702e6b9dc6ff7c..b829587276b2f764dfaec927b264777c1e9af4c4 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-load-data-races=0 --param allow-store-data-races=0" } */
+/* { dg-options "--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 fdcd7f46af721d469c9c193b32d2c58ee0a54584..f8b88ada03d539275084d0a95b89e563fd9847c2 100644 (file)
@@ -1,5 +1,4 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-packed-store-data-races=0" } */
 /* { dg-final { simulate-thread } } */
 
 #include <stdio.h>
index 2d931176e7d214536a0cfcbf8eb6c2fcf6ff0e96..70e38a1aa304df72f2b4fe7eaa46cdfd8fa618f0 100644 (file)
@@ -1,5 +1,4 @@
 /* { dg-do link } */
-/* { dg-options "--param allow-packed-store-data-races=0" } */
 /* { dg-final { simulate-thread } } */
 
 #include <stdio.h>
index 108297336e77c5075da9c6fdd00ba37ce5d382e3..8f0778132c85da884103a01c3dd5994ea806f801 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-lim1-details" } */
+/* { dg-options "-O1 -fdump-tree-lim1-details --param allow-store-data-races=1" } */
 
 float a[100];