[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] i386 multiple column index: disable optimization

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Oct 4 10:48:41 JST 2012


Kouhei Sutou	2012-03-18 16:58:16 +0900 (Sun, 18 Mar 2012)

  New Revision: f22888f33bdbccd1fb40d313817564b4e7bcc537
  https://github.com/mroonga/mroonga/commit/f22888f33bdbccd1fb40d313817564b4e7bcc537

  Log:
    i386 multiple column index: disable optimization
    
    Those tests are failed with gcc 4.1.2 -O2 on CentOS 5.8 i686:
      mroonga_storage.multiple_column_index_select_double
      mroonga_storage.multiple_column_index_select_float
    
    We need to disable optimization by volatile.
    
    Reported by Kazuhiko Shiozaki. Thanks!!!

  Modified files:
    ha_mroonga.cc

  Modified: ha_mroonga.cc (+7 -5)
===================================================================
--- ha_mroonga.cc    2012-03-18 15:26:30 +0900 (301e06b)
+++ ha_mroonga.cc    2012-03-18 16:58:16 +0900 (54ca03b)
@@ -8879,10 +8879,10 @@ int ha_mroonga::storage_encode_multiple_column_key(KEY *key_info,
       TYPE_BYTE_SEQUENCE
     } data_type = TYPE_UNKNOWN;
     uint32 data_size = 0;
-    int int_value = 0;
-    long long int long_long_value = 0;
-    float float_value = 0.0;
-    double double_value = 0.0;
+    volatile int int_value = 0;
+    volatile long long int long_long_value = 0;
+    volatile float float_value = 0.0;
+    volatile double double_value = 0.0;
     switch (field->real_type()) {
     case MYSQL_TYPE_DECIMAL:
       data_type = TYPE_BYTE_SEQUENCE;
@@ -9053,7 +9053,9 @@ int ha_mroonga::storage_encode_multiple_column_key(KEY *key_info,
     case TYPE_DOUBLE:
       {
         int n_bits = (data_size * 8 - 1);
-        long_long_value = *((long long int *)(&double_value));
+        volatile long long int *encoded_value_pointer =
+          (long long int *)(&double_value);
+        long_long_value = *encoded_value_pointer;
         if (!decode)
           long_long_value ^= ((long_long_value >> n_bits) | (1LL << n_bits));
         mrn_byte_order_host_to_network(current_buffer, &long_long_value,
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-mysql-commit mailing list
Back to archive index