]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/config/darwin.c
Merge from trunk.
[thirdparty/gcc.git] / gcc / config / darwin.c
index 761576df5657c42f28eb445ea87b35dd414ff983..50fb3f05f1fb6409d5a2064ba329edb631898127 100644 (file)
@@ -1289,22 +1289,17 @@ darwin_mergeable_constant_section (tree exp,
     {
       tree size = TYPE_SIZE_UNIT (TREE_TYPE (exp));
 
-      if (TREE_CODE (size) == INTEGER_CST
-         && TREE_INT_CST_LOW (size) == 4
-         && TREE_INT_CST_HIGH (size) == 0)
-        return darwin_sections[literal4_section];
-      else if (TREE_CODE (size) == INTEGER_CST
-              && TREE_INT_CST_LOW (size) == 8
-              && TREE_INT_CST_HIGH (size) == 0)
-        return darwin_sections[literal8_section];
-      else if (HAVE_GAS_LITERAL16
-              && TARGET_64BIT
-               && TREE_CODE (size) == INTEGER_CST
-               && TREE_INT_CST_LOW (size) == 16
-               && TREE_INT_CST_HIGH (size) == 0)
-        return darwin_sections[literal16_section];
-      else
-        return readonly_data_section;
+      if (TREE_CODE (size) == INTEGER_CST)
+       {
+         if (wi::eq_p (size, 4))
+           return darwin_sections[literal4_section];
+         else if (wi::eq_p (size, 8))
+           return darwin_sections[literal8_section];
+         else if (HAVE_GAS_LITERAL16
+                  && TARGET_64BIT
+                  && wi::eq_p (size, 16))
+           return darwin_sections[literal16_section];
+       }
     }
 
   return readonly_data_section;
@@ -1731,16 +1726,19 @@ machopic_select_rtx_section (enum machine_mode mode, rtx x,
 {
   if (GET_MODE_SIZE (mode) == 8
       && (GET_CODE (x) == CONST_INT
+         || GET_CODE (x) == CONST_WIDE_INT
          || GET_CODE (x) == CONST_DOUBLE))
     return darwin_sections[literal8_section];
   else if (GET_MODE_SIZE (mode) == 4
           && (GET_CODE (x) == CONST_INT
+              || GET_CODE (x) == CONST_WIDE_INT
               || GET_CODE (x) == CONST_DOUBLE))
     return darwin_sections[literal4_section];
   else if (HAVE_GAS_LITERAL16
           && TARGET_64BIT
           && GET_MODE_SIZE (mode) == 16
           && (GET_CODE (x) == CONST_INT
+              || GET_CODE (x) == CONST_WIDE_INT
               || GET_CODE (x) == CONST_DOUBLE
               || GET_CODE (x) == CONST_VECTOR))
     return darwin_sections[literal16_section];