diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-08-01 15:23:00 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-08-01 15:23:00 +0200 |
commit | 511c5197c7964009f989f7a6d03ef2858d0fe6c0 (patch) | |
tree | 4fb5f7a11ed714d9091d088929c02862121e9746 | |
parent | 9741d942c2fd2ec06ef975c671eb600abb079d8a (diff) | |
download | gcc-511c5197c7964009f989f7a6d03ef2858d0fe6c0.zip gcc-511c5197c7964009f989f7a6d03ef2858d0fe6c0.tar.gz gcc-511c5197c7964009f989f7a6d03ef2858d0fe6c0.tar.bz2 |
[multiple changes]
2014-08-01 Robert Dewar <dewar@adacore.com>
* debug.adb: Document debug switch -gnatd.Z.
* sem.adb (Semantics): Force expansion on in no or configurable
run time mode.
2014-08-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Loop_Parameter_Specification): An
unchecked conversion denotes an iterator specification. Such a
conversion will be inserted in the context of an inlined call
when needed, and its argument is always an object.
From-SVN: r213456
-rw-r--r-- | gcc/ada/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/ada/debug.adb | 8 | ||||
-rw-r--r-- | gcc/ada/sem.adb | 24 | ||||
-rw-r--r-- | gcc/ada/sem_ch5.adb | 7 |
4 files changed, 49 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 811742c..de55932 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,18 @@ 2014-08-01 Robert Dewar <dewar@adacore.com> + * debug.adb: Document debug switch -gnatd.Z. + * sem.adb (Semantics): Force expansion on in no or configurable + run time mode. + +2014-08-01 Ed Schonberg <schonberg@adacore.com> + + * sem_ch5.adb (Analyze_Loop_Parameter_Specification): An + unchecked conversion denotes an iterator specification. Such a + conversion will be inserted in the context of an inlined call + when needed, and its argument is always an object. + +2014-08-01 Robert Dewar <dewar@adacore.com> + * make.adb, makeutl.ads: Minor reformatting. * debug.adb, opt.ads: Clarify documentation of Front_End_Inlining and Back_End_Inlining. diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index 0896c85..715e44a 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -143,7 +143,7 @@ package body Debug is -- d.W Print out debugging information for Walk_Library_Items -- d.X Old treatment of indexing aspects -- d.Y - -- d.Z + -- d.Z Do not enable expansion in configurable run-time mode -- d1 Error msgs have node numbers where possible -- d2 Eliminate error flags in verbose form error messages @@ -686,6 +686,12 @@ package body Debug is -- is preserved temporarily for use by the modelling project under -- debug flag d.X. + -- d.Z Normally we always enable expansion in configurable run-time mode + -- to make sure we get error messages about unsupported features even + -- when compiling in -gnatc mode. But expansion is turned off in this + -- case if debug flag -gnatd.Z is used. This is to deal with the case + -- where we discover difficulties in this new processing. + -- d1 Error messages have node numbers where possible. Normally error -- messages have only source locations. This option is useful when -- debugging errors caused by expanded code, where the source location diff --git a/gcc/ada/sem.adb b/gcc/ada/sem.adb index eb3501e..73f345e 100644 --- a/gcc/ada/sem.adb +++ b/gcc/ada/sem.adb @@ -1410,11 +1410,33 @@ package body Sem is GNAT_Mode := True; end if; + -- For generic main, never do expansion + if Generic_Main then Expander_Mode_Save_And_Set (False); + + -- Non generic case + else Expander_Mode_Save_And_Set - (Operating_Mode = Generate_Code or Debug_Flag_X); + + -- Turn on expansion if generating code + + (Operating_Mode = Generate_Code + + -- or if special debug flag -gnatdx is set + + or else Debug_Flag_X + + -- Or if in configuration run-time mode. We do this so we get + -- error messages about missing entities in the run-time even + -- if we are compiling in -gnatc (no code generation) mode. + -- Similar processing applies to No_Run_Time_Mode. However, + -- don't do this if debug flag -gnatd.Z is set (this is to handle + -- a situation where this new processing causes trouble). + + or else ((Configurable_Run_Time_Mode or No_Run_Time_Mode) + and not Debug_Flag_Dot_ZZ)); end if; Full_Analysis := True; diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 3d8d3f6..ffdf881 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -2510,16 +2510,21 @@ package body Sem_Ch5 is -- a) a function call, -- b) an identifier that is not a type, -- c) an attribute reference 'Old (within a postcondition) + -- d) an unchecked conversion -- then it is an iteration over a container. It was classified as -- a loop specification by the parser, and must be rewritten now - -- to activate container iteration. + -- to activate container iteration. The last case will occur within + -- an expanded inlined call, where the expansion wraps an actual in + -- an unchecked conversion when needed. The expression of the + -- conversion is always an object. if Nkind (DS_Copy) = N_Function_Call or else (Is_Entity_Name (DS_Copy) and then not Is_Type (Entity (DS_Copy))) or else (Nkind (DS_Copy) = N_Attribute_Reference and then Attribute_Name (DS_Copy) = Name_Old) + or else Nkind (DS_Copy) = N_Unchecked_Type_Conversion then -- This is an iterator specification. Rewrite it as such and -- analyze it to capture function calls that may require |