diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-10-08 12:32:07 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-10-08 12:32:07 +0200 |
commit | 094cefda513d464a72d77a6e892fc3c721d67dd6 (patch) | |
tree | c604f48cd1d2146c097de1c9ebfebfdbcf9457ec /gcc/ada/sem_aggr.adb | |
parent | 0ac2a660757afcfe00a3e81973ac4c00555dde40 (diff) | |
download | gcc-094cefda513d464a72d77a6e892fc3c721d67dd6.zip gcc-094cefda513d464a72d77a6e892fc3c721d67dd6.tar.gz gcc-094cefda513d464a72d77a6e892fc3c721d67dd6.tar.bz2 |
[multiple changes]
2010-10-08 Ed Schonberg <schonberg@adacore.com>
* sem_aggr.adb (Resolve_Array_Aggregate): If the expression in an
others choice is a literal analyze it now to enable later optimizations.
* exp_aggr.adb (Expand_Record_Aggregate): An aggregate with static size
and components can be handled by the backend even if it is of a limited
type.
2010-10-08 Arnaud Charlet <charlet@adacore.com>
* a-rttiev.adb (task Timer): Since this package may be elaborated
before System.Interrupt, we need to call Setup_Interrupt_Mask
explicitly to ensure that this task has the proper signal mask.
2010-10-08 Robert Dewar <dewar@adacore.com>
* freeze.adb (Freeze_Entity): For array case, move some processing for
pragma Pack, Component_Size clause and atomic/volatile components here
instead of trying to do the job in Sem_Ch13 and Freeze.
* layout.adb: Use new Addressable function
* sem_ch13.adb (Analyze_Attribute_Representation_Clause, case
Component_Size): Move some handling to freeze point in
Freeze.Freeze_Entity.
* sem_prag.adb (Analyze_pragma, case Pack): Move some handling to
freeze point in Freese.Freeze_Entity.
* sem_util.ads, sem_util.adb (Addressable): New function.
From-SVN: r165159
Diffstat (limited to 'gcc/ada/sem_aggr.adb')
-rw-r--r-- | gcc/ada/sem_aggr.adb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 8077491..b910ac7 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -1795,6 +1795,19 @@ package body Sem_Aggr is Expander_Mode_Save_And_Set (False); Full_Analysis := False; Analyze (Expr); + + -- If the expression is a literal, propagate this info + -- to the expression in the association, to enable some + -- optimizations downstream. + + if Is_Entity_Name (Expr) + and then Present (Entity (Expr)) + and then Ekind (Entity (Expr)) = E_Enumeration_Literal + then + Analyze_And_Resolve + (Expression (Assoc), Component_Typ); + end if; + Full_Analysis := Save_Analysis; Expander_Mode_Restore; |