diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 2f6e1f21a920..39e8895aeb1f 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,9 @@ +2018-02-16 Richard Biener + + PR bootstrap/82939 + * line-map.c (linemap_init): Avoid broken value-init when compiling + with GCC 4.2. + 2018-02-15 Jason Merrill Jakub Jelinek diff --git a/libcpp/line-map.c b/libcpp/line-map.c index 677acd6dd925..a84084c99f05 100644 --- a/libcpp/line-map.c +++ b/libcpp/line-map.c @@ -344,7 +344,12 @@ void linemap_init (struct line_maps *set, source_location builtin_location) { +#if __GNUC__ == 4 && __GNUC_MINOR__ == 2 && !defined (__clang__) + /* PR33916, needed to fix PR82939. */ + memset (set, 0, sizeof (struct line_maps)); +#else *set = line_maps (); +#endif set->highest_location = RESERVED_LOCATION_COUNT - 1; set->highest_line = RESERVED_LOCATION_COUNT - 1; set->location_adhoc_data_map.htab =