From edca997e57edcca3a671d645aedf06680342b8fd Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 6 Mar 2017 23:51:23 +0100 Subject: [PATCH] re PR c++/79821 (SEGV in cc1plus compiling 64-bit stdc++.h.gch/O2g.gch) PR c++/79821 * dwarf2out.h (dw_vec_const): Change array type from unsigned char * to void * for PCH reasons. * dwarf2out.c (output_loc_operands, output_die): Cast v.val_vec.array to unsigned char *. From-SVN: r245932 --- gcc/ChangeLog | 8 ++++++++ gcc/dwarf2out.c | 6 +++--- gcc/dwarf2out.h | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bd424cbdf58..feedbaf1b3d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-03-06 Jakub Jelinek + + PR c++/79821 + * dwarf2out.h (dw_vec_const): Change array type from unsigned char * + to void * for PCH reasons. + * dwarf2out.c (output_loc_operands, output_die): Cast + v.val_vec.array to unsigned char *. + 2017-03-06 John David Anglin PR target 77850 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 87060a33804..0bbb90ed3aa 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -2020,7 +2020,7 @@ output_loc_operands (dw_loc_descr_ref loc, int for_eh_or_skip) elt_size /= 2; len *= 2; } - for (i = 0, p = val2->v.val_vec.array; + for (i = 0, p = (unsigned char *) val2->v.val_vec.array; i < len; i++, p += elt_size) dw2_asm_output_data (elt_size, extract_int (p, elt_size), @@ -2273,7 +2273,7 @@ output_loc_operands (dw_loc_descr_ref loc, int for_eh_or_skip) elt_size /= 2; len *= 2; } - for (i = 0, p = val2->v.val_vec.array; + for (i = 0, p = (unsigned char *) val2->v.val_vec.array; i < len; i++, p += elt_size) dw2_asm_output_data (elt_size, extract_int (p, elt_size), @@ -10105,7 +10105,7 @@ output_die (dw_die_ref die) elt_size /= 2; len *= 2; } - for (i = 0, p = a->dw_attr_val.v.val_vec.array; + for (i = 0, p = (unsigned char *) a->dw_attr_val.v.val_vec.array; i < len; i++, p += elt_size) dw2_asm_output_data (elt_size, extract_int (p, elt_size), diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h index 79dc4391753..940247316d3 100644 --- a/gcc/dwarf2out.h +++ b/gcc/dwarf2out.h @@ -163,7 +163,7 @@ enum dw_val_class /* Describe a floating point constant value, or a vector constant value. */ struct GTY(()) dw_vec_const { - unsigned char * GTY((atomic)) array; + void * GTY((atomic)) array; unsigned length; unsigned elt_size; }; -- 2.30.2