diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2011-10-26 20:32:17 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-10-26 20:32:17 +0000 |
commit | 0025cb638168df0f3d7a845fa9e11a308a719b05 (patch) | |
tree | 64fc8636996c2d631bd7438c08224c14fa23f469 /gcc/ada/gcc-interface/decl.c | |
parent | 24847495f3558a50ce191cc8c70bc4b24b58ac09 (diff) | |
download | gcc-0025cb638168df0f3d7a845fa9e11a308a719b05.zip gcc-0025cb638168df0f3d7a845fa9e11a308a719b05.tar.gz gcc-0025cb638168df0f3d7a845fa9e11a308a719b05.tar.bz2 |
decl.c (gnat_to_gnu_field): Always check components declared as atomic.
* gcc-interface/decl.c (gnat_to_gnu_field): Always check components
declared as atomic. Move around conditionally executed code.
From-SVN: r180539
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 71a4639..d6bfe9c 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -6853,10 +6853,8 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed, } } - /* If we are packing the record and the field is BLKmode, round the - size up to a byte boundary. */ - if (packed && TYPE_MODE (gnu_field_type) == BLKmode && gnu_size) - gnu_size = round_up (gnu_size, BITS_PER_UNIT); + if (Is_Atomic (gnat_field)) + check_ok_for_atomic (gnu_field_type, gnat_field, false); if (Present (Component_Clause (gnat_field))) { @@ -6946,9 +6944,6 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed, gnu_pos = NULL_TREE; } } - - if (Is_Atomic (gnat_field)) - check_ok_for_atomic (gnu_field_type, gnat_field, false); } /* If the record has rep clauses and this is the tag field, make a rep @@ -6961,7 +6956,14 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed, } else - gnu_pos = NULL_TREE; + { + gnu_pos = NULL_TREE; + + /* If we are packing the record and the field is BLKmode, round the + size up to a byte boundary. */ + if (packed && TYPE_MODE (gnu_field_type) == BLKmode && gnu_size) + gnu_size = round_up (gnu_size, BITS_PER_UNIT); + } /* We need to make the size the maximum for the type if it is self-referential and an unconstrained type. In that case, we can't |