From 96af89e481ae79d5137f7ce9bd714cc196459fa3 Mon Sep 17 00:00:00 2001 From: charlet Date: Wed, 23 Nov 2011 11:24:48 +0000 Subject: 2011-11-23 Robert Dewar * sem_ch9.adb (Analyze_Entry_Declaration): Check for entry family bounds out of range. 2011-11-23 Matthew Heaney * a-cohama.adb, a-cihama.adb, a-cbhama.adb (Iterator): Declare type as limited, and remove node component. (First, Next): Forward call to corresponding cursor-based operation. (Iterate): Representation of iterator no longer has node component. 2011-11-23 Yannick Moy * exp_util.adb: Revert previous change to remove side-effects in Alfa mode, which is not the correct thing to do for renamings. 2011-11-23 Thomas Quinot * s-osinte-hpux.ads, s-taprop-vxworks.adb, s-taprop-tru64.adb, s-osinte-vxworks.ads, s-osinte-aix.ads, s-osinte-lynxos.ads, s-osinte-solaris-posix.ads, s-taprop-solaris.adb, a-exetim-posix.adb, s-osinte-irix.ads, s-osinte-solaris.ads, s-oscons-tmplt.c, s-taprop-irix.adb, s-osinte-hpux-dce.ads, Makefile.rtl, s-osinte-tru64.ads, s-osinte-darwin.ads, s-taprop.ads, s-osinte-freebsd.ads, s-osinte-lynxos-3.ads, s-taprop-hpux-dce.adb, s-taprop-posix.adb: Remove hard-coded clock ids; instead, generate them in System.OS_Constants. (System.OS_Constants.CLOCK_RT_Ada): New constant denoting the id of the clock providing Ada.Real_Time.Monotonic_Clock. * thread.c: New file. (__gnat_pthread_condattr_setup): New function. For platforms where CLOCK_RT_Ada is not CLOCK_REALTIME, set appropriate condition variable attribute. 2011-11-23 Yannick Moy * sem_ch3.adb: Restore the use of Expander_Active instead of Full_Expander_Active, so that the evaluation is forced in Alfa mode too. Otherwise, we end up with an unexpected insertion in a place where it is not supposed to happen, on default parameters of a call. 2011-11-23 Thomas Quinot * prj-pp.adb, prj-pp.ads: Minor new addition: wrapper procedure "wpr" for Pretty_Print, for use from within gdb. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181660 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_ch9.adb | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'gcc/ada/sem_ch9.adb') diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index 4b284cd9599..057f0b767be 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -905,6 +905,60 @@ package body Sem_Ch9 is Bad_Predicated_Subtype_Use ("subtype& has predicate, not allowed in entry family", D_Sdef, Etype (D_Sdef)); + + -- Check entry family static bounds outside allowed limits + + -- Note: originally this check was not performed here, but in that + -- case the check happens deep in the expander, and the message is + -- posted at the wrong location, and omitted in -gnatc mode. + + declare + PEI : constant Entity_Id := RTE (RE_Protected_Entry_Index); + LB : constant Uint := Expr_Value (Type_Low_Bound (PEI)); + UB : constant Uint := Expr_Value (Type_High_Bound (PEI)); + + LBR : Node_Id; + UBR : Node_Id; + + begin + if Nkind (D_Sdef) = N_Range then + LBR := Low_Bound (D_Sdef); + elsif Is_Entity_Name (D_Sdef) + and then Is_Type (Entity (D_Sdef)) + then + LBR := Type_Low_Bound (Entity (D_Sdef)); + else + goto Skip_LB; + end if; + + if Is_Static_Expression (LBR) + and then Expr_Value (LBR) < LB + then + Error_Msg_Uint_1 := LB; + Error_Msg_N ("entry family low bound must be '>'= ^!", D_Sdef); + end if; + + <> + if Nkind (D_Sdef) = N_Range then + UBR := High_Bound (D_Sdef); + elsif Is_Entity_Name (D_Sdef) + and then Is_Type (Entity (D_Sdef)) + then + UBR := Type_High_Bound (Entity (D_Sdef)); + else + goto Skip_UB; + end if; + + if Is_Static_Expression (UBR) + and then Expr_Value (UBR) > UB + then + Error_Msg_Uint_1 := UB; + Error_Msg_N ("entry family high bound must be '<'= ^!", D_Sdef); + end if; + + <> + null; + end; end if; -- Decorate Def_Id -- cgit v1.2.1 From 212a85cbd8f302065907a06dd61362d14c41aa37 Mon Sep 17 00:00:00 2001 From: charlet Date: Wed, 23 Nov 2011 13:51:23 +0000 Subject: 2011-11-23 Ed Schonberg * freeze.adb (Freeze_All_Ent): An incomplete type is not frozen by a subprogram body that does not come from source. 2011-11-23 Pascal Obry * s-oscons-tmplt.c: Add PTY_Library constant. It contains the library for pseudo terminal support. * g-exptty.ads: Add pseudo-terminal library into a Linker_Options pragma. 2011-11-23 Ed Schonberg * sem_ch9.adb: No check on entry family index if generic. 2011-11-23 Thomas Quinot * sem_ch9.adb, s-taprop.ads, s-taprop-hpux-dce.adb, s-taprop-irix.adb, s-taprop-posix.adb, s-taprop-rtx.adb, s-taprop-solaris.adb, s-taprop-tru64.adb, s-taprop-vxworks.adb: Move dependency on System.OS_Constants from shared spec of System.Tasking.Primitive_Operations to the specific body variants that really require this dependency. 2011-11-23 Ed Schonberg * sem_ch8.adb (Analyze_Subprogram_Renaming_Declaration): If the declaration has aspects, analyze them so they can be properly rejected. 2011-11-23 Hristian Kirtchev * a-comutr.adb, a-coorma.adb, a-coorse.adb, a-convec.adb, a-cihase.adb, a-cimutr.adb, a-coinve.adb, a-ciorma.adb, a-ciorse.adb, a-cobove.adb, a-cohama.adb, a-cihama.adb, a-cidlli.adb, a-cdlili.adb, a-cbhama.adb, a-cbhase.adb, a-cbmutr.adb, a-cborma.adb, a-cborse.adb, a-cbdlli.adb: Add with and use clause for Ada.Finalization. Type Iterator and Child_Iterator are now derived from Limited_Controlled. (Finalize): New routine. (Iterate): Add a renaming of counter Busy and increment it. Update the return aggregate. (Iterate_Children): Add a renaming of counter Busy and increment it. Update the return aggregate. (Iterate_Subtree): Add a renaming of counter Busy and increment it. Update the return aggregate. * a-cdlili.ads, a-cidlli.ads: Type List_Access is now a general access type. * a-cihama.ads: Type Map_Access is now a general access type. * a-comutr.ads, a-cimutr.ads: Use type Natural for the two locks associated with the tree. * a-cohama.ads: Type Map_Access is now a general access type. * a-coinve.ads, a-convec.ads: Type Vector_Access is now a general access type. * exp_ch5.adb (Expand_Iterator_Loop): Do not create a block to wrap the loop as this is done at an earlier step, during analysis. The declarations of the iterator and the cursor use the usual Insert_Action mechanism when added into the tree. * sem_ch5.adb (Analyze_Loop_Statement): Remove local constant Loop_Statement and replace all respective uses by N. Add local constant Loc. Preanalyze the loop iterator to discover whether it is a container iterator and if it is, wrap the loop in a block. This ensures that any controlled temporaries produced by the iteration scheme share the same lifetime of the loop. (Is_Container_Iterator): New routine. (Is_Wrapped_In_Block): New routine. (Pre_Analyze_Range): Move spec and body to the library level. 2011-11-23 Sergey Rybin * gnat_ugn.texi, vms_data.ads: Add documentation for new gnatpp option that controls casing of type and subtype names. 2011-11-23 Yannick Moy * sem_ch3.adb: Minor addition of comments. 2011-11-23 Thomas Quinot * prj-part.adb (Extension_Withs): New global variable, contains the head of the list of WITH clauses from the EXTENDS ALL projects for which virtual packages are being created. (Look_For_Virtual_Projects_For): When recursing through an EXTENDS ALL, add the WITH clauses of the extending project to Extension_Withs. When adding a project to the Virtual_Hash, record the associated Extension_Withs list. (Create_Virtual_Extending_Project): Add a copy of the appropriate Extension_Withs to the virtual project. 2011-11-23 Thomas Quinot * mlib-tgt-specific-vxworks.adb: Minor reformatting. 2011-11-23 Thomas Quinot * Make-generated.in (Sdefault.Target_Name): Set to $(target_noncanonical) instead of $(target) for consistency. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181668 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_ch9.adb | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'gcc/ada/sem_ch9.adb') diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index 057f0b767be..16b8087ad66 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -911,6 +911,9 @@ package body Sem_Ch9 is -- Note: originally this check was not performed here, but in that -- case the check happens deep in the expander, and the message is -- posted at the wrong location, and omitted in -gnatc mode. + -- If the type of the entry index is a generic formal, no check + -- is possible. In an instance, the check is not static and a run- + -- time exception will be raised if the bounds are unreasonable. declare PEI : constant Entity_Id := RTE (RE_Protected_Entry_Index); @@ -921,12 +924,19 @@ package body Sem_Ch9 is UBR : Node_Id; begin - if Nkind (D_Sdef) = N_Range then + if Is_Generic_Type (Etype (D_Sdef)) + or else In_Instance + then + goto Skip_LB; + + elsif Nkind (D_Sdef) = N_Range then LBR := Low_Bound (D_Sdef); + elsif Is_Entity_Name (D_Sdef) and then Is_Type (Entity (D_Sdef)) then LBR := Type_Low_Bound (Entity (D_Sdef)); + else goto Skip_LB; end if; @@ -939,12 +949,19 @@ package body Sem_Ch9 is end if; <> - if Nkind (D_Sdef) = N_Range then + if Is_Generic_Type (Etype (D_Sdef)) + or else In_Instance + then + goto Skip_UB; + + elsif Nkind (D_Sdef) = N_Range then UBR := High_Bound (D_Sdef); + elsif Is_Entity_Name (D_Sdef) and then Is_Type (Entity (D_Sdef)) then UBR := Type_High_Bound (Entity (D_Sdef)); + else goto Skip_UB; end if; -- cgit v1.2.1 From c822fc9b51ce3de2fe06fd2dbe66f166ca0664d5 Mon Sep 17 00:00:00 2001 From: charlet Date: Wed, 23 Nov 2011 14:05:26 +0000 Subject: 2011-11-23 Thomas Quinot * thread.c, s-oscons-tmplt.c: Generate __gnat_pthread_condattr_setup only on platforms where this is required, as determined by s-oscons.h. 2011-11-23 Ed Schonberg * sem_ch9.adb: No check on entry index if error on index. 2011-11-23 Gary Dismukes * sem_ch6.adb (Analyze_Return_Statement): Improve error messages for return statements nested inside an extended_return_statement. * gcc-interface/Make-lang.in: Update dependencies. * gcc-interface/Makefile.in (MISCLIB): Add -lutil for BSD targets. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181670 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_ch9.adb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/ada/sem_ch9.adb') diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index 16b8087ad66..35c4eeebda0 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -924,8 +924,13 @@ package body Sem_Ch9 is UBR : Node_Id; begin + + -- No bounds checking if the type is generic or if previous error. + -- In an instance the check is dynamic. + if Is_Generic_Type (Etype (D_Sdef)) or else In_Instance + or else Error_Posted (D_Sdef) then goto Skip_LB; @@ -951,6 +956,7 @@ package body Sem_Ch9 is <> if Is_Generic_Type (Etype (D_Sdef)) or else In_Instance + or else Error_Posted (D_Sdef) then goto Skip_UB; -- cgit v1.2.1