tree-parloops.c (try_transform_to_exit_first_loop_alt): Use TYPE_MAX_VALUE.
authorNathan Sidwell <nathan@acm.org>
Tue, 18 Jul 2017 13:22:50 +0000 (13:22 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Tue, 18 Jul 2017 13:22:50 +0000 (13:22 +0000)
       gcc/
* tree-parloops.c (try_transform_to_exit_first_loop_alt): Use
TYPE_MAX_VALUE.

       gcc/c-family/
* c-warn.c (warn_for_memset): Use TYPE_{MIN,MAX}_VALUE.

       gcc/c/
* c-parser.c (c_parser_array_notation): Use TYPE_{MIN,MAX}_VALUE.

       gcc/cp/
* cp-array-notation.c (build_array_notation_ref): Use
TYPE_{MIN,MAX}_VALUE.

       gcc/fortran/
* trans.c (gfc_build_array_ref): Use TYPE_MAX_VALUE.

From-SVN: r250309

gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-warn.c
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/cp/ChangeLog
gcc/cp/cp-array-notation.c
gcc/fortran/ChangeLog
gcc/fortran/trans.c
gcc/tree-parloops.c

index 3ff4036f2dca854c80873a781e12f92203c300c7..1d11ab5b95e89b9e952b9c8cdbc9f857a483ca0c 100644 (file)
@@ -1,3 +1,8 @@
+2017-07-18  Nathan Sidwell  <nathan@acm.org>
+
+       * tree-parloops.c (try_transform_to_exit_first_loop_alt): Use
+       TYPE_MAX_VALUE.
+
 2017-07-18  Bin Cheng  <bin.cheng@arm.com>
 
        PR target/81408
index cea8fc022238ee3f52c5ab83174ada6ee0d5cd77..e79a57141f11692fa6d1b476ff5dcba83facf910 100644 (file)
@@ -1,3 +1,7 @@
+2017-07-18  Nathan Sidwell  <nathan@acm.org>
+
+       * c-warn.c (warn_for_memset): Use TYPE_{MIN,MAX}_VALUE.
+
 2017-07-14  David Malcolm  <dmalcolm@redhat.com>
 
        * c-common.c (try_to_locate_new_include_insertion_point): New
index b9378c2dbe2276066c1e57b2102f61cba22a3453..a8b38c1b98deae21fa6ce4f1baa5c2823cc91f19 100644 (file)
@@ -1799,12 +1799,12 @@ warn_for_memset (location_t loc, tree arg0, tree arg2,
          tree domain = TYPE_DOMAIN (type);
          if (!integer_onep (TYPE_SIZE_UNIT (elt_type))
              && domain != NULL_TREE
-             && TYPE_MAXVAL (domain)
-             && TYPE_MINVAL (domain)
-             && integer_zerop (TYPE_MINVAL (domain))
+             && TYPE_MAX_VALUE (domain)
+             && TYPE_MIN_VALUE (domain)
+             && integer_zerop (TYPE_MIN_VALUE (domain))
              && integer_onep (fold_build2 (MINUS_EXPR, domain,
                                            arg2,
-                                           TYPE_MAXVAL (domain))))
+                                           TYPE_MAX_VALUE (domain))))
            warning_at (loc, OPT_Wmemset_elt_size,
                        "%<memset%> used with length equal to "
                        "number of elements without multiplication "
index 42ef9a5dfb65d64af58c8692af3a3516f532c079..bfa9e9a879ffd9df09f6a1997f10bd6df43405d1 100644 (file)
@@ -1,3 +1,7 @@
+2017-07-18  Nathan Sidwell  <nathan@acm.org>
+
+       * c-parser.c (c_parser_array_notation): Use TYPE_{MIN,MAX}_VALUE.
+
 2017-07-14  David Malcolm  <dmalcolm@redhat.com>
 
        * c-decl.c (implicitly_declare): When suggesting a missing
index f8fbc92617213b9e10951f28dcd8d36097928c0f..eae7689319ac044b85164c18ca036611450b779a 100644 (file)
@@ -18238,18 +18238,18 @@ c_parser_array_notation (location_t loc, c_parser *parser, tree initial_index,
              return error_mark_node;
            }
 
-         start_index = TYPE_MINVAL (array_type_domain);
+         start_index = TYPE_MIN_VALUE (array_type_domain);
          start_index = fold_build1 (CONVERT_EXPR, ptrdiff_type_node,
                                     start_index);
-         if (!TYPE_MAXVAL (array_type_domain)
-             || !TREE_CONSTANT (TYPE_MAXVAL (array_type_domain)))
+         if (!TYPE_MAX_VALUE (array_type_domain)
+             || !TREE_CONSTANT (TYPE_MAX_VALUE (array_type_domain)))
            {
              error_at (loc, "start-index and length fields necessary for "
                        "using array notations in variable-length arrays");
              c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, NULL);
              return error_mark_node;
            }
