fold-const.c (optimize_bit_field_compare): Abort early in the strict volatile bitfiel...
authorThomas Schwinge <tschwinge@gcc.gnu.org>
Fri, 25 May 2012 08:04:28 +0000 (10:04 +0200)
committerThomas Schwinge <tschwinge@gcc.gnu.org>
Fri, 25 May 2012 08:04:28 +0000 (10:04 +0200)
gcc/
* fold-const.c (optimize_bit_field_compare): Abort early in the strict
volatile bitfields case.

From-SVN: r187869

gcc/ChangeLog
gcc/fold-const.c

index d810212dffec15378fe9df62c9bf9c1ed0eb249d..983cd3237205caa83e9a723e06d0d491c38f1b2a 100644 (file)
@@ -1,4 +1,9 @@
-2012-05-24  Pat Haugen <pthaugen@us.ibm.com>
+2012-05-25  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * fold-const.c (optimize_bit_field_compare): Abort early in the strict
+       volatile bitfields case.
+
+2012-05-24  Pat Haugen  <pthaugen@us.ibm.com>
 
        * config/rs6000/rs6000.c (rs6000_option_override_internal): Change
        rs6000_sched_costly_dep default to true_store_to_load_dep_costly.
index 20b07d0ad811ffb0f12f5c38481c449201884f80..58deca7eb29dacc2bbcd9fb443cd54cec6e4efc5 100644 (file)
@@ -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