aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2007-09-08 10:02:28 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2007-09-08 10:02:28 +0000
commitd9e161ce8f4097b04ab05121fed4f79c9bb609f6 (patch)
treea6ea51cc23507f13421159b63f8269f06f0fb1da /gcc/ada/decl.c
parentdab1260138c4b5347270ecd535428116b2acab72 (diff)
downloadgcc-d9e161ce8f4097b04ab05121fed4f79c9bb609f6.zip
gcc-d9e161ce8f4097b04ab05121fed4f79c9bb609f6.tar.gz
gcc-d9e161ce8f4097b04ab05121fed4f79c9bb609f6.tar.bz2
decl.c (make_packable_type): If the new type has been given BLKmode, try again to get an integral mode for it.
* decl.c (make_packable_type): If the new type has been given BLKmode, try again to get an integral mode for it. From-SVN: r128266
Diffstat (limited to 'gcc/ada/decl.c')
-rw-r--r--gcc/ada/decl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index c293cea..7a01327 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -5218,6 +5218,13 @@ make_packable_type (tree type)
finish_record_type (new_type, nreverse (field_list), 1, true);
copy_alias_set (new_type, type);
+
+ /* Try harder to get a packable type if necessary, for example
+ in case the record itself contains a BLKmode field. */
+ if (TYPE_MODE (new_type) == BLKmode)
+ TYPE_MODE (new_type)
+ = mode_for_size_tree (TYPE_SIZE (new_type), MODE_INT, 1);
+
return TYPE_MODE (new_type) == BLKmode ? type : new_type;
}