]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR bootstrap/50167 (gmp memory functions are extern "C" (graphite))
authorMarc Glisse <marc.glisse@inria.fr>
Thu, 3 Jan 2013 20:06:49 +0000 (21:06 +0100)
committerMarc Glisse <glisse@gcc.gnu.org>
Thu, 3 Jan 2013 20:06:49 +0000 (20:06 +0000)
2013-01-03  Marc Glisse  <marc.glisse@inria.fr>

PR bootstrap/50167
gcc/
* graphite-interchange.c (pdr_stride_in_loop): Use gmp_fprintf.
* graphite-poly.c (debug_gmp_value): Likewise.

PR bootstrap/50177
libcpp/
* line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
(new_linemap): Likewise.
(linemap_enter_macro): Likewise.

From-SVN: r194868

gcc/ChangeLog
gcc/graphite-interchange.c
gcc/graphite-poly.c
libcpp/ChangeLog
libcpp/line-map.c

index bf83a07336cb5d5e786741298ce4e2dfc9109b51..80bfc2f86b678620a46d70d90773e5663242dd0b 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-03  Marc Glisse  <marc.glisse@inria.fr>
+
+       PR bootstrap/50167
+       * graphite-interchange.c (pdr_stride_in_loop): Use gmp_fprintf.
+       * graphite-poly.c (debug_gmp_value): Likewise.
+
 2013-01-03  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/55712
index eb1a8b5bc29ce8c92e1b15c90df74dec3a72c310..4b9762777bc921643ced9afc5e9ddd4d733a1622 100644 (file)
@@ -240,15 +240,8 @@ pdr_stride_in_loop (mpz_t stride, graphite_dim_t depth, poly_dr_p pdr)
 
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
-      char *str;
-      void (*gmp_free) (void *, size_t);
-
-      fprintf (dump_file, "\nStride in BB_%d, DR_%d, depth %d:",
-              pbb_index (pbb), PDR_ID (pdr), (int) depth);
-      str = mpz_get_str (0, 10, stride);
-      fprintf (dump_file, "  %s ", str);
-      mp_get_memory_functions (NULL, NULL, &gmp_free);
-      (*gmp_free) (str, strlen (str) + 1);
+      gmp_fprintf (dump_file, "\nStride in BB_%d, DR_%d, depth %d:  %Zd ",
+                  pbb_index (pbb), PDR_ID (pdr), (int) depth, stride);
     }
 }
 
index 21bab940f3efdb7eb709330a2869165505e0684a..066238748843d29105801e02c327ac8d57dfa6d6 100644 (file)
@@ -55,12 +55,7 @@ along with GCC; see the file COPYING3.  If not see
 DEBUG_FUNCTION void
 debug_gmp_value (mpz_t val)
 {
-  char *str = mpz_get_str (0, 10, val);
-  void (*gmp_free) (void *, size_t);
-
-  fprintf (stderr, "%s", str);
-  mp_get_memory_functions (NULL, NULL, &gmp_free);
-  (*gmp_free) (str, strlen (str) + 1);
+  gmp_fprintf (stderr, "%Zd", val);
 }
 
 /* Return the maximal loop depth in SCOP.  */
index fc78ca810607e5b8a69b969e8e7df4dc7c8e2218..332efa3ab9d9ca170d9f17af94e6fceafbd00f6f 100644 (file)
@@ -1,3 +1,10 @@
+2013-01-03  Marc Glisse  <marc.glisse@inria.fr>
+
+       PR bootstrap/50177
+       * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
+       (new_linemap): Likewise.
+       (linemap_enter_macro): Likewise.
+
 2012-12-03  Jakub Jelinek  <jakub@redhat.com>
 
        PR bootstrap/55380
index 61ab0318c036f79b029b05ba17fd4fefc55090f6..49b94871baaf0c34d7c4693cf90098d4c0e41a7a 100644 (file)
@@ -122,8 +122,10 @@ get_combined_adhoc_loc (struct line_maps *set,
        {
          char *orig_data = (char *) set->location_adhoc_data_map.data;
          long long offset;
-         line_map_realloc reallocator
-             = set->reallocator ? set->reallocator : xrealloc;
+         /* Cast away extern "C" from the type of xrealloc.  */
+         line_map_realloc reallocator = (set->reallocator
+                                         ? set->reallocator
+                                         : (line_map_realloc) xrealloc);
 
          if (set->location_adhoc_data_map.allocated == 0)
            set->location_adhoc_data_map.allocated = 128;
@@ -217,8 +219,10 @@ new_linemap (struct line_maps *set,
       /* We ran out of allocated line maps. Let's allocate more.  */
       unsigned alloc_size;
 
-      line_map_realloc reallocator
-       = set->reallocator ? set->reallocator : xrealloc;
+      /* Cast away extern "C" from the type of xrealloc.  */
+      line_map_realloc reallocator = (set->reallocator
+                                     ? set->reallocator
+                                     : (line_map_realloc) xrealloc);
       line_map_round_alloc_size_func round_alloc_size =
        set->round_alloc_size;
 
@@ -430,8 +434,10 @@ linemap_enter_macro (struct line_maps *set, struct cpp_hashnode *macro_node,
 {
   struct line_map *map;
   source_location start_location;
-  line_map_realloc reallocator
-    = set->reallocator ? set->reallocator : xrealloc;
+  /* Cast away extern "C" from the type of xrealloc.  */
+  line_map_realloc reallocator = (set->reallocator
+                                 ? set->reallocator
+                                 : (line_map_realloc) xrealloc);
 
   start_location = LINEMAPS_MACRO_LOWEST_LOCATION (set) - num_tokens;