aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gcc.gnu.org>2012-05-25 10:04:28 +0200
committerThomas Schwinge <tschwinge@gcc.gnu.org>2012-05-25 10:04:28 +0200
commit489381473deb41fee4842515709fdcdb79745acf (patch)
tree295b667261e9fb754b42de6d3bcd5a834c7086eb /gcc/fold-const.c
parent1746f5860bcb0199abd66397e0e56d7ce3da90a1 (diff)
downloadgcc-489381473deb41fee4842515709fdcdb79745acf.zip
gcc-489381473deb41fee4842515709fdcdb79745acf.tar.gz
gcc-489381473deb41fee4842515709fdcdb79745acf.tar.bz2
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
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 20b07d0..58deca7 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