From 680a5a7c025e3a124a81266c173db490948ba3bc Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Thu, 26 Jun 2014 16:54:59 +0200 Subject: 2014-06-26 Martin Jambor * 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 | 13 +++++++++++++ gcc/doc/invoke.texi | 17 +---------------- gcc/opts.c | 7 +++++++ gcc/params.def | 17 +---------------- gcc/testsuite/ChangeLog | 11 +++++++++++ gcc/testsuite/g++.dg/simulate-thread/bitfields-2.C | 2 +- gcc/testsuite/g++.dg/simulate-thread/bitfields.C | 2 +- .../gcc.dg/simulate-thread/strict-align-global.c | 1 - gcc/testsuite/gcc.dg/simulate-thread/subfields.c | 1 - gcc/testsuite/gcc.dg/tree-ssa/20050314-1.c | 2 +- 10 files changed, 36 insertions(+), 37 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 29d9d88..48bebfe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,18 @@ 2014-06-26 Martin Jambor + * 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 + * ipa-prop.c (ipa_impossible_devirt_target): No longer static, renamed to ipa_impossible_devirt_target. Fix typo. * ipa-prop.h (ipa_impossible_devirt_target): Declare. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 3a02125d..541fd6b 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -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 diff --git a/gcc/opts.c b/gcc/opts.c index 3ab06c6..19203dc 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -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, diff --git a/gcc/params.def b/gcc/params.def index 28ef79a..aa1e88d 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -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, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ff3d0b0..bb05f7f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,16 @@ 2014-06-26 Martin Jambor + * 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 + * g++.dg/ipa/pr60600.C: Fix typo. * g++.dg/ipa/devirt-25.C: Likewise. diff --git a/gcc/testsuite/g++.dg/simulate-thread/bitfields-2.C b/gcc/testsuite/g++.dg/simulate-thread/bitfields-2.C index 077514a..be5d1ea 100644 --- a/gcc/testsuite/g++.dg/simulate-thread/bitfields-2.C +++ b/gcc/testsuite/g++.dg/simulate-thread/bitfields-2.C @@ -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 does not touch either or . diff --git a/gcc/testsuite/g++.dg/simulate-thread/bitfields.C b/gcc/testsuite/g++.dg/simulate-thread/bitfields.C index 3acf21f..b829587 100644 --- a/gcc/testsuite/g++.dg/simulate-thread/bitfields.C +++ b/gcc/testsuite/g++.dg/simulate-thread/bitfields.C @@ -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 does not touch either or . diff --git a/gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c b/gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c index fdcd7f4..f8b88ad 100644 --- a/gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c +++ b/gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c @@ -1,5 +1,4 @@ /* { dg-do link } */ -/* { dg-options "--param allow-packed-store-data-races=0" } */ /* { dg-final { simulate-thread } } */ #include diff --git a/gcc/testsuite/gcc.dg/simulate-thread/subfields.c b/gcc/testsuite/gcc.dg/simulate-thread/subfields.c index 2d93117..70e38a1 100644 --- a/gcc/testsuite/gcc.dg/simulate-thread/subfields.c +++ b/gcc/testsuite/gcc.dg/simulate-thread/subfields.c @@ -1,5 +1,4 @@ /* { dg-do link } */ -/* { dg-options "--param allow-packed-store-data-races=0" } */ /* { dg-final { simulate-thread } } */ #include diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20050314-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20050314-1.c index 1082973..8f07781 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20050314-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20050314-1.c @@ -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]; -- cgit v1.1