]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/objc/objc-act.c
Merge from trunk.
[thirdparty/gcc.git] / gcc / objc / objc-act.c
index d7e8afb6acfbeada31693843ebba5eb42a4cba0e..7e9f8577a0e40279bef717ce409bd5aa11caf069 100644 (file)
@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "cgraph.h"
 #include "tree-iterator.h"
 #include "hash-table.h"
+#include "wide-int.h"
 #include "langhooks-def.h"
 /* Different initialization, code gen and meta data generation for each
    runtime.  */
@@ -4882,14 +4883,9 @@ objc_decl_method_attributes (tree *node, tree attributes, int flags)
                     which specifies the index of the format string
                     argument.  Add 2.  */
                  number = TREE_VALUE (second_argument);
-                 if (number
-                     && TREE_CODE (number) == INTEGER_CST
-                     && TREE_INT_CST_HIGH (number) == 0)
-                   {
-                     TREE_VALUE (second_argument)
-                       = build_int_cst (integer_type_node,
-                                        TREE_INT_CST_LOW (number) + 2);
-                   }
+                 if (number && TREE_CODE (number) == INTEGER_CST)
+                   TREE_VALUE (second_argument)
+                     = wide_int_to_tree (TREE_TYPE (number), wide_int (number) + 2);
 
                  /* This is the third argument, the "first-to-check",
                     which specifies the index of the first argument to
@@ -4897,15 +4893,9 @@ objc_decl_method_attributes (tree *node, tree attributes, int flags)
                     in which case we don't need to add 2.  Add 2 if not
                     0.  */
                  number = TREE_VALUE (third_argument);
-                 if (number
-                     && TREE_CODE (number) == INTEGER_CST
-                     && TREE_INT_CST_HIGH (number) == 0
-                     && TREE_INT_CST_LOW (number) != 0)
-                   {
-                     TREE_VALUE (third_argument)
-                       = build_int_cst (integer_type_node,
-                                        TREE_INT_CST_LOW (number) + 2);
-                   }
+                 if (number && TREE_CODE (number) == INTEGER_CST)
+                   TREE_VALUE (third_argument)
+                     = wide_int_to_tree (TREE_TYPE (number), wide_int (number) + 2);
                }
              filtered_attributes = chainon (filtered_attributes,
                                             new_attribute);
@@ -4937,15 +4927,10 @@ objc_decl_method_attributes (tree *node, tree attributes, int flags)
                {
                  /* Get the value of the argument and add 2.  */
                  tree number = TREE_VALUE (argument);
-                 if (number
-                     && TREE_CODE (number) == INTEGER_CST
-                     && TREE_INT_CST_HIGH (number) == 0
-                     && TREE_INT_CST_LOW (number) != 0)
-                   {
-                     TREE_VALUE (argument)
-                       = build_int_cst (integer_type_node,
-                                        TREE_INT_CST_LOW (number) + 2);
-                   }
+                 if (number && TREE_CODE (number) == INTEGER_CST
+                     && !wi::eq_p (number, 0))
+                   TREE_VALUE (argument)
+                     = wide_int_to_tree (TREE_TYPE (number), wide_int (number) + 2);
                  argument = TREE_CHAIN (argument);
                }