diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-26 09:45:37 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-26 09:45:37 +0000 |
commit | a60794e6191ed946a74284e95d6d1f35b0c2bf79 (patch) | |
tree | 332087b968fe63a4bb96f59b2844c041ca6d2696 /gcc/ada/layout.adb | |
parent | 2884c9d14edd0b821b7bb336cac13b73b547743c (diff) | |
download | ppe42-gcc-a60794e6191ed946a74284e95d6d1f35b0c2bf79.tar.gz ppe42-gcc-a60794e6191ed946a74284e95d6d1f35b0c2bf79.zip |
2012-04-26 Hristian Kirtchev <kirtchev@adacore.com>
* einfo.adb (Proper_First_Index): Moved from Sem_Util.
* einfo.ads: Add new synthesized attribute Proper_First_Index
along with usage in nodes.
(Proper_First_Index): Moved from Sem_Util.
* sem_util.ads, sem_util.adb (Proper_First_Index): Moved to Einfo.
2012-04-26 Gary Dismukes <dismukes@adacore.com>
* layout.adb (Layout_Component_List): Test for the case of a
single variant and the size of its component list was computed
as an integer literal, and use that size (which is in bits)
as is rather than converting to storage units.
2012-04-26 Robert Dewar <dewar@adacore.com>
* exp_aggr.adb: Minor reformatting.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186866 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/layout.adb')
-rw-r--r-- | gcc/ada/layout.adb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb index 519fad0f357..9b6c0ce9f94 100644 --- a/gcc/ada/layout.adb +++ b/gcc/ada/layout.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2011, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2012, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -2135,7 +2135,18 @@ package body Layout is -- others case. if No (RM_Siz_Expr) then - RM_Siz_Expr := Bits_To_SU (RM_SizV); + + -- If this is the only variant and the size is a + -- literal, then use bit size as is, otherwise convert + -- to storage units and continue to the next variant. + + if No (Prev (Var)) + and then Nkind (RM_SizV) = N_Integer_Literal + then + RM_Siz_Expr := RM_SizV; + else + RM_Siz_Expr := Bits_To_SU (RM_SizV); + end if; -- Otherwise construct the appropriate test |