]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/objc/objc-act.c
Merge with trunk.
[thirdparty/gcc.git] / gcc / objc / objc-act.c
index 2a551ee5857af88e6b4079aff8d591861fb5fb92..0cf93d4002cc4527a093c2f66c0a98211405962d 100644 (file)
@@ -52,6 +52,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.  */
@@ -4881,14 +4882,10 @@ 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),
+                                         wi::add (number, 2));
 
                  /* This is the third argument, the "first-to-check",
                     which specifies the index of the first argument to
@@ -4896,15 +4893,10 @@ 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),
+                                         wi::add (number, 2));
                }
              filtered_attributes = chainon (filtered_attributes,
                                             new_attribute);
@@ -4936,15 +4928,11 @@ 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),
+                                         wi::add (number, 2));
                  argument = TREE_CHAIN (argument);
                }