diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-01-23 17:36:41 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-01-23 17:36:41 +0100 |
commit | 53c53f6dc8715875e50215077ff53612d08b3de2 (patch) | |
tree | 50378523b7bf6843de025ee2dc6af4cf8d7017c7 /gcc/ada/sem_util.adb | |
parent | ea15e254ea970653f092da0993d99b15b1f2283b (diff) | |
download | gcc-53c53f6dc8715875e50215077ff53612d08b3de2.zip gcc-53c53f6dc8715875e50215077ff53612d08b3de2.tar.gz gcc-53c53f6dc8715875e50215077ff53612d08b3de2.tar.bz2 |
[multiple changes]
2014-01-23 Robert Dewar <dewar@adacore.com>
* exp_util.adb, sinfo.adb, sinfo.ads, sem.adb, sem_res.adb,
expander.adb, exp_ch11.adb, exp_ch11.ads, sem_ch11.adb, sem_ch11.ads,
sprint.adb, sprint.ads: Remove unused node N_Subprogram_Info.
2014-01-23 Emmanuel Briot <briot@adacore.com>
* prj-conf.adb (Get_Or_Create_Configuration_File): call
On_Load_Config later.
2014-01-23 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch3.adb (Analyze_Declarations): Do not
generate the spec of the late primitive in ASIS mode. Add two
comments to explain the special cases when the expansion is
not performed.
2014-01-23 Robert Dewar <dewar@adacore.com>
* sem_util.adb (Note_Possible_Modification): Fix error of
misbehaving for implicit dereference cases in -gnatc mode.
2014-01-23 Emmanuel Briot <briot@adacore.com>
* prj-pars.adb: Minor reformatting.
From-SVN: r206980
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r-- | gcc/ada/sem_util.adb | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 6ba2a16..392d555a 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -13344,7 +13344,6 @@ package body Sem_Util is Exp := N; loop - <<Continue>> Ent := Empty; if Is_Entity_Name (Exp) then @@ -13370,8 +13369,7 @@ package body Sem_Util is end if; if Nkind (P) = N_Selected_Component - and then - Present (Entry_Formal (Entity (Selector_Name (P)))) + and then Present (Entry_Formal (Entity (Selector_Name (P)))) then -- Case of a reference to an entry formal @@ -13380,8 +13378,8 @@ package body Sem_Util is elsif Nkind (P) = N_Identifier and then Nkind (Parent (Entity (P))) = N_Object_Declaration and then Present (Expression (Parent (Entity (P)))) - and then Nkind (Expression (Parent (Entity (P)))) - = N_Reference + and then Nkind (Expression (Parent (Entity (P)))) = + N_Reference then -- Case of a reference to a value on which side effects have -- been removed. @@ -13391,7 +13389,6 @@ package body Sem_Util is else return; - end if; end; @@ -13405,8 +13402,24 @@ package body Sem_Util is N_Indexed_Component, N_Selected_Component) then - Exp := Prefix (Exp); - goto Continue; + -- Special check, if the prefix is an access type, then return + -- since we are modifying the thing pointed to, not the prefix. + -- When we are expanding, most usually the prefix is replaced + -- by an explicit dereference, and this test is not needed, but + -- in some cases (notably -gnatc mode and generics) when we do + -- not do full expansion, we need this special test. + + if Is_Access_Type (Etype (Prefix (Exp))) then + return; + + -- Otherwise go to prefix and keep going + + else + Exp := Prefix (Exp); + goto Continue; + end if; + + -- All other cases, not a modification else return; @@ -13539,6 +13552,9 @@ package body Sem_Util is return; end if; + + <<Continue>> + null; end loop; end Note_Possible_Modification; |