From: Eric Botcazou Date: Tue, 3 Dec 2019 23:10:46 +0000 (+0000) Subject: re PR bootstrap/92783 (SEGV in field_byte_offset) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd2a16c741f11935fef856e29e6c71d27fd5c741;p=gcc.git re PR bootstrap/92783 (SEGV in field_byte_offset) PR bootstrap/92783 * gcc-interface/utils.c (rest_of_record_type_compilation): Move down the guard for the position of fields in the descriptive type. From-SVN: r278948 --- diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 7217eeaf350..fa98a5a9687 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -2246,13 +2246,6 @@ rest_of_record_type_compilation (tree record_type) pos = compute_related_constant (curpos, last_pos); } - /* If we can't compute a position, set it to zero. - - ??? We really should abort here, but it's too much work - to get this correct for all cases. */ - if (!pos) - pos = bitsize_zero_node; - /* See if this type is variable-sized and make a pointer type and indicate the indirection if so. Beware that the debug back-end may adjust the position computed above according @@ -2273,6 +2266,13 @@ rest_of_record_type_compilation (tree record_type) } } + /* If we can't compute a position, set it to zero. + + ??? We really should abort here, but it's too much work + to get this correct for all cases. */ + if (!pos) + pos = bitsize_zero_node; + /* Make a new field name, if necessary. */ if (var || align != 0) {