From cb27986c9b5f270f880089d0bda74d10e76e8a3d Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 14 Apr 2014 13:33:23 +0000 Subject: stor-layout.c (place_field): Finalize non-constant offset for the field, if any. * stor-layout.c (place_field): Finalize non-constant offset for the field, if any. ada/ * gcc-interface/decl.c (create_field_decl_from): Finalize non-constant offset for the field, if any. From-SVN: r209369 --- gcc/stor-layout.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/stor-layout.c') diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 084d195..e3f8406 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1417,6 +1417,10 @@ place_field (record_layout_info rli, tree field) DECL_FIELD_BIT_OFFSET (field) = rli->bitpos; SET_DECL_OFFSET_ALIGN (field, rli->offset_align); + /* Evaluate nonconstant offsets only once, either now or as soon as safe. */ + if (TREE_CODE (DECL_FIELD_OFFSET (field)) != INTEGER_CST) + DECL_FIELD_OFFSET (field) = variable_size (DECL_FIELD_OFFSET (field)); + /* If this field ended up more aligned than we thought it would be (we approximate this by seeing if its position changed), lay out the field again; perhaps we can use an integral mode for it now. */ -- cgit v1.1