]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix bootstrap on !NO_IMPLICIT_EXTERN_C and ia32 targets
authorDodji Seketeli <dodji@redhat.com>
Tue, 18 Oct 2011 08:44:49 +0000 (08:44 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Tue, 18 Oct 2011 08:44:49 +0000 (10:44 +0200)
libcpp/

* include/line-map.h (struct linemap_stats): Change the type of
the members from size_t to long.
* macro.c (macro_arg_token_iter_init): Unconditionally initialize
iter->location_ptr.

gcc/c-family/

* c-lex.c (fe_file_change): Use LINEMAP_SYSP when
!NO_IMPLICIT_EXTERN_C.

gcc/
* input.c (dump_line_table_statistics): Use long, not size_t.

From-SVN: r180124

gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-lex.c
gcc/input.c
libcpp/ChangeLog
libcpp/include/line-map.h
libcpp/line-map.c
libcpp/macro.c

index 9a816da80a845b00357ccb25fef18ca3888ca7f5..dfe8d99f29cb807f8c3e30a3171568309ad2f44f 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-18  Dodji Seketeli  <dodji@redhat.com>
+
+       PR bootstrap/50760
+       * input.c (dump_line_table_statistics): Use long, not size_t.
+
 2011-10-17  Eric Botcazou  <ebotcazou@adacore.com>
 
        * config/sparc/sparc.md (in_call_delay): Fix formatting issues.
index 117e7ddae7ff3dfe1fc5f917b81e233397d18c0f..917f9572251920a99bbd585e399ae2dd299b594b 100644 (file)
@@ -1,3 +1,9 @@
+2011-10-18  Dodji Seketeli  <dodji@redhat.com>
+
+       PR bootstrap/50760
+       * c-lex.c (fe_file_change): Use LINEMAP_SYSP when
+       !NO_IMPLICIT_EXTERN_C.
+
 2011-10-15  Tom Tromey  <tromey@redhat.com>
            Dodji Seketeli  <dodji@redhat.com>
 
index be83b61b34ca1f90b98680197dc25a106c1b7cea..b151564000cf9e1bcbf68fedd21af0258bf28d2e 100644 (file)
@@ -211,7 +211,7 @@ fe_file_change (const struct line_map *new_map)
 #ifndef NO_IMPLICIT_EXTERN_C
          if (c_header_level)
            ++c_header_level;
-         else if (new_map->sysp == 2)
+         else if (LINEMAP_SYSP (new_map) == 2)
            {
              c_header_level = 1;
              ++pending_lang_change;
@@ -224,7 +224,7 @@ fe_file_change (const struct line_map *new_map)
 #ifndef NO_IMPLICIT_EXTERN_C
       if (c_header_level && --c_header_level == 0)
        {
-         if (new_map->sysp == 2)
+         if (LINEMAP_SYSP (new_map) == 2)
            warning (0, "badly nested C headers from preprocessor");
          --pending_lang_change;
        }
index 41842b7530f197545943418feade16b6429db3c3..a780f5c7ee7b7958274be9132dbde728c87c8895 100644 (file)
@@ -80,7 +80,7 @@ void
 dump_line_table_statistics (void)
 {
   struct linemap_stats s;
-  size_t total_used_map_size,
+  long total_used_map_size,
     macro_maps_size,
     total_allocated_map_size;
 
@@ -99,45 +99,45 @@ dump_line_table_statistics (void)
     + s.macro_maps_used_size
     + s.macro_maps_locations_size;
 
-  fprintf (stderr, "Number of expanded macros:                     %5lu\n",
+  fprintf (stderr, "Number of expanded macros:                     %5ld\n",
            s.num_expanded_macros);
   if (s.num_expanded_macros != 0)
-    fprintf (stderr, "Average number of tokens per macro expansion:  %5lu\n",
+    fprintf (stderr, "Average number of tokens per macro expansion:  %5ld\n",
              s.num_macro_tokens / s.num_expanded_macros);
   fprintf (stderr,
            "\nLine Table allocations during the "
            "compilation process\n");
-  fprintf (stderr, "Number of ordinary maps used:        %5lu%c\n",
+  fprintf (stderr, "Number of ordinary maps used:        %5ld%c\n",
            SCALE (s.num_ordinary_maps_used),
            STAT_LABEL (s.num_ordinary_maps_used));
-  fprintf (stderr, "Ordinary map used size:              %5lu%c\n",
+  fprintf (stderr, "Ordinary map used size:              %5ld%c\n",
            SCALE (s.ordinary_maps_used_size),
            STAT_LABEL (s.ordinary_maps_used_size));
-  fprintf (stderr, "Number of ordinary maps allocated:   %5lu%c\n",
+  fprintf (stderr, "Number of ordinary maps allocated:   %5ld%c\n",
            SCALE (s.num_ordinary_maps_allocated),
            STAT_LABEL (s.num_ordinary_maps_allocated));
-  fprintf (stderr, "Ordinary maps allocated size:        %5lu%c\n",
+  fprintf (stderr, "Ordinary maps allocated size:        %5ld%c\n",
            SCALE (s.ordinary_maps_allocated_size),
            STAT_LABEL (s.ordinary_maps_allocated_size));
-  fprintf (stderr, "Number of macro maps used:           %5lu%c\n",
+  fprintf (stderr, "Number of macro maps used:           %5ld%c\n",
            SCALE (s.num_macro_maps_used),
            STAT_LABEL (s.num_macro_maps_used));
-  fprintf (stderr, "Macro maps used size:                %5lu%c\n",
+  fprintf (stderr, "Macro maps used size:                %5ld%c\n",
            SCALE (s.macro_maps_used_size),
            STAT_LABEL (s.macro_maps_used_size));
-  fprintf (stderr, "Macro maps locations size:           %5lu%c\n",
+  fprintf (stderr, "Macro maps locations size:           %5ld%c\n",
            SCALE (s.macro_maps_locations_size),
            STAT_LABEL (s.macro_maps_locations_size));
-  fprintf (stderr, "Macro maps size:                     %5lu%c\n",
+  fprintf (stderr, "Macro maps size:                     %5ld%c\n",
            SCALE (macro_maps_size),
            STAT_LABEL (macro_maps_size));
-  fprintf (stderr, "Duplicated maps locations size:      %5lu%c\n",
+  fprintf (stderr, "Duplicated maps locations size:      %5ld%c\n",
            SCALE (s.duplicated_macro_maps_locations_size),
            STAT_LABEL (s.duplicated_macro_maps_locations_size));
-  fprintf (stderr, "Total allocated maps size:           %5lu%c\n",
+  fprintf (stderr, "Total allocated maps size:           %5ld%c\n",
            SCALE (total_allocated_map_size),
            STAT_LABEL (total_allocated_map_size));
-  fprintf (stderr, "Total used maps size:                %5lu%c\n",
+  fprintf (stderr, "Total used maps size:                %5ld%c\n",
            SCALE (total_used_map_size),
            STAT_LABEL (total_used_map_size));
   fprintf (stderr, "\n");
index c81c9676e7606ee72f3162f3ad6a1414995e3965..bbb4085f012ea5d713f42106bbd713e9bddfd4de 100644 (file)
@@ -1,3 +1,11 @@
+2011-10-18  Dodji Seketeli  <dodji@redhat.com>
+
+       PR bootstrap/50760
+       * include/line-map.h (struct linemap_stats): Change the type of
+       the members from size_t to long.
+       * macro.c (macro_arg_token_iter_init): Unconditionally initialize
+       iter->location_ptr.
+
 2011-10-17  Dodji Seketeli  <dodji@redhat.com>
 
        * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
index 1e2a148e17bcf86a074a044cdbad8b0fbc0b490a..ef98f5935b323d4ae815274dda0cca66d9969523 100644 (file)
@@ -687,17 +687,17 @@ expanded_location linemap_expand_location_full (struct line_maps *,
    linemap_get_statistics.  */
 struct linemap_stats
 {
-  size_t num_ordinary_maps_allocated;
-  size_t num_ordinary_maps_used;
-  size_t ordinary_maps_allocated_size;
-  size_t ordinary_maps_used_size;
-  size_t num_expanded_macros;
-  size_t num_macro_tokens;
-  size_t num_macro_maps_used;
-  size_t macro_maps_allocated_size;
-  size_t macro_maps_used_size;
-  size_t macro_maps_locations_size;
-  size_t duplicated_macro_maps_locations_size;
+  long num_ordinary_maps_allocated;
+  long num_ordinary_maps_used;
+  long ordinary_maps_allocated_size;
+  long ordinary_maps_used_size;
+  long num_expanded_macros;
+  long num_macro_tokens;
+  long num_macro_maps_used;
+  long macro_maps_allocated_size;
+  long macro_maps_used_size;
+  long macro_maps_locations_size;
+  long duplicated_macro_maps_locations_size;
 };
 
 /* Compute and return statistics about the memory consumption of some
index 43e28565770bbb42b72d9b1e047a59d3c55b6c1a..fb3be3a5f60e44553a637a9610e4b54a17ffd95b 100644 (file)
@@ -1180,7 +1180,7 @@ void
 linemap_get_statistics (struct line_maps *set,
                        struct linemap_stats *s)
 {
-  size_t ordinary_maps_allocated_size, ordinary_maps_used_size,
+  long ordinary_maps_allocated_size, ordinary_maps_used_size,
     macro_maps_allocated_size, macro_maps_used_size,
     macro_maps_locations_size = 0, duplicated_macro_maps_locations_size = 0;
 
index 2d0eeaa0388bfd7d45f2d8b655978db495299d41..f3139590d5045b128709296d1abbb81753284f10 100644 (file)
@@ -1278,6 +1278,10 @@ macro_arg_token_iter_init (macro_arg_token_iter *iter,
   iter->track_macro_exp_p = track_macro_exp_p;
   iter->kind = kind;
   iter->token_ptr = token_ptr;
+  /* Unconditionally initialize this so that the compiler doesn't warn
+     about iter->location_ptr being possibly uninitialized later after
+     this code has been inlined somewhere.  */
+  iter->location_ptr = NULL;
   if (track_macro_exp_p)
     iter->location_ptr = get_arg_token_location (arg, kind);
 #ifdef ENABLE_CHECKING