From dd2a16c741f11935fef856e29e6c71d27fd5c741 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 3 Dec 2019 23:10:46 +0000 Subject: [PATCH] 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 --- gcc/ada/gcc-interface/utils.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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) { -- 2.30.2