From 489381473deb41fee4842515709fdcdb79745acf Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 25 May 2012 10:04:28 +0200 Subject: [PATCH] fold-const.c (optimize_bit_field_compare): Abort early in the strict volatile bitfields case. gcc/ * fold-const.c (optimize_bit_field_compare): Abort early in the strict volatile bitfields case. From-SVN: r187869 --- gcc/ChangeLog | 7 ++++++- gcc/fold-const.c | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d810212dffe..983cd323720 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,9 @@ -2012-05-24 Pat Haugen +2012-05-25 Thomas Schwinge + + * fold-const.c (optimize_bit_field_compare): Abort early in the strict + volatile bitfields case. + +2012-05-24 Pat Haugen * config/rs6000/rs6000.c (rs6000_option_override_internal): Change rs6000_sched_costly_dep default to true_store_to_load_dep_costly. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 20b07d0ad81..58deca7eb29 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3346,6 +3346,11 @@ optimize_bit_field_compare (location_t loc, enum tree_code code, tree mask; tree offset; + /* In the strict volatile bitfields case, doing code changes here may prevent + other optimizations, in particular in a SLOW_BYTE_ACCESS setting. */ + if (flag_strict_volatile_bitfields > 0) + return 0; + /* Get all the information about the extractions being done. If the bit size if the same as the size of the underlying object, we aren't doing an extraction at all and so can do nothing. We also don't want to