diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-09-06 15:21:31 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-09-06 15:21:31 +0200 |
commit | c48e0f27232aa6604b80e0d15b6ecb50604400a7 (patch) | |
tree | bfddb1ebb7a5ebb47669f302259856ea4f5a805a /gcc/ada/layout.adb | |
parent | a87169db7dc0667a978e3f5b63e0fca648d3b793 (diff) | |
download | gcc-c48e0f27232aa6604b80e0d15b6ecb50604400a7.zip gcc-c48e0f27232aa6604b80e0d15b6ecb50604400a7.tar.gz gcc-c48e0f27232aa6604b80e0d15b6ecb50604400a7.tar.bz2 |
[multiple changes]
2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch3.adb, sem_aux.adb, sem_res.adb: Minor reformatting.
2017-09-06 Yannick Moy <moy@adacore.com>
* sem_ch12.adb (Analyze_Instance_And_Renamings): Refactor to set
global variable Ignore_SPARK_Mode_Pragmas_In_Instance only once.
2017-09-06 Bob Duff <duff@adacore.com>
* sem_ch8.adb: Change Assert to be consistent with
other similar ones.
2017-09-06 Bob Duff <duff@adacore.com>
* binde.adb (Find_Elab_Order): Do not run Elab_Old unless
requested. Previously, the -do switch meant "run Elab_New and
Elab_Old and use the order chosen by Elab_Old, possibly with
debugging printouts comparing the two orders." Now it means
"do not run Elab_New." This is of use if there are bugs that
cause Elab_New to crash.
(Elab_Position, Num_Chosen): Change type to Nat, to avoid various
type conversions.
* ali.ads (Elab_Position): Change type to Nat, to avoid various
type conversions.
2017-09-06 Arnaud Charlet <charlet@adacore.com>
* sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Fix
reference to SPARK RM.
2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
* layout.adb: Use SSU short hand consistently throughout the file.
2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
* freeze.adb (Freeze_Record_Type)
<Sized_Component_Total_Round_RM_Size>: New local variable to
accumulate the rounded RM_Size of components. Update it for
every component whose RM_Size is statically known. Add missing
guard to check that bit packing is really required before issuing
the error about packing. Swap condition for clarity's sake.
* sem_prag.adb (Usage_Error): fix reference to
SPARK RM in comment
2017-09-06 Fedor Rybin <frybin@adacore.com>
* makeutl.adb, makeutl.ads, mlib.adb, mlib.ads, mlib-fil.adb,
mlib-fil.ads, mlib-prj.adb, mlib-prj.ads, mlib-tgt.adb, mlib-tgt.ads,
mlib-tgt-specific.adb, mlib-tgt-specific.ads,
mlib-tgt-specific-aix.adb, mlib-tgt-specific-darwin.adb,
mlib-tgt-specific-hpux.adb, mlib-tgt-specific-linux.adb,
mlib-tgt-specific-mingw.adb, mlib-tgt-specific-solaris.adb,
mlib-tgt-specific-vxworks.adb, mlib-tgt-specific-xi.adb, mlib-utl.adb,
mlib-utl.ads, prj.adb, prj.ads, prj-attr.adb, prj-attr.ads,
prj-attr-pm.adb, prj-attr-pm.ads, prj-com.ads, prj-conf.adb,
prj-conf.ads, prj-dect.adb, prj-dect.ads, prj-env.adb, prj-env.ads,
prj-err.adb, prj-err.ads, prj-ext.adb, prj-ext.ads, prj-makr.adb,
prj-makr.ads, prj-nmsc.adb, prj-nmsc.ads, prj-pars.adb, prj-pars.ads,
prj-part.adb, prj-part.ads, prj-pp.adb, prj-pp.ads, prj-proc.adb,
prj-proc.ads, prj-strt.adb, prj-strt.ads, prj-tree.adb, prj-tree.ads,
prj-util.adb, prj-util.ads, sinput-p.adb, sinput-p.ads: Remove obsolete
project manager sources.
2017-09-06 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Assigment): If the left-hand side is an
entity of a mutable type and the right-hand side is a conditional
expression, resolve the alternatives of the conditional using
the base type of the target entity, because the alternatives
may have distinct subtypes. This is particularly relevant if
the alternatives are aggregates.
From-SVN: r251797
Diffstat (limited to 'gcc/ada/layout.adb')
-rw-r--r-- | gcc/ada/layout.adb | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb index 4373a97..577cf04 100644 --- a/gcc/ada/layout.adb +++ b/gcc/ada/layout.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2016, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2017, 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- -- @@ -2728,8 +2728,8 @@ package body Layout is -- this means it will be storage-unit addressable). if Is_Scalar_Type (E) then - if Size <= System_Storage_Unit then - Init_Esize (E, System_Storage_Unit); + if Size <= SSU then + Init_Esize (E, SSU); elsif Size <= 16 then Init_Esize (E, 16); elsif Size <= 32 then @@ -2741,7 +2741,7 @@ package body Layout is -- Finally, make sure that alignment is consistent with -- the newly assigned size. - while Alignment (E) * System_Storage_Unit < Esize (E) + while Alignment (E) * SSU < Esize (E) and then Alignment (E) < Maximum_Alignment loop Set_Alignment (E, 2 * Alignment (E)); @@ -2971,11 +2971,11 @@ package body Layout is -- Reset alignment to match size if the known size is exactly 2, 4, -- or 8 storage units. - if Siz = 2 * System_Storage_Unit then + if Siz = 2 * SSU then Align := 2; - elsif Siz = 4 * System_Storage_Unit then + elsif Siz = 4 * SSU then Align := 4; - elsif Siz = 8 * System_Storage_Unit then + elsif Siz = 8 * SSU then Align := 8; -- If Optimize_Alignment is set to Space, then make sure the @@ -2983,11 +2983,11 @@ package body Layout is -- bytes then we want an alignment of 1 for the type. elsif Optimize_Alignment_Space (E) then - if Siz mod (8 * System_Storage_Unit) = 0 then + if Siz mod (8 * SSU) = 0 then Align := 8; - elsif Siz mod (4 * System_Storage_Unit) = 0 then + elsif Siz mod (4 * SSU) = 0 then Align := 4; - elsif Siz mod (2 * System_Storage_Unit) = 0 then + elsif Siz mod (2 * SSU) = 0 then Align := 2; else Align := 1; @@ -2998,14 +2998,14 @@ package body Layout is -- alignment of 4. elsif Optimize_Alignment_Time (E) - and then Siz > System_Storage_Unit - and then Siz <= 8 * System_Storage_Unit + and then Siz > SSU + and then Siz <= 8 * SSU then - if Siz <= 2 * System_Storage_Unit then + if Siz <= 2 * SSU then Align := 2; - elsif Siz <= 4 * System_Storage_Unit then + elsif Siz <= 4 * SSU then Align := 4; - else -- Siz <= 8 * System_Storage_Unit then + else -- Siz <= 8 * SSU then Align := 8; end if; @@ -3034,10 +3034,10 @@ package body Layout is -- words in any case. Omit this if we are optimizing for time, -- since conceivably we may be able to do better. - if Align > System_Word_Size / System_Storage_Unit + if Align > System_Word_Size / SSU and then not Optimize_Alignment_Time (E) then - Align := System_Word_Size / System_Storage_Unit; + Align := System_Word_Size / SSU; end if; -- Check components. If any component requires a higher alignment, @@ -3068,8 +3068,7 @@ package body Layout is (Unknown_Esize (Comp) or else (Known_Static_Esize (Comp) and then - Esize (Comp) = - Calign * System_Storage_Unit)) + Esize (Comp) = Calign * SSU)) then Align := UI_To_Int (Calign); end if; @@ -3088,9 +3087,9 @@ package body Layout is Set_Alignment (E, UI_From_Int (Align)); if Known_Static_Esize (E) - and then Esize (E) < Align * System_Storage_Unit + and then Esize (E) < Align * SSU then - Set_Esize (E, UI_From_Int (Align * System_Storage_Unit)); + Set_Esize (E, UI_From_Int (Align * SSU)); end if; end Set_Composite_Alignment; |