-         end_index = TYPE_MAXVAL (array_type_domain);
+         end_index = TYPE_MAX_VALUE (array_type_domain);
          end_index = fold_build2 (PLUS_EXPR, TREE_TYPE (end_index),
                                   end_index, integer_one_node);
          end_index = fold_build1 (CONVERT_EXPR, ptrdiff_type_node, end_index);
index 9ecdf469d28594b639dd7d135dbcf1df5533b179..256d1ee1b8c3c3f1a80f356ee34ffe50326f15bd 100644 (file)
@@ -1,5 +1,8 @@
 2017-07-18  Nathan Sidwell  <nathan@acm.org>
 
+       * cp-array-notation.c (build_array_notation_ref): Use
+       TYPE_{MIN,MAX}_VALUE.
+
        * class.c (classtype_has_move_assign_or_move_ctor): Declare.
        (add_implicitly_declared_members): Use it.
        (type_has_move_constructor, type_has_move_assign): Merge into ...
index 36d66245224f5f953daf5a38b66df138ca667a7a..31be7d685ba76c78c7de650ee8add5f319e4d925 100644 (file)
@@ -1375,8 +1375,8 @@ build_array_notation_ref (location_t loc, tree array, tree start, tree length,
                    "using array notation with array of unknown bound");
          return error_mark_node;
        }
-      start = cp_fold_convert (ptrdiff_type_node, TYPE_MINVAL (domain));
-      length = size_binop (PLUS_EXPR, TYPE_MAXVAL (domain), size_one_node);
+      start = cp_fold_convert (ptrdiff_type_node, TYPE_MIN_VALUE (domain));
+      length = size_binop (PLUS_EXPR, TYPE_MAX_VALUE (domain), size_one_node);
       length = cp_fold_convert (ptrdiff_type_node, length);
     }
     
index c4ddb8edd419d22f8c1040535da8567404517f7f..ff72ba45ee94681c8e3919011f39a3357fde7e0f 100644 (file)
@@ -1,3 +1,7 @@
+2017-07-18  Nathan Sidwell  <nathan@acm.org>
+
+       * trans.c (gfc_build_array_ref): Use TYPE_MAX_VALUE.
+
 2017-07-09  Dominique d'Humieres  <dominiq@lps.ens.fr>
 
        PR fortran/81341
index 2323e0abe3d19db0cba247e633574725085eb4d3..8f0adde77e0d08e24b8606dac6fdf1d5f739f9e3 100644 (file)
@@ -334,15 +334,15 @@ gfc_build_array_ref (tree base, tree offset, tree decl, tree vptr)
   /* Use pointer arithmetic for deferred character length array
      references.  */
   if (type && TREE_CODE (type) == ARRAY_TYPE
-      && TYPE_MAXVAL (TYPE_DOMAIN (type)) != NULL_TREE
-      && (VAR_P (TYPE_MAXVAL (TYPE_DOMAIN (type)))
-         || TREE_CODE (TYPE_MAXVAL (TYPE_DOMAIN (type))) == INDIRECT_REF)
+      && TYPE_MAX_VALUE (TYPE_DOMAIN (type)) != NULL_TREE
+      && (VAR_P (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))
+         || TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) == INDIRECT_REF)
       && decl
-      && (TREE_CODE (TYPE_MAXVAL (TYPE_DOMAIN (type))) == INDIRECT_REF
+      && (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) == INDIRECT_REF
          || TREE_CODE (decl) == FUNCTION_DECL
-         || DECL_CONTEXT (TYPE_MAXVAL (TYPE_DOMAIN (type)))
-                                       == DECL_CONTEXT (decl)))
-    span = TYPE_MAXVAL (TYPE_DOMAIN (type));
+         || (DECL_CONTEXT (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))
+             == DECL_CONTEXT (decl))))
+    span = TYPE_MAX_VALUE (TYPE_DOMAIN (type));
   else
     span = NULL_TREE;
 
index cf9bc36936c5ed5599669f9b1a56dd610637167e..470964bebf79b895d3e51cf235234e736f8a1c83 100644 (file)
@@ -1824,7 +1824,7 @@ try_transform_to_exit_first_loop_alt (struct loop *loop,
   /* Figure out whether nit + 1 overflows.  */
   if (TREE_CODE (nit) == INTEGER_CST)
     {
-      if (!tree_int_cst_equal (nit, TYPE_MAXVAL (nit_type)))
+      if (!tree_int_cst_equal (nit, TYPE_MAX_VALUE (nit_type)))
        {
          alt_bound = fold_build2_loc (UNKNOWN_LOCATION, PLUS_EXPR, nit_type,
                                       nit, build_one_cst (nit_type));
@@ -1869,7 +1869,7 @@ try_transform_to_exit_first_loop_alt (struct loop *loop,
     return false;
 
   /* Check if nit + 1 overflows.  */
-  widest_int type_max = wi::to_widest (TYPE_MAXVAL (nit_type));
+  widest_int type_max = wi::to_widest (TYPE_MAX_VALUE (nit_type));
   if (nit_max >= type_max)
     return false;