2016-05-02 Ed Schonberg <schonberg@adacore.com>
[official-gcc.git] / gcc / ada / ChangeLog
blob2722c7dfd66e79d1f0c0d6c6459a9edfc1a88a89
1 2016-05-02  Ed Schonberg  <schonberg@adacore.com>
3         * sem_ch4.adb (Analyze_Allocator): If the expression does not
4         have a subtype indication and the type is an unconstrained tagged
5         type with defaulted discriminants, create an explicit constraint
6         for it during analysis to prevent out-of-order freezing actions
7         on generated classwide types.
9 2016-05-02  Javier Miranda  <miranda@adacore.com>
11         * exp_ch5.adb (Expand_N_Assignment_Statement):
12         In the runtime check that ensures that the tags of source an
13         target match, add missing displacement of the pointer to the
14         objects if they cover interface types.
16 2016-05-02  Ed Schonberg  <schonberg@adacore.com>
18         * sem_attr.adb (Analyze_Attribute, case 'Old): Do not use
19         base type for attribute when type is discrete: transformation
20         is not needed for such types, and leads to spurious errors if
21         the context is a case construct.
23 2016-05-02  Eric Botcazou  <ebotcazou@adacore.com>
25         * gcc-interface/decl.c (elaborate_reference_1): Do not bother about
26         operand #2 for COMPONENT_REF.
27         * gcc-interface/utils2.c (gnat_save_expr): Likewise.
28         (gnat_protect_expr): Likewise.
29         (gnat_stabilize_reference_1): Likewise.
30         (gnat_rewrite_reference): Do not bother about operand #3 for ARRAY_REF.
31         (get_inner_constant_reference): Likewise.
32         (gnat_invariant_expr): Likewise.
33         * gcc-interface/trans.c (fold_constant_decl_in_expr): Likewise.
35 2016-05-02  Eric Botcazou  <ebotcazou@adacore.com>
37         * gcc-interface/trans.c (Range_to_gnu): New static function.
38         (Raise_Error_to_gnu) <N_In>: Call it to translate the range.
39         (gnat_to_gnu) <N_In>: Likewise.
41 2016-04-30  Eric Botcazou  <ebotcazou@adacore.com>
43         * gcc-interface/Make-lang.in (ACATSCMD): New variable.
44         (check-acats): Use it.
45         (check_acats_targets): Likewise.
47 2016-04-28  Eric Botcazou  <ebotcazou@adacore.com>
49         PR ada/70786
50         * a-textio.adb (Get_Immediate): Add missing 'not' in expression.
52 2016-04-27  Eric Botcazou  <ebotcazou@adacore.com>
54         * sem_aux.adb (Is_By_Reference_Type): Also return true for a tagged
55         incomplete type without full view.
56         * sem_ch6.adb (Exchange_Limited_Views): Change into a function and
57         return the list of changes.
58         (Restore_Limited_Views): New procedure to undo the transformation made
59         by Exchange_Limited_Views.
60         (Analyze_Subprogram_Body_Helper): Adjust call to Exchange_Limited_Views
61         and call Restore_Limited_Views at the end, if need be.
62         (Possible_Freeze): Do not delay freezing because of incomplete types.
63         (Process_Formals): Remove kludges for class-wide types.
64         * types.h (By_Copy_Return): Delete.
65         * gcc-interface/ada-tree.h (TYPE_MAX_ALIGN): Move around.
66         (TYPE_DUMMY_IN_PROFILE_P): New macro.
67         * gcc-interface/gigi.h (update_profiles_with): Declare.
68         (finish_subprog_decl): Likewise.
69         (get_minimal_subprog_decl): Delete.
70         (create_subprog_type): Likewise.
71         (create_param_decl): Adjust prototype.
72         (create_subprog_decl): Likewise.
73         * gcc-interface/decl.c (defer_limited_with): Rename into...
74         (defer_limited_with_list): ...this.
75         (gnat_to_gnu_entity): Adjust to above renaming.
76         (finalize_from_limited_with): Likewise.
77         (tree_entity_vec_map): New structure.
78         (gt_pch_nx): New helpers.
79         (dummy_to_subprog_map): New hash table.
80         (gnat_to_gnu_param): Set the SLOC here.  Remove MECH parameter and
81         add FIRST parameter.  Deal with the mechanism here instead of...
82         Do not make read-only variant of types.  Simplify expressions.
83         In the by-ref case, test the mechanism before must_pass_by_ref
84         and also TYPE_IS_BY_REFERENCE_P before building the reference type.
85         (gnat_to_gnu_subprog_type): New static function extracted from...
86         Do not special-case the type_annotate_only mode.  Call
87         gnat_to_gnu_profile_type instead of gnat_to_gnu_type on return type.
88         Deal with dummy return types.  Likewise for parameter types.  Deal
89         with by-reference types explicitly and add a kludge for null procedures
90         with untagged incomplete types.  Remove assertion on the types and be
91         prepared for multiple elaboration of the declarations.  Skip the whole
92         CICO processing if the profile is incomplete.  Handle the completion of
93         a previously incomplete profile.
94         (gnat_to_gnu_entity) <E_Variable>: Rename local variable.
95         Adjust couple of calls to create_param_decl.
96         <E_Access_Subprogram_Type, E_Anonymous_Access_Subprogram_Type>:
97         Remove specific deferring code.
98         <E_Access_Type>: Also deal with E_Subprogram_Type designated type.
99         Simplify handling of dummy types and remove obsolete comment.
100         Constify a couple of variables.  Do not set TYPE_UNIVERSAL_ALIASING_P
101         on dummy types.
102         <E_Access_Subtype>: Tweak comment and simplify condition.
103         <E_Subprogram_Type>: ...here.  Call it and clean up handling.  Remove
104         obsolete comment and adjust call to gnat_to_gnu_param.  Adjust call to
105         create_subprog_decl.
106         <E_Incomplete_Type>: Add a couple of 'const' qualifiers and get rid of
107         inner break statements.  Tidy up condition guarding direct use of the
108         full view.
109         (get_minimal_subprog_decl): Delete.
110         (finalize_from_limited_with): Call update_profiles_with on dummy types
111         with TYPE_DUMMY_IN_PROFILE_P set.
112         (is_from_limited_with_of_main): Delete.
113         (associate_subprog_with_dummy_type): New function.
114         (update_profile): Likewise.
115         (update_profiles_with): Likewise.
116         (gnat_to_gnu_profile_type): Likewise.
117         (init_gnat_decl): Initialize dummy_to_subprog_map.
118         (destroy_gnat_decl): Destroy dummy_to_subprog_map.
119         * gcc-interface/misc.c (gnat_get_alias_set): Add guard for accessing
120         TYPE_UNIVERSAL_ALIASING_P.
121         (gnat_get_array_descr_info): Minor tweak.
122         * gcc-interface/trans.c (gigi): Adjust calls to create_subprog_decl.
123         (build_raise_check): Likewise.
124         (Compilation_Unit_to_gnu): Likewise.
125         (Identifier_to_gnu): Accept mismatches coming from a limited context.
126         (Attribute_to_gnu): Remove kludge for dispatch table entities.
127         (process_freeze_entity): Do not retrieve old definition if there is an
128         address clause on the entity.  Call update_profiles_with on dummy types
129         with TYPE_DUMMY_IN_PROFILE_P set.
130         * gcc-interface/utils.c (build_dummy_unc_pointer_types): Also set
131         TYPE_REFERENCE_TO to the fat pointer type.
132         (create_subprog_type): Delete.
133         (create_param_decl): Remove READONLY parameter.
134         (finish_subprog_decl): New function extracted from...
135         (create_subprog_decl): ...here.  Call it.  Remove CONST_FLAG and
136         VOLATILE_FLAG parameters and adjust.
137         (update_pointer_to): Also clear TYPE_REFERENCE_TO in the unconstrained
138         case.
140 2016-04-27  Arnaud Charlet  <charlet@adacore.com>
142         * aa_util.adb, aa_util.ads: Removed, no longer used.
144 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
146         * sem_prag.adb (Analyze_Pragma): An object
147         renaming declaration resulting from the expansion of an object
148         declaration is a suitable context for pragma Ghost.
150 2016-04-27  Doug Rupp  <rupp@adacore.com>
152         * init.c: Refine last checkin so the only requirement is the
153         signaling compilation unit is compiled with the same mode as
154         the compilation unit containing the initial landing pad.
156 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
158         * sem_ch13.adb (Valid_Default_Iterator): Better filter of illegal
159         specifications for Default_Iterator, including overloaded cases
160         where no interpretations are legal, and return types that are
161         not iterator types.
163 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
165         * exp_ch5.adb (Expand_N_Assignment_Statement): Do not install
166         an accessibility check when the left hand side of the assignment
167         denotes a container cursor.
168         * exp_util.ads, exp_util.adb (Find_Primitive_Operations): Removed.
169         * sem_ch4.adb (Find_Indexing_Operations): New routine.
170         (Try_Container_Indexing): Code cleanup.
172 2016-04-27  Arnaud Charlet  <charlet@adacore.com>
174         * sem_ch10.adb, sem_case.adb: Mark messages udner -gnatwr when needed.
176 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
178         * errout.adb, errutil.adb: Minor reformatting.
180 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
182         * sem_ch13.adb (Analyze_Aspect_Specifications, case Pre/Post):
183         Check that the classwide version is illegal when the prefix is
184         an operation of an untagged synchronized type.
186 2016-04-27  Arnaud Charlet  <charleT@adacore.com>
188         * sinput-l.ads, sem_ch13.adb: Minor editing.
190 2016-04-27  Doug Rupp  <rupp@adacore.com>
192         * init.c (__gnat_adjust_context_for_raise) [arm-linux thumb]:
193         Bump the pc so the lower order bit is set.
195 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
197         * sem_case.adb, sem_case.ads (NO_Op): If appropriate warning is
198         enabled, report an empty range in a case construct.
200 2016-04-27  Arnaud Charlet  <charlet@adacore.com>
202         * sinput.ads, a-cfdlli.adb, a-crbtgo.adb, a-chtgop.adb, a-cbhama.adb,
203         a-rbtgbo.adb, a-crdlli.adb, a-chtgbo.adb: Minor editing.
205 2016-04-27  Bob Duff  <duff@adacore.com>
207         * a-chtgop.adb (Adjust): Zero the tampering counts on assignment,
208         as is done for the other containers.
210 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
212         * ghost.adb (In_Subprogram_Body_Profile): New routine.
213         (Is_OK_Declaration): Treat an unanalyzed expression
214         function as an OK context.  Treat a reference to a Ghost entity
215         as OK when it appears within the profile of a subprogram body.
217 2016-04-27  Bob Duff  <duff@adacore.com>
219         * errout.ads: Document the fact that informational messages
220         don't have to be warnings.
221         * errout.adb (Error_Msg_Internal): In statistics counts, deal
222         correctly with informational messages that are not warnings.
223         (Error_Msg_NEL): Remove useless 'if' aroung Set_Posted, because
224         Set_Posted already checks for errors and ignores others.
225         * erroutc.adb (Prescan_Message): Set Is_Serious_Error to False
226         if Is_Info_Msg; the previous code was assuming that Is_Info_Msg
227         implies Is_Warning_Msg.
228         * errutil.adb (Error_Msg): In statistics counts, deal correctly
229         with informational messages that are not warnings.
231 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
233         * sem_util.ads, sem_util.adb (Is_Null_Record_Type): New predicate
234         to determine whether a record type is a null record.
235         * sem_ch3.adb (Analyze_Object_Declaration): If the type is a
236         null record and there is no expression in the declaration,
237         no predicate check applies to the object.
239 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
241         * sem_ch7.adb (Analyze_Package_Body_Helper): The body of an
242         instantiated package should not cause freezing of previous contracts.
244 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
246         * sem_dim.adb (Analyze_Dimension): Handle subtype declarations
247         that do not come from source.
248         (Analyze_Dimension_Subtype_Declaration): Allow confirming
249         dimensions on subtype entity, either inherited from base type
250         or provided by aspect specification.
252 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
254         * s-gearop.ads (Matrix_Vector_Solution, Matrix_Matrix_Solution):
255         Add scalar formal object Zero, to allow detection and report
256         when the matrix is singular.
257         * s-gearop.adb (Matrix_Vector_Solution, Matrix_Matrix_Solution):
258         Raise Constraint_Error if the Forward_Eliminate pass has
259         determined that determinant is Zero.o
260         * s-ngrear.adb (Solve): Add actual for Zero in corresponding
261         instantiations.
262         * s-ngcoar.adb (Solve): Ditto.
264 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
266         * sem_ch3.adb: Minor reformatting.
268 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
270         * sem_dim.adb (Analyze_Dimension, case N_Identifier): Check
271         that identifier has a usable type before analysis, to handle
272         properly identifiers introduced after some lexical/syntactic
273         recovery that created new identifiers.
275 2016-04-27  Bob Duff  <duff@adacore.com>
277         * a-coinve.adb, a-comutr.adb, a-conhel.adb, a-convec.adb,
278         exp_util.adb: Remove assertions that can fail in obscure cases when
279         assertions are turned on but tampering checks are turned off.
281 2016-04-27  Javier Miranda  <miranda@adacore.com>
283         * exp_ch6.adb (Add_Call_By_Copy_Code,
284         Add_Simple_Call_By_Copy_Code, Expand_Actuals): Handle formals
285         whose type comes from the limited view.
287 2016-04-27  Yannick Moy  <moy@adacore.com>
289         * a-textio.adb: Complete previous patch.
291 2016-04-27  Yannick Moy  <moy@adacore.com>
293         * inline.adb (Expand_Inlined_Call): Use Cannot_Inline instead of
294         Error_Msg_N to issue message about impossibility to inline call,
295         with slight change of message.
297 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
299         * exp_spark.adb (Expand_Potential_Renaming): Removed.
300         (Expand_SPARK): Update the call to expand a potential renaming.
301         (Expand_SPARK_Potential_Renaming): New routine.
302         * exp_spark.ads (Expand_SPARK_Potential_Renaming): New routine.
303         * sem.adb Add with and use clauses for Exp_SPARK.
304         (Analyze): Expand a non-overloaded potential renaming for SPARK.
306 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
308         * sem_ch3.adb (Constrain_Discriminated_Type): In an instance,
309         check full view for the presence of defaulted discriminants,
310         even when the partial view of a private type has no visible and
311         no unknown discriminants.
313 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
315         * lib-xref.adb, exp_ch3.adb: Minor reformatting.
317 2016-04-27  Nicolas Roche  <roche@adacore.com>
319         * rtinit.c: Add weak symbol __gnat_do_argv_expansion.
321 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
323         * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Code
324         cleanup. Check the original node when trying to determine the node kind
325         of pragma Volatile's argument to account for untagged derivations
326         where the type is transformed into a constrained subtype.
328 2016-04-27  Olivier Hainque  <hainque@adacore.com>
330         * mkdir.c (__gnat_mkdir): Rework the vxworks section to use a
331         consistent posix interface on the caller side.
333 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
335         * sem_ch10.adb (Build_Limited_View, Decorate_Type): If this
336         is a limited view of a type, initialize the Limited_Dependents
337         field to catch misuses of the type in a client unit.
339 2016-04-27  Thomas Quinot  <quinot@adacore.com>
341         * a-strunb-shared.adb (Finalize): add missing Reference call.
342         * s-strhas.adb: minor grammar fix and extension of comment
343         * sem_ch8.adb: minor whitespace fixes
345 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
347         * lib-xref.adb (Get_Type_Reference): Handle properly the case
348         of an object declaration whose type definition is a class-wide
349         subtype and whose expression is a function call that returns a
350         classwide type.
352 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
354         * sem_util.ads, sem_util.adb (Output_Entity): New routine.
355         (Output_Name): New routine.
357 2016-04-27  Bob Duff  <duff@adacore.com>
359         * exp_ch3.adb (Rewrite_As_Renaming): Disable previous change for now.
361 2016-04-27  Vincent Celier  <celier@adacore.com>
363         * gnatcmd.adb: For "gnat ls -V -P", recognize switch
364         --unchecked-shared-lib-imports and set the flag
365         Opt.Unchecked_Shared_Lib_Imports accordingly.
367 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
369         * sem_prag.adb (Analyze_Pre_Post_Condition_In_Decl_Part):
370         A generic subprogram is never a primitive operation, and thus
371         a classwide condition for it is not legal.
373 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
375         * sem_aggr.adb, sem_dim.adb, sem_dim.ads, einfo.adb: Minor
376         reformatting.
378 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
380         * sem_res.adb (Flag_Effectively_Volatile_Objects): New routine.
381         (Resolve_Actuals): Flag effectively volatile objects with enabled
382         property Async_Writers or Effective_Reads as illegal.
383         * sem_util.adb (Is_OK_Volatile_Context): Comment reformatting.
385 2016-04-27  Javier Miranda  <miranda@adacore.com>
387         * exp_ch3.adb (Make_Predefined_Primitive_Specs):
388         Do not generate the profile of the equality operator if it has
389         been explicitly defined as abstract in the parent type. Required
390         to avoid reporting an spurious error.
392 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
394         * sem_dim.ads, sem_dim.adb (Check_Expression_Dimensions): New
395         procedure to compute the dimension vector of a scalar expression
396         and compare it with the dimensions if its expected subtype. Used
397         for the ultimate components of a multidimensional aggregate,
398         whose components typically are themselves aggregates that are
399         expanded separately. Previous to this patch, dimensionality
400         checking on such aggregates generated spurious errors.
401         * sem_aggr.adb (Resolve_Array_Aggregate): Use
402         Check_Expression_Dimensions when needed.
404 2016-04-27  Javier Miranda  <miranda@adacore.com>
406         * einfo.ads, einfo.adb (Corresponding_Function): New attribute
407         (applicable to E_Procedure).
408         (Corresponding_Procedure): New attribute (applicable to E_Function).
409         * exp_util.adb (Build_Procedure_Form): Link the function with
410         its internally built proc and viceversa.
411         * sem_ch6.adb (Build_Subprogram_Declaration): Propagate the
412         attribute Rewritten_For_C and Corresponding_Procedure to the body.
413         * exp_ch6.adb (Rewritten_For_C_Func_Id): Removed.
414         (Rewritten_For_C_Proc_Id): Removed.
415         * exp_unst.adb (Note_Uplevel_Ref): Use the new attribute to
416         locate the corresponding procedure.
418 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
420         * sem_ch13.adb (Analyze_Aspect_Export_Import): Signal that there is no
421         corresponding pragma.
423 2016-04-27  Bob Duff  <duff@adacore.com>
425         * exp_ch3.adb: Minor comment improvement.
427 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
429         * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): If the
430         return type is an untagged limited record with only access
431         discriminants and no controlled components, the return value does not
432         need to use the secondary stack.
434 2016-04-27  Javier Miranda  <miranda@adacore.com>
436         * exp_util.adb (Remove_Side_Effects): When
437         generating C code handle object declarations that have
438         discriminants and are initialized by means of a call to a
439         function.
441 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
443         * a-textio.adb (Get_Line function): Handle properly the case of
444         a line that has the same length as the buffer (or a multiple
445         thereof) and there is no line terminator.
446         * a-tigeli.adb (Get_Line procedure): Do not store an end_of_file
447         in the string when there is no previous line terminator and we
448         need at most one additional character.
450 2016-04-27  Arnaud Charlet  <charlet@adacore.com>
452         * s-rident.ads: Make No_Implicit_Loops non partition wide.
454 2016-04-27  Arnaud Charlet  <charlet@adacore.com>
456         * sem_ch11.adb (Analyze_Handled_Statements): check useless
457         assignments also in entries and task bodies, not only in
458         procedures and declaration blocks.
459         * sem_ch5.adb (Analyze_Block_Statement): check useless
460         assignements in declaration blocks as part of processing their
461         handled statement sequence, just like it was done for procedures
462         and now is also done for entries and task bodies.
463         * sem_warn.adb (Warn_On_Useless_Assignment): detect boundries
464         of entries and task bodies just like of procedures.
466 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
468         * sem_util.adb (Is_Volatile_Function): Recognize
469         a function declared within a protected type as well as the
470         protected/unprotected version of a function.
472 2016-04-27  Bob Duff  <duff@adacore.com>
474         * exp_ch3.adb (Expand_N_Object_Declaration): Rewrite an object
475         declaration of the form "X : T := Func (...);", where T is
476         controlled, as a renaming.
477         * a-strunb-shared.adb (Finalize): Set the Unbounded_String Object
478         to be an empty string, instead of null-ing out the Reference.
479         * exp_util.adb (Needs_Finalization): Remove redundant code.
481 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
483         * aspects.ads Aspects Export and Import do not require delay. They
484         were classified as delayed aspects, but treated as non-delayed
485         by the analysis of aspects.
486         * freeze.adb (Copy_Import_Pragma): New routine.
487         (Wrap_Imported_Subprogram): Copy the import pragma by first
488         resetting all semantic fields to avoid an infinite loop when
489         performing the copy.
490         * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Add
491         comment on the processing of aspects Export and Import
492         at the freeze point.
493         (Analyze_Aspect_Convention: New routine.
494         (Analyze_Aspect_Export_Import): New routine.
495         (Analyze_Aspect_External_Link_Name): New routine.
496         (Analyze_Aspect_External_Or_Link_Name): Removed.
497         (Analyze_Aspect_Specifications): Factor out the analysis of
498         aspects Convention, Export, External_Name, Import, and Link_Name
499         in their respective routines.  Aspects Export and Import should
500         not generate a Boolean pragma because their corresponding pragmas
501         have a very different syntax.
502         (Build_Export_Import_Pragma): New routine.
503         (Get_Interfacing_Aspects): New routine.
505 2016-04-27  Eric Botcazou  <ebotcazou@adacore.com>
507         * inline.adb (Add_Inlined_Body): Overhaul implementation,
508         robustify handling of -gnatn1, add special treatment for
509         expression functions.
511 2016-04-27  Doug Rupp  <rupp@adacore.com>
513         * g-traceb.ads: Update comment.
514         * exp_ch2.adb: minor style fix in object declaration
516 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
518         * sem_elab.adb (Check_Internal_Call): Do not
519         consider a call when it appears within pragma Initial_Condition
520         since the pragma is part of the elaboration statements of a
521         package body and may only call external subprograms or subprograms
522         whose body is already available.
523         (Within_Initial_Condition): New routine.
525 2016-04-27  Ed Schonberg  <schonberg@adacore.com>
527         * exp_util.adb (Build_Procedure_Form): Prevent double generation
528         of the procedure form when dealing with an expression function
529         whose return type is an array.
530         * sem_ch3.adb: Fix out-of order Has_Predicates setting.
531         * exp_ch6.adb: Proper conversion for inherited operation in C.
532         * sem_ch6.adb: Code cleanup.
534 2016-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
536         * lib-xref.ads, sem_ch10.adb: minor style fix in comment
537         * g-socket.adb: Minor reformatting.
538         * sinfo.ads: Minor comment correction.
539         * sem_warn.ads: minor grammar fix in comment
541 2016-04-27  Eric Botcazou  <ebotcazou@adacore.com>
543         * gcc-interface/gigi.h (gnat_to_gnu_entity): Adjust prototype.
544         (maybe_pad_type): Adjust comment.
545         (finish_record_type): Likewise.
546         (rest_of_record_type_compilation): Likewise.
547         * gcc-interface/decl.c (gnat_to_gnu_entity): Change DEFINITION type
548         parameter from integer to boolean.  Adjust recursive calls.
549         <E_Subprogram_Type>: Use copy_type and remove redundant assignments.
550         <E_Signed_Integer_Subtype>:  Adjust comment.  Remove call to
551         rest_of_record_type_compilation.  Set TYPE_PADDING_P flag earlier.
552         Pass false to finish_record_type.  Set the debug type later.
553         <E_Record_Subtype>: Remove call to rest_of_record_type_compilation.
554         (gnat_to_gnu_component_type): Fix formatting.
555         (gnat_to_gnu_field_decl): Adjust call to gnat_to_gnu_entity.
556         (gnat_to_gnu_type): Likewise.
557         * gcc-interface/trans.c (Identifier_to_gnu): Likewise.
558         (Loop_Statement_to_gnu): Likewise.
559         (Subprogram_Body_to_gnu): Likewise.
560         (Exception_Handler_to_gnu_fe_sjlj): Likewise.
561         (Exception_Handler_to_gnu_gcc): Likewise.
562         (Compilation_Unit_to_gnu): Likewise.
563         (gnat_to_gnu): Likewise.
564         (push_exception_label_stack): Likewise.
565         (elaborate_all_entities_for_package): Likewise.
566         (process_freeze_entity): Likewise.
567         (process_decls): Likewise.
568         (process_type): Likewise.
569         * gcc-interface/utils.c (struct deferred_decl_context_node): Tweak.
570         (maybe_pad_type): Adjust comments.  Set the debug type later.  Remove
571         call to rest_of_record_type_compilation.
572         (rest_of_record_type_compilation): Use copy_type.
573         (copy_type): Use correctly typed constants.
574         (gnat_signed_or_unsigned_type_for): Use copy_type.
575         * gcc-interface/utils2.c (nonbinary_modular_operation): Likewise.
576         (build_goto_raise): Adjust call tognat_to_gnu_entity.
578 2016-04-27  Eric Botcazou  <ebotcazou@adacore.com>
580         * gcc-interface/misc.c (gnat_init): Do not call
581         internal_reference_types.
583 2016-04-27  Svante Signell  <svante.signell@gmail.com>
585         * gcc-interface/Makefile.in (x86 GNU/Hurd): Use s-osinte-gnu.adb.
586         * s-osinte-gnu.ads: Small tweaks.
587         * s-osinte-gnu.adb: New file.
589 2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>
591         * sem_prag.adb (Match_Constituent): Treat a constant as a legal
592         constituent even if it is not to prevent spurious errors.
594 2016-04-21  Gary Dismukes  <dismukes@adacore.com>
596         * sem_ch4.adb: Minor typo fixes and reformatting.
598 2016-04-21  Dmitriy Anisimkov  <anisimko@adacore.com>
600         * g-calend.ads (No_Time): The same value in any timezone.
601         * g-socket.adb (Raise_Host_Error): Remove ending
602         dot from original error message before append colon delimited
603         host name.
605 2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>
607         * sem_ch3.adb: Code cleanup.
608         * sem_ch6.adb: Code cleanup.
609         (Is_Matching_Limited_View): New routine.
610         (Matches_Limited_With_View): Reimplemented.
611         * sem_ch10.adb (Decorate_Type): Code cleanup.
613 2016-04-21  Doug Rupp  <rupp@adacore.com>
615         * tracebak.c (PPC ELF): Add macro defs for lynxos178e.
617 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
619         * sem_ch4.adb (Try_Container_Indexing): If there are overloaded
620         indexing functions, collect all overloadings of the call firts,
621         and then transfer them to indexing node, to prevent interleaving
622         of the set of interpretations of the nodes involved.
623         * sem_res.adb (Resolve): Suppress cascaded errors that report
624         ambiguities when one of the actuals in an overloaded generatlized
625         indexing operation is illegal and has type Any_Type, as is done
626         for similar cascaded errors in subprogram calls.
627         (Valid_Tagged_Conversion): Cleanup conversion checks when one
628         of the types involved is a class-wide subtype.
630 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
632         * sem_ch12.adb (Load_Parent_Of_Generic): When looking for the
633         subprogram declaration within a wrapper package, skip pragmas
634         that may have been generated by aspect specifications on the
635         generic instance.
637 2016-04-21  Javier Miranda  <miranda@adacore.com>
639         * exp_aggr.adb (Component_Not_OK_For_Backend): Generating C
640         code return True for array identifiers since the backend needs
641         to initialize such component by means of memcpy().
643 2016-04-21  Arnaud Charlet  <charlet@adacore.com>
645         * a-tasatt.adb, a-tasatt.ads (Fast_Path): Rewritten to avoid reading
646         potentially uninitialized memory.
647         * sem_ch3.adb: Minor style fix in comment.
649 2016-04-21  Arnaud Charlet  <charlet@adacore.com>
651         * gnat_rm.texi, gnat_ugn.texi,
652         doc/gnat_ugn/gnat_project_manager.rst,
653         doc/gnat_ugn/building_executable_programs_with_gnat.rst,
654         doc/gnat_ugn/gnat_and_program_execution.rst,
655         doc/gnat_ugn/gnat_utility_programs.rst,
656         doc/gnat_ugn/the_gnat_compilation_model.rst,
657         doc/gnat_rm/implementation_defined_attributes.rst,
658         doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
659         doc/gnat_rm/implementation_defined_pragmas.rst,
660         doc/gnat_rm/the_gnat_library.rst,
661         doc/gnat_rm/implementation_defined_aspects.rst: Update doc.
662         * doc/Makefile: Cleanups.
664 2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>
666         * exp_pakd.adb, sem_ch13.adb: Minor reformatting.
668 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
670         * exp_dbug.adb, exp_dbug.ads (Qualify_Entity_Name): Add suffixes to
671         disambiguate local variables that may be hidden from inner visibility
672         by nested block declarations or loop variables.
674 2016-04-21  Jerome Lambourg  <lambourg@adacore.com>
676         * s-soflin.adb: Initialize the Stack_Limit global variable.
678 2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>
680         * lib-writ.adb: Minor reformatting.
682 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
684         * exp_pakd.adb (Compute_Number_Components): New function to
685         build an expression that computes the number of a components of
686         an array that may be multidimensional.
687         (Expan_Packed_Eq): Use it.
689 2016-04-21  Arnaud Charlet  <charlet@adacore.com>
691         * g-traceb.ads: Update list of supported platforms.
693 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
695         * sem_ch13.adb (Add_Predicates): if the type is declared in
696         an inner package it may be frozen outside of the package, and
697         the generated pragma has not been analyzed yet, the expression
698         for the predicate must be captured and added to the predicate
699         function at this point.
701 2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>
703         * contracts.adb (Analyze_Package_Body_Contract): Do not check
704         for a missing package refinement because 1) packages do not have
705         "refinement" and 2) the check for proper state refinement is
706         performed in a different place.
707         * einfo.adb (Has_Non_Null_Visible_Refinement): Reimplemented.
708         (Has_Null_Visible_Refinement): Reimplemented.
709         * sem_ch3.adb (Analyze_Declarations): Determine whether all
710         abstract states have received a refinement and if not, emit
711         errors.
712         * sem_ch7.adb (Analyze_Package_Declaration): Code
713         cleanup. Determine whether all abstract states of the
714         package and any nested packages have received a refinement
715         and if not, emit errors.
716         (Requires_Completion_In_Body): Add new formal parameter
717         Do_Abstract_States. Update the comment on usage. Propagate the
718         Do_Abstract_States flag to all Unit_Requires_Body calls.
719         (Unit_Requires_Body): Remove formal
720         parameter Ignore_Abstract_States. Add new formal paramter
721         Do_Abstract_States. Propagate the Do_Abstract_States flag to
722         all Requires_Completion_In calls.
723         * sem_ch7.ads (Unit_Requires_Body): Remove formal
724         parameter Ignore_Abstract_States. Add new formal paramter
725         Do_Abstract_States. Update the comment on usage.
726         * sem_ch9.adb (Analyze_Single_Protected_Declaration): Do
727         not initialize the constituent list as this is now done on a
728         need-to-add-element basis.
729         (Analyze_Single_Task_Declaration):
730         Do not initialize the constituent list as this is now done on
731         a need-to-add-element basis.
732         * sem_ch10.adb (Decorate_State): Do not initialize the constituent
733         lists as this is now done on a need-to-add-element basis.
734         * sem_prag.adb (Analyze_Constituent): Set the
735         refinement constituents when adding a new element.
736         (Analyze_Part_Of_In_Decl_Part): Set the Part_Of constituents when
737         adding a new element.
738         (Analyze_Part_Of_Option): Set the Part_Of
739         constituents when adding a new element.
740         (Analyze_Pragma): Set the Part_Of constituents when adding a new
741         element.
742         (Check_Constituent_Usage (all versions)): Reimplemented.
743         (Collect_Constituent): Set the refinement constituents when adding
744         a new element.
745         (Create_Abstract_State): Do not initialize the
746         constituent lists as this is now done on a need-to-add-element basis.
747         (Propagate_Part_Of): Set the Part_Of constituents when
748         adding a new element.
749         * sem_util.adb (Check_State_Refinements): New routine.
750         (Has_Non_Null_Refinement): Reimplemented.
751         (Has_Null_Refinement): Reimplemented.
752         (Requires_State_Refinement): Removed.
753         * sem_util.ads (Check_State_Refinements): New routine.
754         (Requires_State_Refinement): Removed.
756 2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>
758         * lib-writ.adb, sem_ch6.adb: Minor reformatting and code cleanup.
759         * sem.adb: Fix comment.
761 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
763         * sem_ch3.adb (Analyze_Subtype_Declaration): A subtype
764         declaration with no aspects, whose subtype_mark is a subtype
765         with predicates, inherits the list of subprograms for the type.
767 2016-04-21  Arnaud Charlet  <charlet@adacore.com>
769         * exp_aggr.adb (Has_Per_Object_Constraint): Refine previous
770         change.
772 2016-04-21  Thomas Quinot  <quinot@adacore.com>
774         * g-socket.adb (Raise_Host_Error): Include additional Name parameter.
776 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
778         * lib-writ.adb (Write_ALI): Do not record in ali file units
779         that are present in the files table but not analyzed. These
780         units are present because they appear in the context of units
781         named in limited_with clauses, and the unit being compiled does
782         not depend semantically on them.
784 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
786         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Simplify code to
787         create the procedure body for an function returning an array type,
788         when generating C code. Reuse the subprogram body rather than
789         creating a new one, both as an efficiency measure and because
790         in an instance the body may contain global references that must
791         be preserved.
793 2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>
795         * sem_ch3.adb, exp_attr.adb, exp_ch6.adb, exp_aggr.adb: Minor
796         reformatting.
798 2016-04-21  Javier Miranda  <miranda@adacore.com>
800         * exp_aggr.adb (Component_Check): Extend
801         the check that verifies that the aggregate has no function
802         calls to handle transformations performed by the frontend.
803         (Ultimate_Original_Expression): New subprogram.
805 2016-04-21  Philippe Gil  <gil@adacore.com>
807         * krunch.adb (Krunch): Fix krunching of i-java.
809 2016-04-21  Arnaud Charlet  <charlet@adacore.com>
811         * exp_ch8.adb (Evaluation_Required): Always return
812         True when Modify_Tree_For_C.
814 2016-04-21  Eric Botcazou  <ebotcazou@adacore.com>
816         * gnatlink.adb (Gnatlink): Robustify detection of Windows target.
817         * alloc.ads: Minor comment fixes.
818         * einfo.ads: Fix typo.
820 2016-04-21  Arnaud Charlet  <charlet@adacore.com>
822         * exp_aggr.adb (Component_Not_OK_For_Backend): Redo previous
823         changes to handle all cases of components depending on the
824         discriminant, not just string literals.
826 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
828         * sem_ch3.adb (Analyze_Subtype_Declaration): If the subtype
829         declaration is the generated declaration for a generic actual,
830         inherit predicates from the actual if it is a predicated subtype.
832 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
834         * exp_ch6.adb (Rewrite_Function_Call_For_C): If the function is
835         inherited and its result is controlling,  introduce a conversion
836         on the actual for the corresponding procedure call, to avoid
837         spurious type errors.
839 2016-04-21  Jerome Lambourg  <lambourg@adacore.com>
841         * krunch.adb (Krunch): Fix krunching of i-vxworks.
843 2016-04-21  Gary Dismukes  <dismukes@adacore.com>
845         * exp_aggr.adb: Minor reformatting and code cleanup.
847 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
849         * sem_ch13.adb (Resolve_Name): Omit quantified expressions from
850         resolution, because they introduce local names. Full resolution
851         will take place when predicate function is constructed.
853 2016-04-21  Arnaud Charlet  <charlet@adacore.com>
855         * exp_aggr.adb (Component_Not_OK_For_Backend): Refine previous
856         change to take into account Per_Object_Constraint field rather
857         than special casing strings.
858         * exp_ch6.adb: Fix typo in Replace_Returns.
860 2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>
862         * sem_ch5.adb: Minor reformatting.
864 2016-04-21  Arnaud Charlet  <charlet@adacore.com>
866         * exp_aggr.adb (Backend_Processing_Possible): Return False
867         when generating C and aggregate contains function calls.
869 2016-04-21  Tristan Gingold  <gingold@adacore.com>
871         * krunch.adb (Krunch): Only partially krunch children of
872         Interfaces that aren't known.
874 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
876         * sem_prag.adb (Make_Inline): Handle properly the instantiation
877         of a generic subpprogram that carries an Inline aspect. Place
878         inline info on the anonymous subprogram that is constructed in
879         the wrapper package.
880         (Analyze_Pragma, case Pure): Do not check placement if pragma
881         appears within an instantiation, which can be nested at any level.
882         * sem_ch12.adb (Analyze_Instance_And_Renamings): Do not copy Freeze
883         node from anonymous subprogram to its visible renaming. The
884         freeze node will be constructed if the subprogram carries
885         delayed aspects.
886         (Set_Global): Preserve dimension information if present (from
887         code reading).
889 2016-04-21  Vasiliy Fofanov  <fofanov@adacore.com>
891         * gnatlink.adb: Change wording of the warning message on
892         problematic filenames to be more neutral. Add a new substring
893         "patch" introduced on Windows 10.
895 2016-04-21  Philippe Gil  <gil@adacore.com>
897         * tracebak.c (__gnat_backtrace): handle bad RIP values (win64 only)
899 2016-04-21  Javier Miranda  <miranda@adacore.com>
901         * exp_aggr.adb (Component_Not_OK_For_Backend): Return true for string
902         literals.
904 2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>
906         * einfo.adb (Has_Non_Null_Abstract_State): New routine.
907         * einfo.ads New synthesized attribute
908         Has_Non_Null_Abstract_State along with occurrences in entities.
909         (Has_Non_Null_Abstract_State): New routine.
910         * sem_ch7.adb (Unit_Requires_Body): Add local variable
911         Requires_Body. A package declaring an abstract state requires
912         a body only when the state is non-null and the package contains
913         at least one other construct that requires completion in a body.
914         * sem_util.adb (Mode_Is_Off): Removed.
915         (Requires_State_Refinement): Remove an obsolete check. Code
916         cleanup.
918 2016-04-21  Bob Duff  <duff@adacore.com>
920         * sem_attr.adb (Analyze_Attribute): In processing
921         the 'Old attribute, a warning is given for infinite recursion. Fix
922         the code to not crash when the prefix of 'Old denotes a protected
923         function.
924         * sem_ch5.adb (Analyze_Iterator_Specification):
925         Avoid calling Is_Dependent_Component_Of_Mutable_Object in cases
926         where the parameter would not be an object.
928 2016-04-21  Eric Botcazou  <ebotcazou@adacore.com>
930         * sem_eval.adb (Compile_Time_Compare): Be prepared for an empty
931         Etype or Underlying_Type of the operands.
933 2016-04-21  Eric Botcazou  <ebotcazou@adacore.com>
935         * atree.adb (Print_Statistics): Protect against overflows and
936         print the memory consumption in bytes.
937         * table.adb (Reallocate): Do the intermediate calculation of the new
938         size using the Memory.size_t type.
940 2016-04-21  Gary Dismukes  <dismukes@adacore.com>
942         * exp_attr.adb (Is_Inline_Floating_Point_Attribute): Suppress
943         expansion of Attribute_Machine and Attribute_Model for AAMP.
945 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
947         * freeze.adb: Disable previous change for now.
949 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
951         * sem_ch8.adb (Find_Selected_Component): If prefix has an
952         access type and designated type is a limited view, introduce
953         an explicit dereference before continuing the analysis, and
954         set its type to the non-limited view of the designated type,
955         if we are in context where it is available.
957 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
959         * freeze.adb: Freeze profile in ASIS mode.
961 2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>
963         * sem_aux.ads, sem_aux.adb (Has_Rep_Item): New variant.
964         * sem_util.adb (Inherit_Rep_Item_Chain): Reimplemented.
966 2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>
968         * exp_ch6.adb: Minor reformatting.
970 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
972         * sem_ch13.adb: Minor comment update.
974 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
976         * freeze.ads, freeze.adb (Freeze_Entity, Freeze_Before): Add
977         boolean parameter to determine whether freezing an overloadable
978         entity freezes its profile as well. This is required by
979         AI05-019. The call to Freeze_Profile within Freeze_Entity is
980         conditioned by the value of this flag, whose default is True.
981         * sem_attr.adb (Resolve_Attribute, case 'Access): The attribute
982         reference freezes the prefix, but it the prefix is a subprogram
983         it does not freeze its profile.
985 2016-04-21  Javier Miranda  <miranda@adacore.com>
987         * exp_util.adb (Build_Procedure_Form): No action needed for
988         subprogram renamings since the backend can generate the call
989         using the renamed subprogram. This leaves the tree more clean
990         to the backend.
991         * exp_ch6.adb (Expand_Call): Extend previous patch for
992         rewritten-for-c entities to handle subprogram renamings.
993         (Rewrite_Function_Call_For_C): Handle subprogram renamings.
995 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
997         * sem_ch13.adb: Code cleanup.
999 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
1001         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If the body is
1002         created for SPARK_To_C, the entity must remain invisible so it
1003         does not overload subsequent references to the original function.
1004         * exp_ch6.adb (Build_Procedure_Body_Form, Replace_Returns):
1005         Handle Extended_Return_Statements by replacing it with a block
1006         with assignments and a simple return statement.
1007         * exp_util.adb (Build_Procedure_Form): Make procedure entity
1008         invisible after analyzing declaration, to prevent improper
1009         overloading.
1011 2016-04-21  Javier Miranda  <miranda@adacore.com>
1013         * sem_ch6.adb (Build_Subprogram_Declaration): Propagate the
1014         attribute Rewritten_For_C to the body since since the expander
1015         may generate calls using that entity.
1016         * exp_ch6.adb (Expand_Call): For internally generated
1017         calls ensure that they reference the entity of the spec
1018         of the called function.
1019         (Rewritten_For_C_Func_Id): New subprogram.
1020         (Rewritten_For_C_Proc_Id): New subprogram.
1021         (Rewrite_Function_Call_For_C): Invoke the new subprogram to
1022         ensure that we skip freezing entities.
1023         * exp_util.adb (Build_Procedure_Form): No action needed if the
1024         procedure was already built.
1026 2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>
1028         * sem_ch3.adb, exp_util.adb, sem_ch13.adb, exp_unst.adb: Minor
1029         reformatting.
1031 2016-04-21  Ed Schonberg  <schonberg@adacore.com>
1033         * sem_util.adb (Denotes_Iterator): Use root type to determine
1034         whether the ultimate ancestor is the predefined iterator
1035         interface pakage.
1036         * exp_ch5.adb (Expand_Iterator_Over_Container): simplify code
1037         and avoid reuse of Pack local variable.
1039 2016-04-21  Olivier Hainque  <hainque@adacore.com>
1041         * system-vxworks-arm.ads, system-vxworks-sparcv9.ads,
1042         system-vxworks-ppc.ads, system-vxworks-m68k.ads,
1043         system-vxworks-mips.ads, system-vxworks-x86.ads: Define
1044         Executable_Extension to ".out".
1046 2016-04-21  Javier Miranda  <miranda@adacore.com>
1048         * frontend.adb: Update call to Unnest_Subprograms.
1049         * exp_ch6.ads, exp_ch6.adb, exp_unst.ads, exp_unst.adb
1050         (Unnest_Subprograms): Moved to package exp_unst.
1051         * exp_unst.ads (Unnest_Subprogram): Moved to the body of the
1052         package.
1053         * exp_dbug.adb (Qualify_Entity_Name): Enable qualification of
1054         enumeration literals when generating C code.
1056 2016-04-21  Javier Miranda  <miranda@adacore.com>
1058         * frontend.adb: Remove call to initialize Exp_Ch6.
1059         * exp_ch6.ads, exp_ch6.adb (Initialize): removed.
1060         (Unest_Entry/Unest_Bodies): Removed.
1061         (Unnest_Subprograms): Code cleanup.
1063 2016-04-21  Arnaud Charlet  <charlet@adacore.com>
1065         * set_targ.adb (Read_Target_Dependent_Values):
1066         close target description file once its contents is read.
1067         * s-os_lib.adb (Non_Blocking_Spawn, version with Stdout_File
1068         and Stderr_File): Close local file descriptors before spawning
1069         child process.
1070         * exp_util.adb (Containing_Package_With_Ext_Axioms): Limit scope of
1071         local variables to make the code easier to understand and avoid
1072         duplicated calls to Parent and Generic_Parent.
1074 2016-04-20  Bob Duff  <duff@adacore.com>
1076         * s-os_lib.ads: Minor comment fix.
1078 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1080         * exp_ch5.adb (Expand_N_Assignment_Statement): Do no generate
1081         a discriminant check for a type whose partial view has unknown
1082         discriminants when the full view has discriminants with defaults.
1084 2016-04-20  Javier Miranda  <miranda@adacore.com>
1086         * exp_util.adb (Remove_Side_Effects): When generating C code
1087         remove side effect of type conversion of access to unconstrained
1088         array type.
1089         (Side_Effect_Free): Return false for the type
1090         conversion of access to unconstrained array type when generating
1091         C code.
1092         * sem_res.adb (Resolved_Type_Conversion): Remove side effects
1093         of access to unconstrained array type conversion when generating
1094         C code.
1096 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1098         * sem_ch13.adb (Build_Predicate_Function_Declaration): New
1099         function, to construct the declaration of a predicate function
1100         at the end of the current declarative part rather than at the
1101         (possibly later) freeze point of the type. This also allows uses
1102         of a type with predicates in instantiations elsewhere.
1103         (Resolve_Aspect_Expression): New procedure to detect visiblity
1104         errors in aspect expressions, at the end of the declarative part
1105         that includes the type declaration.
1106         * sem_ch3.adb (Complete_Private_Subtype): Propagate properly the
1107         predicate function from private to full view.
1108         * einfo.adb (Predicate_Function): Refine search for predicate
1109         function when type has a full view and predicate function may
1110         be defined on either view.
1112 2016-04-20  Javier Miranda  <miranda@adacore.com>
1114         * frontend.adb: Passing the root of the tree to
1115         Unnest_Subprograms().
1116         * exp_ch6.adb (Expand_N_Subprogram_Body): Remove code that
1117         took care of adding subprograms to the Unest_Bodies table since
1118         performing such action too early disables the ability to process
1119         generic instantiations.
1120         (Unnest_Subprograms): Adding parameter.
1121         (Search_Unnesting_Subprograms): New subprogram.
1122         * exp_ch6.ads (Unnest_Subrograms): Update documentation.
1124 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
1126         * exp_util.adb, freeze.adb, sem_util.adb: Minor reformatting.
1128 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1130         * exp_unst.adb (Check_Static_Type): For a private type, check
1131         full view.
1133 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1135         * sem_attr.adb (Check_Type): Reject an attribute reference in
1136         an aspect expression, when the prefix of the reference is the
1137         current instance of the type to which the aspect applies.
1139 2016-04-20  Bob Duff  <duff@adacore.com>
1141         * sem_ch6.adb (Enter_Overloaded_Entity): Do not warn about
1142         hiding unless we're actually hiding something. The previous
1143         code would (for example) warn about a "<" on a record type
1144         because it incorrectly thought it was hiding the "<" on Boolean
1145         in Standard. We need to check that the homonym S is in fact a
1146         homograph of a predefined operator.
1148 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1150         * exp_util.ads, exp_util.adb (Build_Procedure_Form): Moved here
1151         from exp_ch6.adb, for use in SPARK_To_C mode when creating the
1152         procedure equivalent to a function returning an array, when this
1153         construction is deferred to the freeze point of the function.
1154         * sem_util.adb (Is_Unchecked_Conversion_Instance): Include a
1155         function that renames an instance of Unchecked_Conversion.
1156         * freeze.adb (Freeze_Subprogram): Generate the proper procedure
1157         declaration for a function returning an array.
1158         * exp_ch6.adb (Build_Procedure_Form): Moved to exp_util.
1160 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1162         * sem_util.ads, sem_util.adb (Is_Expanded_Priority_Attribute):
1163         New predicate to determine that in a context with full run-time,
1164         a function call is an expansion of a reference to attribute
1165         Priority.
1166         * sem_ch5.adb (Analyze_Function_Call): use it.
1167         * exp_ch5.adb (Expand_N_Subprogram_Call): use it.
1169 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
1171         * einfo.adb Flag286 is now used as Is_Exception_Handler.
1172         (Is_Exception_Handler): New routine.
1173         (Set_Is_Exception_Handler): New routine.
1174         (Write_Entity_Flags): Output the status of Is_Exception_Handler.
1175         * einfo.ads New attribute Is_Exception_Handler along with
1176         occurrences in entities.
1177         (Is_Exception_Handler): New routine along with pragma Inline.
1178         (Set_Is_Exception_Handler): New routine along with pragma Inline.
1179         * exp_ch7.adb (Make_Transient_Block): Ignore blocks generated
1180         for exception handlers with a choice parameter.
1181         * sem_ch11.adb (Analyze_Exception_Handlers): Mark the scope
1182         generated for a choice parameter as an exception handler.
1184 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1186         * sem_ch3.adb (Build_Derived_Access_Type): Remove dead code.
1187         (Constrain_Discriminated_Type): In an instance, if the type has
1188         unknown discriminants, use its full view.
1189         (Process_Subtype): Check that the base type is private before
1190         adding subtype to Private_Dependents list.
1192 2016-04-20  Bob Duff  <duff@adacore.com>
1194         * sem_ch13.adb: Minor comment fix.
1196 2016-04-20  Yannick Moy  <moy@adacore.com>
1198         * sem_ch4.adb: Fix typos in comments.
1199         * sem_res.adb (Resolve_Case_Expression): Fix type of case alternatives.
1201 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1203         * sem_ch4.adb (Analyze_Selected_Component): A reference to the
1204         current instance of a task type is legal if the prefix is an
1205         expression of that task type and the selector is an entry or
1206         entry family.
1208 2016-04-20  Arnaud Charlet  <charlet@adacore.com>
1210         * a-cfdlli.ads (List): Type is no longer tagged, not needed. Move
1211         varsize field at the end for efficiency.
1213 2016-04-20  Vincent Celier  <celier@adacore.com>
1215         * gnatcmd.adb: Do not invoke gprls when the invocation of "gnat
1216         ls" includes the switch -V.
1217         * clean.adb: "<target>-gnatclean -P" now calls "gprclean
1218         --target=<target>"
1219         * make.adb: "<target>-gnatmake -P" now calls "gprbuild
1220         --target=<target>"
1222 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
1224         * sem_ch12.adb (Qualify_Type): Do not perform
1225         partial qualification when the immediate scope is a generic unit.
1227 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
1229         * exp_unst.adb: Minor reformatting.
1231 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
1233         * exp_ch4.adb (Expand_Allocator_Expression): Ensure that the
1234         tag assignment and adjustment preceed the accessibility check.
1235         * exp_ch7.adb (Is_Subprogram_Call): Reimplemented.
1237 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
1239         * exp_prag.adb (Expand_Attributes): Ensure that
1240         the temporary used to capture the value of attribute 'Old's
1241         prefix is properly initialized.
1243 2016-04-20  Javier Miranda  <miranda@adacore.com>
1245         * exp_unst.ads, exp_unst.adb (Get_Level, Subp_Index): Moved to library
1246         level.
1248 2016-04-20  Arnaud Charlet  <charlet@adacore.com>
1250         * sem_ch9.adb (Analyze_Task_Type_Declaration): Shut down warning
1251         in codepeer mode.
1253 2016-04-20  Vincent Celier  <celier@adacore.com>
1255         * make.adb: Code cleanup.
1257 2016-04-20  Arnaud Charlet  <charlet@adacore.com>
1259         * exp_ch4.adb (Expand_Allocator_Expression): Help C code
1260         generation.
1262 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
1264         * sem_ch12.adb (Copy_Generic_Node): Handle the special
1265         qualification installed for universal literals that act as
1266         operands in binary or unary operators.  (Qualify_Operand): Mark
1267         the qualification to signal the instantiation mechanism how to
1268         handle global reference propagation.
1269         * sinfo.adb (Is_Qualified_Universal_Literal): New routine.
1270         (Set_Is_Qualified_Universal_Literal): New routine.
1271         * sinfo.ads New attribute Is_Qualified_Universal_Literal along
1272         with occurrences in nodes.
1273         (Is_Qualified_Universal_Literal):
1274         New routine along with pragma Inline.
1275         (Set_Is_Qualified_Universal_Literal): New routine along with
1276         pragma Inline.
1278 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1280         * sem.adb (Do_Analyze): Save and restore Style_Max_Line_Length
1281         so that the corresponding checks are preserved across compilations
1282         that include System.Constants in their context.
1284 2016-04-20  Gary Dismukes  <dismukes@adacore.com>
1286         * sem_type.adb: Minor typo fix and reformatting.
1287         * a-conhel.ads: Update comment.
1289 2016-04-20  Bob Duff  <duff@adacore.com>
1291         * a-cihama.adb, a-cihase.adb, a-coinve.adb (Copy): Rewrite the
1292         code so it doesn't trigger an "uninit var" warning.
1294 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
1296         * sem_attr.ads Add new table Universal_Type_Attribute.
1297         * sem_util.adb (Yields_Universal_Type): Use a table lookup when
1298         checking attributes.
1300 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1302         * exp_aggr.adb (Init_Stored_Discriminants,
1303         Init_Visible_Discriminants): New procedures, subsidiary of
1304         Build_Record_Aggr_Code, to handle properly the construction
1305         of aggregates for a derived type that constrains some parent
1306         discriminants and renames others.
1308 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
1310         * sem_ch12.adb (Qualify_Universal_Operands): New routine.
1311         (Save_References_In_Operator): Add explicit qualifications in
1312         the generic template for all operands of universal type.
1313         * sem_type.adb (Disambiguate): Update the call to Matches.
1314         (Matches): Reimplemented.
1315         * sem_util.ads, sem_util.adb (Yields_Universal_Type): New routine.
1317 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1319         * sem_ch13.adb (Rep_Item_Too_Late): Better error message for
1320         an illegal aspect that freezes the entity to which it applies.
1322 2016-04-20  Bob Duff  <duff@adacore.com>
1324         * a-stwibo.ads, a-stzbou.ads
1325         ("="): Add overriding keyword before function to avoid crash when
1326         compiler is called with -gnatyO (check overriding indicators).
1328 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1330         * sem_prag.adb (Analyze_Pragma, case Check_Policy):  If this
1331         is a configuration pragma and it uses the ARG syntax, insert
1332         the rewritten pragma after the current one rather than using
1333         Insert_Actions.
1335 2016-04-20  Arnaud Charlet  <charlet@adacore.com>
1337         * exp_aggr.adb (Backend_Processing_Possible): Add handling of
1338         C back-end.
1340 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
1342         * s-imgllu.adb, sem_util.adb, s-imgint.adb, s-imguns.adb,
1343         s-imglli.adb: Minor reformatting.
1345 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
1347         * sem_res.adb (Rewrite_Renamed_Operator): Do not rewrite the
1348         renamed operator when the associated node appears within a
1349         pre/postcondition.
1350         * sem_util.ads, sem_util.adb (In_Pre_Post_Condition): New routine.
1352 2016-04-20  Yannick Moy  <moy@adacore.com>
1354         * osint.adb (Relocate_Path): Fix test when Path is shorter than Prefix.
1355         * einfo.adb (Set_Overridden_Operation): Add assertion.
1356         * sem_util.adb (Unique_Entity): for renaming-as-body return the spec
1357         entity.
1359 2016-04-20  Javier Miranda  <miranda@adacore.com>
1361         * exp_unst.adb (Append_Unique_Call): New subprogram.
1362         (Unnest_Subprogram): Replace the unique occurrence
1363         of Call.Append() by Append_Unique_Call() which protects us from
1364         adding to the Calls table duplicated entries.
1366 2016-04-20  Arnaud Charlet  <charlet@adacore.com>
1368         * exp_attr.adb (Is_GCC_Target): Fix for C backend.
1369         * xref_lib.ads (Dependencies_Tables): instantiate
1370         Table package with types that guarantee its safe use.
1371         * s-imgllu.adb, s-imgint.adb, s-imguns.adb, s-imglli.adb: Avoid nested
1372         procedures.
1374 2016-04-20  Arnaud Charlet  <charlet@adacore.com>
1376         * exp_attr.adb (Expand_N_Attribute_Reference [Attribute_Valid]):
1377         Disable expansion when generating C code.
1378         * sinfo.ads, inline.ads: Minor editing.
1380 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
1382         * sem_util.adb, contracts.adb, ghost.adb, exp_ch6.adb: Minor
1383         reformatting.
1385 2016-04-20  Javier Miranda  <miranda@adacore.com>
1387         * contracts.adb (Build_Postconditions_Procedure): Code cleanup.
1388         * ghost.adb (Os_OK_Ghost_Context.Is_OK_Declaration): Handle the
1389         declaration of the internally built _postcondition procedure.
1391 2016-04-20  Arnaud Charlet  <charlet@adacore.com>
1393         * snames.ads-tmpl (Internal_Attribute_Id, Attribute_Class_Array): Fix
1394         indentation.
1395         * sem_util.adb (Is_Unchecked_Conversion_Instance):
1396         defense against library-level renamings of other functions,
1397         which are never instances of Unchecked_Conversion.
1398         * einfo.ads: minor fix of casing in comment
1400 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1402         * exp_ch6.adb (Expand_N_Subprogram_Stub): Do not expand a body
1403         that has been analyzed and expanded already. Qualify the names
1404         in the proper body for use in the generation of C code.
1406 2016-04-20  Javier Miranda  <miranda@adacore.com>
1408         * contracts.adb (Build_Postconditions_Procedure): Force its
1409         inlining when generating C code.
1410         * sem_attr.adb (Analyze_Attribute_Old_Result): Handle inlined
1411         _postconditions when generating C code.
1412         * exp_ch6.adb (Inlined_Subprogram): Inline calls to
1413         _postconditions when generating C code.
1414         * sinfo.ads, sinfo.adb (Corresponding_Spec, Set_Corresponding_Spec):
1415         types of return value and argument changed from Node_Id to
1416         Entity_Id.
1418 2016-04-20  Vincent Celier  <celier@adacore.com>
1420         * make.adb, clean.adb, gnatname.adb: Revert previous change for now.
1422 2016-04-20  Eric Botcazou  <ebotcazou@adacore.com>
1424         * sem_ch12.adb (Analyze_Instance_And_Renamings): Do not reset
1425         the Has_Delayed_Freeze flag on the anonymous instance node.
1427 2016-04-20  Javier Miranda  <miranda@adacore.com>
1429         * sem_ch5.adb (Analyze_Iterator_Specification): Remove transient
1430         scope associated with the renaming object declaration.
1431         * exp_util.adb (Insert_Actions): Remove handling of iterator
1432         loop marked as requiring the secondary stack.
1434 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1436         * sem_attr.adb (Analyze_Attribute, case 'Image): Implement
1437         AI12-0124, which extends the functionality of the attribute so it
1438         reflects the semantics of GNAT 'Img when applied to scalar types.
1439         * lib-xref.adb: minor whitespace layout fix.
1441 2016-04-20  Vincent Celier  <celier@adacore.com>
1443         * clean.adb (Gnatclean): Fail if project file specified and
1444         gprclean is not available.
1445         * gnatname.adb: Fail is -P is used and gprname is not available.
1446         * make.adb (Initialize): Fail if project file specified and
1447         gprbuild is not available.
1449 2016-04-20  Bob Duff  <duff@adacore.com>
1451         * sem_ch5.adb (Analyze_Iterator_Specification): Do not use secondary
1452         stack when possible.
1454 2016-04-20  Gary Dismukes  <dismukes@adacore.com>
1456         * par_sco.adb, sem_util.adb, sem_ch13.adb: Minor typo corrections and
1457         reformatting.
1459 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1461         * sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
1462         If the pragma comes from an aspect specification, verify that
1463         the aspect applies to an entity with a declarative part.
1464         * exp_ch5.adb: Code cleanup.
1466 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1468         * sem_res.adb (Resolve_If_Expression): If first expression is
1469         universal, resolve subsequent ones with the corresponding class
1470         type (Any_Integer or Any_Real).
1472 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1474         * sem_ch5.adb (Analyze_Iterator_Specification): If expansion is
1475         disabled, complete the analysis of the iterator name to ensure
1476         that reference for entities within are properly generated.
1478 2016-04-20  Arnaud Charlet  <charlet@adacore.com>
1480         * a-dispat.ads (Yield): add Global contract.
1481         * a-calend.ads, a-reatim.ads: Added Initializes => Clock_Time.
1482         * a-taside.adb: Added Initializes => Tasking_State.
1484 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
1486         * sem_ch13.adb (Build_Invariant_Procedure):
1487         Reimplement the invariant procedure spec and body insertion.
1489 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
1491         * sem_ch13.adb (Add_Invariant): Do not replace
1492         the saved expression of an invariatn aspect when inheriting
1493         a class-wide type invariant as this clobbers the existing
1494         expression. Do not use New_Copy_List as it is unnecessary
1495         and leaves the parent pointers referencing the wrong part of
1496         the tree. Do not replace the type references for ASIS when
1497         inheriting a class-wide type invariant as this clobbers the
1498         existing replacement.
1500 2016-04-20  Ed Schonberg  <schonberg@adacore.com>
1502         * sem_util.adb (Build_Explicit_Dereference): If the designated
1503         expression is an entity name, generate reference to the entity
1504         because it will not be resolved again.
1506 2016-04-19  Arnaud Charlet  <charlet@adacore.com>
1508         * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
1509         gnat_rm.texi: Update documentation.
1511 2016-04-19  Olivier Hainque  <hainque@adacore.com>
1513         * par_sco.adb (Traverse_One, case N_Case_Statement):
1514         Skip pragmas before the first alternative.
1515         (Traverse_Handled_Statement_Sequence, Exception_Handlers): Likewise.
1517 2016-04-19  Tristan Gingold  <gingold@adacore.com>
1519         * adaint.c (__gnat_lwp_self): New function (for darwin).
1520         * s-osinte-darwin.ads, s-osinte-darwin.adb (lwp_self): Import
1521         of __gnat_lwp_self.
1523 2016-04-19  Olivier Hainque  <hainque@adacore.com>
1525         * sem_util.adb (Build_Elaboration_Entity): Always request an
1526         elab counter when preserving control-flow.
1528 2016-04-19  Olivier Hainque  <hainque@adacore.com>
1530         * sem_ch13.adb (Build_Invariant_Procedure_Declaration): Set
1531         Needs_Debug_Info when producing SCOs.
1532         * par_sco.adb (Traverse_Aspects): Fix categorization of
1533         Type_Invariant to match actual processing as activated depending
1534         on pragma Assertion_Policy.
1535         * sem_prag.adb (Analyze_Pragma): Remove special case for
1536         Name_Invariant regarding SCO generation, which completely disabled
1537         the production of SCOs for Invariant pragmas and aspects.
1539 2016-04-19  Hristian Kirtchev  <kirtchev@adacore.com>
1541         * checks.adb, sem_util.adb, sem_res.adb, sem_attr.adb: Minor
1542         reformatting.
1544 2016-04-19  Ed Schonberg  <schonberg@adacore.com>
1546         * freeze.adb (Freeze_Profile): Refine predicate that checks
1547         whether a function that returns a limited view is declared in
1548         another unit and cannot be frozen at this point.
1550 2016-04-19  Ed Schonberg  <schonberg@adacore.com>
1552         * exp_aggr.adb (Component_Count): Handle properly superflat
1553         arrays, i.e. empty arrays where Hi < Lo - 1, to ensure that the
1554         return value of the function is Natural, rather than leaving
1555         the handling of such arrays to the caller of this function.
1557 2016-04-19  Arnaud Charlet  <charlet@adacore.com>
1559         * sem_prag.adb, sem_attr.adb, par-prag.adb, exp_aggr.adb, sem_type.adb
1560         sem_ch12.adb, sem_ch3.adb, exp_ch7.adb, exp_ch9.adb: Code cleanup.
1561         * sem_res.adb, sem_util.ads, sem_util.adb (Is_OK_Volatile_Context):
1562         Promoted from being a nested subprogram in Sem_Res.Resolve_Entity_Name
1563         to publicly visible routine in Sem_Util.
1565 2016-04-19  Ed Schonberg  <schonberg@adacore.com>
1567         * checks.adb (Apply_Parameter_Aliasing_Checks): Do not apply
1568         the check if the type of the actual is By_Reference.
1570 2016-04-19  Arnaud Charlet  <charlet@adacore.com>
1572         * sem_res.adb (Within_Subprogram_Call): Detect
1573         also nodes that appear in entry calls.
1574         (Resolve_Actuals, Insert_Default): Propagate
1575         dimension information if any, from default expression to the
1576         copy that appears in the list of actuals.
1577         * uintp.ads: minor whitespace fix in comment.
1578         * sem_prag.adb, stringt.adb, inline.adb, lib-xref-spark_specific.adb:
1579         Minor code cleanup.
1580         * set_targ.adb (Set_Targ): convert directly from
1581         Natural to Pos, without intermediate conversion to Int.
1583 2016-04-19  Arnaud Charlet  <charlet@adacore.com>
1585         * sem_ch6.adb (Process_Formals): Mark suspicious reference to
1586         SPARK RM in comment.
1587         * sem_prag.adb (Analyze_Global_Item): Fix reference to SPARK RM
1588         in comment.
1589         * sem_res.adb (Property_Error, Resolve_Actuals): Fix reference
1590         to SPARK RM in both comment and error message.
1592 2016-04-19  Eric Botcazou  <ebotcazou@adacore.com>
1594         * sem_ch6.adb (Possible_Freeze): If the type is an incomplete
1595         CW type, then the subprogram must have a delayed freeze. This
1596         ensures that the backend can properly recover the full view when
1597         elaborating the access subprogram declaration.
1599 2016-04-19  Ed Schonberg  <schonberg@adacore.com>
1601         * sem_attr.adb (Resolve_Attribute, case 'Access): Freeze
1602         overloadable entity if originally overloaded.
1604 2016-04-19  Arnaud Charlet  <charlet@adacore.com>
1606         * exp_aggr.adb, exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_code.adb,
1607         exp_fixd.adb, namet.adb, osint.adb, osint.ads, par-ch2.adb,
1608         sem_ch10.adb, sem_ch12.adb, sem_disp.adb, sem_elab.adb, sem_elim.adb
1609         sem_util.adb, styleg.adb, styleg.ads, stylesw.ads: Minor code
1610         clean up.
1612 2016-04-19  Arnaud Charlet  <charlet@adacore.com>
1614         * sem_util.adb (Copy_Node_With_Replacement):
1615         use Set_Comes_From_Source instead of directly manipulating
1616         internals of the node table.
1617         * sem_util.adb (Within_Scope): refactored to remove duplicated code.
1618         * sem_aux.adb (Get_Rep_Pragma,
1619         Subprogram_Body_Entity, Subprogram_Spec): declare variables that
1620         do not change as constants and initialize them in the declaration.
1621         (Get_Rep_Pragma, Subprogram_Body_Entity, Subprogram_Spec): declare
1622         variables that do not change as constants and initialize them
1623         in the declaration.
1625 2016-04-19  Ed Schonberg  <schonberg@adacore.com>
1627         * sem_res.adb (Resolve_Entry_Call): If the entry has
1628         preconditions it is rewritten by means of a wrapper that
1629         incorporates the original call. Before rewriting generate a
1630         reference to the entry being called to prevent spurious warnings
1631         and provide correct cross-reference information.
1633 2016-04-19  Hristian Kirtchev  <kirtchev@adacore.com>
1635         * sem_disp.adb (Check_Dispatching_Context): Code cleanup. Add
1636         local constant Scop. Ignore any internally generated loops when
1637         performing the check concerning an abstract subprogram call
1638         without a controlling argument.
1639         * sem_util.ads, sem_util.adb (Current_Scope_No_Loops): New routine.
1641 2016-04-19  Bob Duff  <duff@adacore.com>
1643         * sem_elab.adb (Check_A_Call): There are cases where we have No
1644         (Ent) after the Alias loop, even when there was no previous error,
1645         so we can't assert that there was an error.
1647 2016-04-19  Ed Schonberg  <schonberg@adacore.com>
1649         * sem_attr.adb (Analyze_Access_Attribute, OK_Self_Reference):
1650         Reject use of type name as a prefix to 'access within an aggregate
1651         in a context that is not the declarative region of a type.
1653 2016-04-19  Vincent Celier  <celier@adacore.com>
1655         * gnatcmd.adb: Make "gnat ls -P" invoke gprls Make "gnat bind
1656         -P" invoke "gprbuild -b" Make "gnat link -P" invoke "gprbuild
1657         -l" Fail if the invocation is "gnat find -P" or "gnat xref -P"
1658         Remove anything related to project files
1659         * g-mbdira.adb: minor whitespace cleanup
1660         * g-spipat.adb: minor removal of extra spaces after closing paren
1662 2016-04-19  Ed Schonberg  <schonberg@adacore.com>
1664         * exp_ch6.adb (Expand_Actuals):  If post-statements are present
1665         and the enclosing context is a function call or indexing, build
1666         an Expression_With_Actions for the call.
1668 2016-04-19  Hristian Kirtchev  <kirtchev@adacore.com>
1670         * lib-writ.adb (Write_With_Lines): Code cleanup. Do not generate
1671         a with line for an ignored Ghost unit.
1672         * sem_ch7.adb (Analyze_Package_Declaration): Add local constant
1673         Par. A child package is Ghost when its parent is Ghost.
1674         * sem_prag.adb (Analyze_Pragma): Pragma Ghost can now apply to
1675         a subprogram declaration that acts as a compilation unit.
1677 2016-04-18  Michael Matz  <matz@suse.de>
1679         * gcc-interface/decl.c (gnat_to_gnu_entity): Use SET_TYPE_ALIGN.
1680         (gnat_to_gnu_field): Ditto.
1681         (components_to_record): Ditto.
1682         (create_variant_part_from): Ditto.
1683         (copy_and_substitute_in_size): Ditto.
1684         (substitute_in_type): Ditto.
1685         * gcc-interface/utils.c (make_aligning_type): Use SET_TYPE_ALIGN.
1686         (make_packable_type): Ditto.
1687         (maybe_pad_type): Ditto.
1688         (finish_fat_pointer_type): Ditto.
1689         (finish_record_type): Ditto and use SET_DECL_ALIGN.
1690         (rest_of_record_type_compilation): Use SET_TYPE_ALIGN.
1691         (create_field_decl): Use SET_DECL_ALIGN.
1693 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
1695         * einfo.adb (Overridden_Operation): assert that
1696         function is called for valid arguments.
1697         * sem_aggr.adb, sem_ch3.adb, sem_ch5.adb, sem_type.adb,
1698         s-osinte-vxworks.ads, a-ngcefu.adb, sem_ch10.adb, einfo.ads,
1699         sem_prag.adb, sem_ch12.adb, sem.adb, i-cobol.ads, freeze.adb,
1700         sem_util.adb, a-chtgop.ads, s-rannum.adb, exp_ch6.adb, s-bignum.adb,
1701         s-osinte-freebsd.ads, par-ch5.adb, a-chtgbo.ads, a-cofove.adb:
1702         No space after closing parenthesis except where required for
1703         layout.
1704         * sem_res.adb: Minor reformatting.
1706 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
1708         * exp_ch4.adb (Expand_N_Case_Expression): Convert into a case
1709         statement when relevant.
1711 2016-04-18  Bob Duff  <duff@adacore.com>
1713         * a-cuprqu.adb (Enqueue): Properly handle the
1714         case where the new element has a unique priority.
1716 2016-04-18  Tristan Gingold  <gingold@adacore.com>
1718         * adaint.h: Define stat structures and functions for iOS
1719         simulator.
1721 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
1723         * sem_res.adb (Resolve_Entry_Call): reset
1724         Is_Overloaded flag after resolving calls to overloaded protected
1725         operations.
1726         * exp_spark.adb (Expand_SPARK): call
1727         Qualify_Entity_Names for tasking nodes, i.e. protected types,
1728         task types and entries.
1729         * exp_ch4.adb (Expand_N_If_Expression): Refine previous change
1730         in case of an unconstrained type.
1732 2016-04-18  Yannick Moy  <moy@adacore.com>
1734         * sem_eval.adb, sem_eval.ads (Check_Non_Static_Context): Add
1735         comment to document usage of subprogram in GNATprove.
1737 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
1739         * sem_prag.adb (Analyze_Pragma, case Test_Case): Improve error
1740         message for wrong placement of aspect Test_Case.
1742 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
1744         * einfo.ads: Update the documentation of attribute Renamed_Object.
1745         * exp_spark.adb (Expand_Potential_Renaming): Reimplemented.
1747 2016-04-18  Gary Dismukes  <dismukes@adacore.com>
1749         * exp_ch4.adb (Optimize_Length_Comparison): Return immediately
1750         in the case of AAMP (same as for use of the -gnatd.P switch) to
1751         suppress this optimization, which avoids creating a dependence
1752         on the 64-bit arithmetic package.
1754 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
1756         * exp_ch4.adb: Update comment.
1758 2016-04-18  Eric Botcazou  <ebotcazou@adacore.com>
1760         * exp_ch6.adb (Expand_Call): Make sure instantiations are
1761         registered only once as pending here.
1763 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
1765         * exp_ch4.adb, gnat1drv.adb, opt.ads, sem_res.adb
1766         (Minimize_Expression_With_Actions): New flag.
1767         (Adjust_Global_Switches): Set Minimize_Expression_With_Actions
1768         when generating C.
1769         (Resolve_Short_Circuit): Redo previous change
1770         using Minimize_Expression_With_Actions.
1771         (Expand_N_If_Expression,
1772         Expand_Short_Circuit_Operator): Restore old code to avoid
1773         Expression_With_Actions when Minimize_Expression_With_Actions
1774         is set.
1776 2016-04-18  Vincent Celier  <celier@adacore.com>
1778         * s-os_lib.adb (Non_Blocking_Spawn, version with Stdout_File and
1779         Stderr_File): Close local file descriptors when no longer needed.
1781 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
1783         * sem_ch5.adb (Analyze_Iterator_Specification): Remove SPARK
1784         mode check that the type of the cursor in an iteration over
1785         a formal container is not volatile. The proper check on the
1786         element type is done elsewhere.
1788 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
1790         * sem_ch6.adb (Process_Formals): Do not set a delay freeze on
1791         a subprogram that returns a class-wide type, if the subprogram
1792         is a compilation unit, because otherwise gigi will treat the
1793         subprogram as external, leading to link errors.
1795 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
1797         * sem_res.adb (Resolve_Short_Circuit): Do not use
1798         expression-with-actions when generating C.
1800 2016-04-18  Yannick Moy  <moy@adacore.com>
1802         * sem_util.adb (Apply_Compile_Time_Constraint_Error): Do not generate
1803         raise node in GNATprove mode.
1805 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
1807         * s-fileio.adb: Minor reformatting.
1808         * sem_prag.adb (Analyze_Input_Item): Add local
1809         variable Input_OK. Do not consider mappings of generic formal
1810         parameters to actuals.
1812 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
1814         * sem_ch5.adb (Get_Cursor_Type): If iterator type is a derived
1815         type, the cursor is declared in the scope of the parent type.
1816         (Analyze_Parameter_Specification): A qualified expression with an
1817         iterator type indicates an iteration over a container (explicit
1818         or implicit).
1820 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
1822         * osint-c.ads, osint-c.adb (Delete_C_File, Delete_H_File): New.
1823         * gnat1drv.adb (Gnat1drv): Delete old C files before regenerating them.
1824         * debug.adb: Reserve -gnatd.4 to force generation of C files.
1826 2016-04-18  Yannick Moy  <moy@adacore.com>
1828         * sem_eval.adb (Eval_Arithmetic_Op): Do not issue error on static
1829         division by zero, instead possibly issue a warning.
1830         * sem_res.adb (Resolve_Arithmetic_Op): Do not issue error on
1831         static division by zero, instead add check flag on original
1832         expression.
1833         * sem_util.adb, sem_util.ads (Compile_Time_Constraint_Error):
1834         Only issue error when both SPARK_Mode is On and Warn is False.
1836 2016-04-18  Yannick Moy  <moy@adacore.com>
1838         * checks.adb (Apply_Scalar_Range_Check): Force
1839         warning instead of error when SPARK_Mode is On, on index out of
1840         bounds, and set check flag for GNATprove.
1842 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
1844         * sem_prag.adb (Check_In_Out_States.Check_Constituent_Usage):
1845         Update the comment on usage.  Reimplemented.
1846         (Check_Input_States.Check_Constituent_Usage): Update the comment
1847         on usage. A Proof_In constituent can now refine an Input state
1848         as long as there is at least one Input constituent present.
1850 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
1852         * sem_ch6.adb (Check_Inline_Pragma): Use the Sloc of the
1853         body id as the sloc of the entity in the generated subprogram
1854         declaration, to avoid spurious conformance errors when style
1855         checks are enabled.
1857 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
1859         * sem_ch4.adb (Analyze_Selected_Component, Has_Dereference):
1860         Refine check on illegal calls to entities within a task body,
1861         when the entity is declared in an object of the same type. In
1862         a generic context there might be no explicit dereference but if
1863         the prefix includes an access type the construct is legal.
1865 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
1867         * rtsfind.ads, rtsfind.adb (RE_Id, RE_Unit_Table): add
1868         RE_Default_Priority.
1870 2016-04-18  Bob Duff  <duff@adacore.com>
1872         * sem_prag.adb (Check_Arg_Is_Local_Name): Don't do the check
1873         if the pragma came from an aspect specification.
1875 2016-04-18  Gary Dismukes  <dismukes@adacore.com>
1877         * gnat1drv.adb, contracts.adb: Minor reformatting and wording fixes.
1879 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
1881         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): To suppress
1882         superfluous conformance check on an inlined body with a previous
1883         spec, use the fact that the generated declaration does not come
1884         from source. We must treat the entity as coming from source to
1885         enable some back-end inlining when pragma appears after the body.
1887 2016-04-18  Gary Dismukes  <dismukes@adacore.com>
1889         * lib-xref-spark_specific.adb, par-ch2.adb, errout.ads,
1890         exp_intr.adb: Minor reformatting and typo corrections.
1892 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
1894         * sem_ch6.adb: Code cleanup.
1896 2016-04-18  Thomas Quinot  <quinot@adacore.com>
1898         * sem_ch13.adb: Minor reformatting and error message tweaking
1899         (remove extraneous spaces).
1901 2016-04-18  Johannes Kanig  <kanig@adacore.com>
1903         * gnat1drv.adb (Gnat1drv): Force loading of System unit for SPARK.
1905 2016-04-18  Bob Duff  <duff@adacore.com>
1907         * s-fileio.adb (Fopen_Mode): If Mode = Out_File, and the file
1908         exists, and it's a fifo, we use "w" as the open string instead of
1909         "r+". This is necessary to make a write to the fifo block until
1910         a reader is ready.
1912 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
1914         * sem_attr.adb (Denote_Same_Function): Account
1915         for a special case where a primitive of a tagged type inherits
1916         a class-wide postcondition from a parent type.
1918 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
1920         * par-ch2.adb (P_Expression_Or_Reserved_Word): New routine.
1921         (P_Pragma): Signal Scan_Pragma_Argument_Association when the use
1922         of reserved words is OK.
1923         (Scan_Pragma_Argument_Association):
1924         Add new formal Reserved_Words_OK and update the comment on
1925         usage. Code cleanup. Parse an expression or a reserved word in
1926         identifier form for pragmas Restriction_Warnings and Restrictions
1927         No_Use_Of_Attribute.
1928         * restrict.adb (Check_Restriction_No_Use_Of_Attribute):
1929         Reimplemented.  (Check_Restriction_No_Use_Of_Pragma): Code cleanup.
1930         (Set_Restriction_No_Specification_Of_Aspect): Properly set the warning
1931         flag for an aspect.
1932         (Set_Restriction_No_Use_Of_Attribute): Properly set the warning
1933         flag for an attribute.  (Set_Restriction_No_Use_Of_Entity):
1934         Update the parameter profile.
1935         (Set_Restriction_No_Use_Of_Pragma): Properly set the warning flag for
1936         a pragma.
1937         * restrict.ads (Check_Restriction_No_Use_Of_Attribute): Update
1938         the comment on usage.
1939         (Set_Restriction_No_Use_Of_Entity): Update the parameter profile.
1940         * sem_attr.adb (Analyze_Attribute): Check restriction
1941         No_Use_Of_Attribute.
1942         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Check
1943         restriction No_Use_Of_Attribute before any rewritings have
1944         taken place.
1945         * sem_prag.adb (Analyze_Pragma): Check restriction
1946         No_Use_Of_Pragma before any rewritings have taken place.
1948 2016-04-18  Bob Duff  <duff@adacore.com>
1950         * sem_ch6.adb (Is_Inline_Pragma): The pragma
1951         argument can be a selected component, which has no Chars field,
1952         so we need to deal with that case (use the Selector_Name).
1953         (Check_Inline_Pragma): We need to test Is_List_Member before
1954         calling In_Same_List, because in case of a library unit, they're
1955         not in lists, so In_Same_List fails an assertion.
1957 2016-04-18  Bob Duff  <duff@adacore.com>
1959         * namet.ads, namet.adb: Add an Append that appends a
1960         Bounded_String onto a Bounded_String. Probably a little more
1961         efficient than "Append(X, +Y);". Also minor cleanup.
1962         (Append_Decoded, Append_Decoded_With_Brackets, Append_Unqualified,
1963         Append_Unqualified_Decoded): Make sure these work with non-empty
1964         buffers.
1965         * casing.ads, casing.adb (Set_Casing): Pass a Bounded_String
1966         parameter, defaulting to Global_Name_Buffer.
1967         * errout.ads, errout.adb (Adjust_Name_Case): Pass a
1968         Bounded_String parameter, no default.
1969         * exp_ch11.adb (Expand_N_Raise_Statement): Use local
1970         Bounded_String instead of Global_Name_Buffer.
1971         * exp_intr.ads, exp_intr.adb (Write_Entity_Name): Rename it
1972         to Append_Entity_Name, and pass a Bounded_String parameter,
1973         instead of using globals.
1974         (Add_Source_Info): Pass a Bounded_String parameter, instead of
1975         using globals.
1976         (Expand_Source_Info): Use local instead of globals.
1977         * stringt.ads, stringt.adb (Append): Add an Append procedure
1978         for appending a String_Id onto a Bounded_String.
1979         (String_To_Name_Buffer, Add_String_To_Name_Buffer): Rewrite in
1980         terms of Append.
1981         * sem_prag.adb (Set_Error_Msg_To_Profile_Name): Adjust for new
1982         Adjust_Name_Case parameter.
1983         * erroutc.adb, uname.adb: Don't pass D => Mixed_Case to
1984         Set_Casing; that's the default.
1985         * lib-xref-spark_specific.adb (Add_SPARK_Scope): Pretend that calls to
1986         protected subprograms are entry calls; otherwise it is not possible to
1987         distinguish them from regular subprogram calls.
1989 2016-04-18  Gary Dismukes  <dismukes@adacore.com>
1991         * sem_ch13.adb (Has_Good_Profile): Improvement
1992         of error message. Now indicates subtype_mark of formal parameter
1993         rather than the formal's name, plus minor rewording.
1995 2016-04-18  Pascal Obry  <obry@adacore.com>
1997         * adaint.c, adaint.h, s-os_lib.ads: Add new routine Current_Process_Id.
1999 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
2001         * stringt.adb, exp_ch6.adb, sem_ch13.adb: Minor reformatting.
2003 2016-04-18  Gary Dismukes  <dismukes@adacore.com>
2005         * par-ch4.adb, sem_prag.adb: Minor reformatting.
2007 2016-04-18  Bob Duff  <duff@adacore.com>
2009         * sinput.ads, sinput.adb (Build_Location_String): Take a
2010         parameter instead of using a global variable.  The function
2011         version no longer destroys the Name_Buffer.
2012         * stringt.ads, stringt.adb (String_From_Name_Buffer): Take a
2013         parameter, which defaults to the Global_Name_Buffer, so some
2014         calls can avoid the global.
2015         * exp_ch11.adb, exp_intr.adb: Use new interfaces above
2016         to avoid using globals. All but one call to Build_Location_String
2017         avoids the global. Only one call to String_From_Name_Buffer
2018         avoids it.
2020 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
2022         * namet.adb, namet.ads, exp_unst.adb: Minor reformatting.
2024 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
2026         * sem_eval.adb (Choice_Matches): Check the expression
2027         against the predicate values when the choice denotes a
2028         subtype with a static predicate.
2029         (Eval_Membership_Op): Code cleanup. Remove the suspicious guard which
2030         tests for predicates.
2031         (Is_OK_Static_Subtype): A subtype with a dynamic predicate
2032         is not static.  (Is_Static_Subtype): A subtype with a dynamic
2033         predicate is not static.
2034         * sem_eval.ads (Is_OK_Static_Subtype): Update the comment on usage.
2035         (Is_Static_Subtype): Update the comment on usage.
2037 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
2039         * sem_prag.adb (Analyze_Input_Item): Allow
2040         generic formals to appear as initialization items.
2042 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
2044         * sem_ch13.adb (Analyze_Stream_TSS_Definition,
2045         Has_Good_Profile): Additional error message to indicate that
2046         the second parameter of the subprogram must be a first subtype.
2048 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
2050         * sem_ch6.adb (Analyze_Subprogram_Body_Helper, Is_Inline_Pragma):
2051         Use the pragma lookahead that determines whether a subprogram
2052         is to be inlined, when some level of backend optimization is
2053         required.
2054         * sem_ch12.ads, sem_ch12.adb (Add_Pending_Instantiation): Factorize
2055         code used to create an instance body when needed for inlining.
2056         * exp_ch6.adb (Expand_Call): When a call is to be inlined, and the
2057         call appears within an instantiation that is not a compilation
2058         unit, add a pending instantiation for the enclosing instance,
2059         so the backend can inline in turn the calls contained in the
2060         inlined body.
2062 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
2064         * sem_prag.adb (Build_Pragma_Check_Equivalent): The mapping
2065         that relates operations of the parent type to the operations of
2066         the derived type has three distinct sources:
2067         a) explicit operations of the derived type carry an
2068         Overridden_Operation that designates the operation in the
2069         ancestor.
2070         b) Implicit operations that are inherited by the derived type
2071         carry an alias that may be an explicit subprogram (in which case
2072         it may have an Overridden_ Operation indicator) or may also be
2073         inherited and carry its own alias.
2074         c) If the parent type is an interface, the operation of the
2075         derived type does not override, but the interface operation
2076         indicates the operation that implements it.
2077         * sem_prag.adb: Minor reformatting.
2078         * sem_prag.adb (Check_External_Property): Update
2079         the comment on usage. Reimplement.
2081 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
2083         * exp_ch5.adb (Expand_Assignment_Statement): In restricted
2084         profiles such as ZFP, ceiling priority is not available.
2086 2016-04-18  Bob Duff  <duff@adacore.com>
2088         * namet-sp.ads: Minor typo fix, ironically in 'Spelling_Checker'.
2090 2016-04-18  Bob Duff  <duff@adacore.com>
2092         * sem_elab.adb (Output_Calls): Use
2093         Get_Name_String, to clearly indicate that the global Name_Buffer
2094         is being used. The previous code used Is_Internal_Name, which
2095         returns a Boolean, but also has a side effect of setting the
2096         Name_Buffer. Then it called the other Is_Internal_Name, which uses
2097         the Name_Buffer for its input. And then it called Error_Msg_N,
2098         again using the Name_Buffer. We haven't eliminated the global
2099         usage here, but we've made it a bit clearer.
2100         This also allows us to have a side-effect-free version of
2101         Is_Internal_Name.
2102         * namet.ads, namet.adb: Provide a type Bounded_String, along with
2103         routines that can be used without using global variables. Provide
2104         Global_Name_Buffer so existing code can continue to use the
2105         global. Mark the routines that use globals as obsolete.  New code
2106         shouldn't call the obsolete ones, and we should clean up existing
2107         code from time to time.
2108         Name_Find_Str is renamed as Name_Find.
2109         * namet.h: Changed as necessary to interface to the new version
2110         of Namet.
2111         * bindgen.adb, exp_unst.adb: Name_Find_Str is renamed as
2112         Name_Find.
2114 2016-04-18  Yannick Moy  <moy@adacore.com>
2116         * sem_util.adb, sem_util.ads (Has_Full_Default_Initialization): used
2117         outside of GNATprove, hence it should not be removed.
2119 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
2121         * sem_prag.adb (Analyze_Refinement_Clause):
2122         The refinement of an external abstract state can now mention
2123         non-external constituents.
2124         (Check_External_Property): Update all SPARK RM references.
2126 2016-04-18  Bob Duff  <duff@adacore.com>
2128         * exp_intr.adb: Remove some duplicated code.
2130 2016-04-18  Yannick Moy  <moy@adacore.com>
2132         * a-nudira.adb, a-nudira.ads, a-nuflra.adb, a-nuflra.ads: Mark
2133         package spec and body out of SPARK.
2135 2016-04-18  Johannes Kanig  <kanig@adacore.com>
2137         * spark_xrefs.ads: Minor comment update.
2139 2016-04-18  Johannes Kanig  <kanig@adacore.com>
2141         * gnat1drv.adb (Gnat1drv): Force loading of System
2142         unit for SPARK.
2144 2016-04-18  Bob Duff  <duff@adacore.com>
2146         * a-cuprqu.adb: Correction to previous change. If a new node
2147         is inserted at the front of the queue (because it is higher
2148         priority than the previous front node), we need to update
2149         Header.Next_Unequal -- not just in the case where the queue was
2150         previously empty.
2152 2016-04-18  Bob Duff  <duff@adacore.com>
2154         * a-cuprqu.ads: Change the representation of List_Type from a
2155         singly-linked list to a doubly-linked list. In addition, add a
2156         pointer Next_Unequal, which points past a possibly-long chain
2157         of equal-priority items. This increases efficiency, especially
2158         in the case of many equal-priority items.
2159         * a-cuprqu.adb (Dequeue, Enqueue): Rewrite algorithms to take
2160         advantage of new data structure.
2161         (Finalize): Rewrite in terms of Dequeue, for simplicity.
2163 2016-04-18  Yannick Moy  <moy@adacore.com>
2165         * contracts.adb (Analyze_Object_Contract,
2166         Analyze_Protected_Contract): Remove tests performed in GNATprove.
2167         * sem_util.adb, sem_util.ads (Has_Full_Default_Initialization):
2168         Remove query for tests performed in GNATprove.
2170 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
2172         * sem_aggr.adb (Resolve_Record_Aggregate): If
2173         Warn_On_Redundant_Constructs is enabled, report a redundant box
2174         association that does not cover any components, as it done for
2175         redundant others associations in case statements.
2177 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
2179         * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions):
2180         Analyze the generated Check pragma for an inherited condition so
2181         that it does not freeze the dispatching type of the primitive
2182         operation, because it is pre-analyzed at the point of the
2183         subprogram declaration (and not in the subprogram body, as is
2184         done during regular expansion).
2186 2016-04-18  Vincent Celier  <celier@adacore.com>
2188         * ali.ads: Increase the range of all _Id types to 100 millions.
2190 2016-04-18  Gary Dismukes  <dismukes@adacore.com>
2192         * sem_warn.adb (Check_References): Change warning to suggest
2193         using pragma Export rather than saying "volatile has no effect".
2195 2016-04-18  Bob Duff  <duff@adacore.com>
2197         * g-souinf.ads (Compilation_ISO_Date): New function to return
2198         the current date in ISO form.
2199         * exp_intr.adb (Expand_Source_Info, Add_Source_Info): Expand
2200         a call to Compilation_ISO_Date into a string literal containing
2201         the current date in ISO form.
2202         * exp_intr.ads (Add_Source_Info): Improve documentation.
2203         * sem_intr.adb (Check_Intrinsic_Subprogram): Recognize
2204         Compilation_ISO_Date.
2205         * snames.ads-tmpl (Name_Compilation_ISO_Date): New Name_Id.
2207 2016-04-18  Eric Botcazou  <ebotcazou@adacore.com>
2209         * layout.adb (Set_Elem_Alignment): Extend setting of alignment
2210         to subtypes that are not first subtypes.
2212 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
2214         * sem_prag.ads (Collect_Inherited_Class_Wide_Conditions):
2215         Simplify interface.
2216         * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Insert
2217         generated pragmas after subprogram declaration, rather than in
2218         the corresponding subprogram body.
2219         * sem_ch6.adb (New_Overloaded_Entity): In GNATProve
2220         mode, if the operation is overridding, call
2221         Collect_Inherited_Class_Wide_Conditions to generate the
2222         corresponding pragmas immediately after the corresponding
2223         subprogram declaration.
2225 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
2227         * spark_xrefs.ads (Xref_Index, Scope_Index, File_Index): restrict
2228         type to natural numbers.
2229         (Stype): document code characters for concurrent entities.
2231 2016-04-18  Olivier Hainque  <hainque@adacore.com>
2233         * targparm.ads: Update the Frontend_Exceptions default internal
2234         value.
2235         (Frontend_Exceptions_On_Target): Change default value to True.
2237 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
2239         * sem_ch4.adb (Analyze_Selected_Component): Refine error
2240         detection when a selected component in the body of a synchronized
2241         type is a reference to an object of the same type declared
2242         elsewhere. The construct is legal if the prefix of the selected
2243         component includes an explicit dereference at any point.
2245 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
2247         * sem_ch3.adb (Analyze_Object_Declaration): Do not consider
2248         internally generated expressions when trying to determine whether
2249         a formal parameter of a tagged type subject to Extensions_Visible
2250         False is used to initialize an object.
2251         * sem_ch4.adb (Analyze_Type_Conversion): Do not consider
2252         internally generated expressions when trying to determine whether
2253         a formal parameter of a tagged type subject to Extensions_Visible
2254         False is used in a type conversion.
2256 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
2258         * sem_res.adb (Is_Protected_Operation_Call):
2259         Add guards to account for a non-decorated selected component.
2261 2016-04-18  Yannick Moy  <moy@adacore.com>
2263         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Improve
2264         implementation of Body_Has_SPARK_Mode_On.
2265         * sem_prag.adb, sem_prag.ads (Get_SPARK_Mode_From_Annotation):
2266         New function replacing previous Get_SPARK_Mode_From_Pragma, that
2267         deals also with aspects.
2268         (Get_SPARK_Mode_Type): Make function internal again.
2269         * inline.adb, sem_ch7.adb, sem_util.adb: Use new
2270         Get_SPARK_Mode_From_Annotation.
2272 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
2274         * contracts.adb (Analyze_Object_Contract): Update references to
2275         SPARK RM.
2276         * freeze.adb (Freeze_Entity): Update references to SPARK RM.
2277         * ghost.adb Add with and use clauses for Sem_Disp.
2278         (Check_Ghost_Derivation): Removed.
2279         (Check_Ghost_Overriding):
2280         Reimplemented.  (Check_Ghost_Policy): Update references to SPARK RM.
2281         (Check_Ghost_Primitive): New routine.
2282         (Check_Ghost_Refinement): New routine.  (Is_OK_Ghost_Context):
2283         Update references to SPARK RM.  (Is_OK_Pragma): Update references
2284         to SPARK RM. Predicates are now a valid context for references
2285         to Ghost entities.
2286         * ghost.ads (Check_Ghost_Derivation): Removed.
2287         (Check_Ghost_Overriding): Update the comment on usage.
2288         (Check_Ghost_Primitive): New routine.
2289         (Check_Ghost_Refinement): New routine.
2290         (Remove_Ignored_Ghost_Code): Update references to SPARK RM.
2291         * sem_ch3.adb (Process_Full_View): Remove the now obsolete check
2292         related to Ghost derivations
2293         * sem_ch6.adb (Check_Conformance): Remove now obsolete check
2294         related to the convention-like behavior of pragma Ghost.
2295         (Check_For_Primitive_Subprogram): Verify that the Ghost policy
2296         of a tagged type and its primitive agree.
2297         * sem_prag.adb (Analyze_Pragma): Update references to SPARK
2298         RM. Move the verification of pragma Assertion_Policy Ghost
2299         to the proper place. Remove the now obsolete check related
2300         to Ghost derivations.
2301         (Collect_Constituent): Add a call to Check_Ghost_Refinement.
2302         * sem_res.adb (Resolve_Actuals): Update references to SPARK RM.
2304 2016-04-18  Eric Botcazou  <ebotcazou@adacore.com>
2306         * layout.adb: Fix more minor typos in comments.
2308 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
2310         * a-calend.ads, sem_prag.adb, sem_ch6.adb: Minor reformatting.
2312 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
2314         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): In GNATprove
2315         mode, collect inherited class-wide conditions to generate the
2316         corresponding pragmas.
2317         * sem_prag.ads (Build_Pragma_Check_Equivalent): Moved from contracts
2318         * contracts.adb (Collect_Inherited_Class_Wide_Conditions): New
2319         procedure for overriding subprograms, used to generate the pragmas
2320         corresponding to an inherited class- wide pre- or postcondition.
2321         * sem_prag.adb (Build_Pragma_Check_Equivalent): moved here
2322         from contracts.adb (Replace_Condition_Entities): Subsidiary
2323         Build_Pragma_Check_Equivalent, to implement the proper semantics
2324         of inherited class-wide conditions, as given in AI12-0113.
2325         (Process_Class_Wide_Condition): Removed.
2326         (Collect_Inherited_Class_Wide_Conditions): Iterate over pragmas
2327         in contract of subprogram, to collect inherited class-wide
2328         conditions.
2329         (Build_Pragma_Check_Equivalent): Moved to sem_prag.adb
2331 2016-04-18  Yannick Moy  <moy@adacore.com>
2333         * a-calend.adb (Ada.Calendar): Mark package body as SPARK_Mode Off.
2334         * a-calend.ads (Ada.Calendar): Mark package spec as
2335         SPARK_Mode and add synchronous external abstract state Clock_Time.
2337 2016-04-18  Yannick Moy  <moy@adacore.com>
2339         * sem_res.adb (Resolve_Call): Prevent inlining of
2340         calls inside expression functions.  Factor previous code issuing
2341         errors to call Cannot_Inline instead, which does appropriate
2342         processing of message for GNATprove.
2344 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
2346         * einfo.ads, sem_ch3.adb, sem_ch8.adb, osint-l.adb, rtsfind.adb,
2347         osint-b.adb: Cleanups.
2349 2016-04-18  Yannick Moy  <moy@adacore.com>
2351         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Only create
2352         body to inline in GNATprove mode when SPARK_Mode On applies to
2353         subprogram body.
2354         * sem_prag.adb, sem_prag.ads (Get_SPARK_Mode_Type): Make function
2355         public.
2357 2016-04-18  Eric Botcazou  <ebotcazou@adacore.com>
2359         * layout.adb: Fix minor typo in comment.
2360         * inline.adb: Fix minor pasto.
2361         * sem_ch12.ads: Fix minor typos in comments.
2363 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
2365         * sem_disp.adb (Check_Dispatching_Call): Major rewriting to
2366         handle some complex cases of tag indeterminate calls that are
2367         actuals in other dispatching calls that are themselves tag
2368         indeterminate.
2369         (Check_Dispatching_Context): Add parameter to support recursive
2370         check for an enclosing construct that may provide a tag for a
2371         tag-indeterminate call.
2373 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
2375         * sem_prag.adb (Analyze_Depends_In_Decl_Part):
2376         Add global variables Task_Input_Seen and Task_Output_Seen.
2377         (Analyze_Global_Item): Detect an illegal use of the current
2378         instance of a single protected/task type in a global annotation.
2379         (Analyze_Input_Output): Inputs and output related to the current
2380         instance of a task unit are now tracked.
2381         (Check_Usage): Require
2382         the presence of the current instance of a task unit only when
2383         one input/output is available.  (Current_Task_Instance_Seen):
2384         New routine.
2385         (Is_CCT_Instance): New parameter profile. Update
2386         the comment on usage. The routine now properly recognizes several
2387         cases related to single protected/task types.
2389 2016-04-18  Hristian Kirtchev  <kirtchev@adacore.com>
2391         * freeze.adb (Freeze_Entity): Use New_Freeze_Node
2392         to create a brand new freeze node. This handles a case where an
2393         ignored Ghost context is freezing something which is not ignored
2394         Ghost and whose freeze node should not be removed from the tree.
2395         (New_Freeze_Node): New routine.
2397 2016-04-18  Jerome Lambourg  <lambourg@adacore.com>
2399         * sigtramp.h (__gnat_set_is_vxsim) New function to
2400         tell sigtramp-vxworks to handle vxsim signal contexts.  *
2401         sigtramp-vxworks.c (__gnat_sigtramp) Take into account the
2402         differences in the sigcontext structure between the expected
2403         regular x86 or x86_64 ones and the ones received in case of
2404         exexution on the vxworks simulator.
2405         * init.c: also compute is_vxsim in case of x86_64-vx7 target. Provide
2406         this information to sigtramp-vxworks.c. Remove the old mechanism for
2407         vxsim.
2408         * init-vxsim.c, sigtramp-vxworks-vxsim.c: remove, now obsolete.
2410 2016-04-18  Eric Botcazou  <ebotcazou@adacore.com>
2412         * exp_ch3.adb (Inline_Init_Proc): New function returning
2413         whether the initialization procedure of a type should be
2414         inlined.  Return again True for controlled type themselves.
2415         (Build_Array_Init_Proc): Call it to set Set_Is_Inlined on Init_Proc.
2416         (Build_Record_Init_Proc): Likewise.
2418 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
2420         * gnatvsn.ads (Library_Version): Bump to 7.
2422 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
2424         * sem_ch6.adb (Analyze_Expression_Function): Set Inlined flag
2425         on the entity of a subprogram declaration that is completed by
2426         an expression function.
2428 2016-04-18  Ed Schonberg  <schonberg@adacore.com>
2430         * sem_util.adb (Is_Current_Instance): A entity given by a subtype
2431         declaration can appear in an aspect specification for a dynamic
2432         predicate, and a pragma for aspect Predicate_Failure.
2433         * exp_util.adb (Replace_Subtype_References): Replace current
2434         occurrences of the subtype to which a dynamic predicate applies,
2435         byt the expression that triggers a predicate check. Needed to
2436         implement new aspect Predicate_Failure.
2438 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
2440         * a-intsig.ads, a-intsig.adb: Removed, no longer used.
2441         * Makefile.rtl: update accordingly.
2443 2016-04-18  Eric Botcazou  <ebotcazou@adacore.com>
2445         * sem_type.adb (Disambiguate): Call Covers only when necessary
2446         for standard operators.
2448 2016-04-18  Eric Botcazou  <ebotcazou@adacore.com>
2450         * atree.ads (Num_Extension_Nodes): Add couple of figures
2451         to comment.
2452         * atree.adb: Add GNAT.Heap_Sort_G dependency.
2453         (Print_Statistics): New exported procedure to print statistics.
2455 2016-04-18  Eric Botcazou  <ebotcazou@adacore.com>
2457         * exp_ch3.adb (Build_Record_Init_Proc): Do not mark the procedure
2458         as to be inlined if the type needs finalization.
2460 2016-04-18  Jerome Lambourg  <lambourg@adacore.com>
2462         * sigtramp-vxworks-target.inc: sigtramp-vxworks: force the stack
2463         alignment for x86_64.
2464         * init.c: Better fix for guard page reset on x86_64-vx7.
2465         Do not try to retrieve the page that actually raised
2466         the signal as the probing mechanism used on x86_64 do not allow
2467         such retrieval. We thus just test if the guard page is active,
2468         and re-activate it if not.
2470 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
2472         * a-sytaco.adb (Suspension_Object): Aspect Default_Initial_Condition
2473         added.
2475 2016-04-18  Jerome Lambourg  <lambourg@adacore.com>
2477         * affinity.c: Use the proper type for task id.
2478         * init.c (__gnat_inum_to_ivec): ivec is a pointer.
2480 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
2482         * sem_prag.adb (Process_Convention): Relax rule on exporting
2483         Intrinsic types if Relaxed_RM_Semantics is True.
2485 2016-04-18  Vincent Celier  <celier@adacore.com>
2487         * sem_ch3.adb, lib.ads, sinfo.ads, sem_ch10.adb, einfo.adb, einfo.ads,
2488         checks.ads, sem_ch12.adb, sem.adb, sem_util.adb, sem_util.ads,
2489         sem_res.adb, sem_attr.adb, par.adb, exp_ch4.adb, errout.ads,
2490         sem_ch4.adb, atree.adb, atree.ads, sem_warn.adb, treepr.adb,
2491         exp_ch3.ads, exp_unst.adb: Change "descendent" to
2492         "descendant" in comments, error messages and identifiers.
2493         * gcc-interface/decl.c: Ditto.
2495 2016-04-18  Eric Botcazou  <ebotcazou@adacore.com>
2497         * sem_type.adb (Operator_Matches_Spec): Call First_Formal on
2498         New_S only once at the beginning of the function.
2500 2016-04-02  Eric Botcazou  <ebotcazou@adacore.com>
2502         * gcc-interface/decl.c (components_to_record): Restrict the previous
2503         change to fields with variable size.
2505 2016-03-27  Eric Botcazou  <ebotcazou@adacore.com>
2507         * gcc-interface/decl.c (components_to_record): Add special case for
2508         single field with representation clause at offset 0.
2510 2016-03-16  Svante Signell  <svante.signell@gmail.com>
2512         * gcc-interface/Makefile.in: Add support for x86 GNU/Hurd.
2513         * s-osinte-gnu.ads: New file.
2515 2016-03-13  Eric Botcazou  <ebotcazou@adacore.com>
2517         * system-vxworks-m68k.ads (Stack_Check_Probes): Set to True.
2518         (Stack_Check_Limits): Set to False.
2519         * system-vxworks-mips.ads (Stack_Check_Probes): Set to True.
2520         (Stack_Check_Limits): Set to False.
2521         * system-vxworks-ppc.ads (Stack_Check_Probes): Set to True.
2522         (Stack_Check_Limits): Set to False.
2523         * system-vxworks-sparcv9.ads (Stack_Check_Probes): Set to True.
2524         (Stack_Check_Limits): Set to False.
2525         * system-vxworks-x86.ads (Stack_Check_Probes): Set to True.
2526         (Stack_Check_Limits): Set to False.
2528 2016-03-07  Eric Botcazou  <ebotcazou@adacore.com>
2530         * gcc-interface/trans.c (statement_node_p): New predicate.
2531         (gnat_to_gnu): Invoke it to detect statement nodes.  In ASIS mode, do
2532         not return dummy results for expressions attached to packed array
2533         implementation types.
2535 2016-03-07  Eric Botcazou  <ebotcazou@adacore.com>
2537         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Always mark
2538         the expression of a renaming manually in case #3.
2540 2016-03-02  Dominik Vogt  <vogt@linux.vnet.ibm.com>
2542         * system-linux-s390.ads: Enable Stack_Check_Probes.
2543         * system-linux-s390.ads: Likewise.
2545 2016-02-29  Martin Liska  <mliska@suse.cz>
2547         * gcc-interface/utils.c (set_reverse_storage_order_on_pad_type):
2548         Replace ENABLE_CHECKING macro with flag_checking.
2550 2016-02-29  Eric Botcazou  <ebotcazou@adacore.com>
2552         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Type>: Retrofit
2553         handling of unconstrained array types as designated types into common
2554         processing.  Also handle array types as incomplete designated types.
2556 2016-02-29  Eric Botcazou  <ebotcazou@adacore.com>
2558         * gcc-interface/decl.c (gnat_to_gnu_entity) <Concurrent types>: In
2559         ASIS mode, fully lay out the minimal record type.
2561 2016-02-29  Eric Botcazou  <ebotcazou@adacore.com>
2563         * gcc-interface/trans.c (finalize_nrv_r): Remove obsolete code.
2564         (build_return_expr): Likewise.
2565         (Call_to_gnu): If this is a function call and there is no target,
2566         create a temporary for the return value for all aggregate types,
2567         but never create it for a return statement.  Push a binding level
2568         around the call in more cases.  Remove obsolete code.
2570 2016-02-29  Eric Botcazou  <ebotcazou@adacore.com>
2572         * gcc-interface/ada-tree.h (DECL_RETURN_VALUE_P): New macro.
2573         * gcc-interface/gigi.h (gigi): Remove useless attribute.
2574         (gnat_gimplify_expr): Likewise.
2575         (gnat_to_gnu_external): Declare.
2576         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Factor out
2577         code dealing with the expression of external constants into...
2578         Invoke gnat_to_gnu_external instead.
2579         <E_Variable>: Invoke gnat_to_gnu_external to translate renamed objects
2580         when not for a definition.  Deal with COMPOUND_EXPR and variables with
2581         DECL_RETURN_VALUE_P set for renamings and with the case of a dangling
2582         'reference to a function call in a renaming.  Remove obsolete test and
2583         adjust associated comment.
2584         * gcc-interface/trans.c (Call_to_gnu): Set DECL_RETURN_VALUE_P on the
2585         temporaries created to hold the return value, if any.
2586         (gnat_to_gnu_external): ...this.  New function.
2587         * gcc-interface/utils.c (create_var_decl): Detect a constant created
2588         to hold 'reference to function call.
2589         * gcc-interface/utils2.c (build_unary_op) <ADDR_EXPR>: Add folding
2590         for COMPOUND_EXPR in the DECL_RETURN_VALUE_P case.
2592 2016-02-17  Eric Botcazou  <ebotcazou@adacore.com>
2594         * exp_ch4.adb (Expand_N_Indexed_Component): Activate synchronization if
2595         the prefix denotes an entity which Has_Atomic_Components.
2596         * gcc-interface/trans.c (node_is_atomic): Return true if the prefix
2597         denotes an entity which Has_Atomic_Components.
2599 2016-02-17  Eric Botcazou  <ebotcazou@adacore.com>
2601         * gcc-interface/utils2.c (gnat_protect_expr): Make a SAVE_EXPR only
2602         for fat pointer or scalar types.
2604 2016-02-16  Eric Botcazou  <ebotcazou@adacore.com>
2606         * gcc-interface/gigi.h (maybe_debug_type): New inline function.
2607         * gcc-interface/misc.c (gnat_get_array_descr_info): Use it.
2608         Call maybe_character_value on the array bounds.  Get to the base type
2609         of the index type and call maybe_debug_type on it.
2610         * gcc-interface/utils.c (finish_character_type): Add special treatment
2611         for char_type_node.
2613 2016-02-16  Eric Botcazou  <ebotcazou@adacore.com>
2615         * gcc-interface/misc.c (gnat_enum_underlying_base_type): New function.
2616         (LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Define to above.
2618 2016-02-12  Jakub Jelinek  <jakub@redhat.com>
2620         * prj-tree.ads: Spelling fixes - behaviour -> behavior and
2621         neighbour -> neighbor.
2622         * prep.adb: Likewise.
2623         * prj.ads: Likewise.
2624         * prepcomp.adb: Likewise.
2625         * g-socket.ads: Likewise.
2626         * s-imgrea.adb: Likewise.
2627         * a-calend.adb: Likewise.
2628         * exp_disp.adb: Likewise.
2629         * doc/gnat_ugn/gnat_utility_programs.rst: Likewise.
2630         * g-socket.adb: Likewise.
2631         * sem_ch12.adb: Likewise.
2632         * terminals.c: Likewise.
2634 2016-02-08  Bernd Schmidt  <bschmidt@redhat.com>
2636         * gcc-interface/misc.c (gnat_init): Remove second argument in call to
2637         build_common_tree_nodes.
2639 2016-02-08  Eric Botcazou  <ebotcazou@adacore.com>
2641         * gcc-interface/utils.c (create_var_decl): Set again DECL_COMMON and
2642         DECL_IGNORED_P last.
2644 2016-01-28  Eric Botcazou  <ebotcazou@adacore.com>
2646         * gcc-interface/gigi.h (enum attr_type): Rename into...
2647         (enum attrib_type): ...this.
2648         (struct attrib): Adjust.
2649         * gcc-interface/decl.c (prepend_one_attribute): Likewise.
2651 2016-01-20  Eric Botcazou  <ebotcazou@adacore.com>
2653         * exp_ch2.adb (Expand_Current_Value): Make an appropriate character
2654         literal if the entity is of a character type.
2655         * gcc-interface/lang.opt (fsigned-char): New option.
2656         * gcc-interface/misc.c (gnat_handle_option): Accept it.
2657         (gnat_init): Adjust comment.
2658         * gcc-interface/gigi.h (finish_character_type): New prototype.
2659         (maybe_character_type): New inline function.
2660         (maybe_character_value): Likewise.
2661         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Enumeration_Type>: For
2662         a character of CHAR_TYPE_SIZE, make a signed type if flag_signed_char.
2663         Set TYPE_ARTIFICIAL early and call finish_character_type on the type.
2664         <E_Enumeration_Subtype>: For a subtype of character with RM_Size and
2665         Esize equal to CHAR_TYPE_SIZE, make a signed type if flag_signed_char.
2666         Copy TYPE_STRING_FLAG from type to subtype.
2667         <E_Array_Type>: Deal with character index types.
2668         <E_Array_Subtype>: Likewise.
2669         * gcc-interface/trans.c (gigi): Replace unsigned_char_type_node with
2670         char_type_node throughout.
2671         (build_raise_check): Likewise.
2672         (get_type_length): Deal with character types.
2673         (Attribute_to_gnu) <Attr_Pos>: Likewise.  Remove obsolete range check
2674         code.  Minor tweak.
2675         <Attr_Pred>: Likewise.
2676         (Loop_Statement_to_gnu): Likewise.
2677         (Raise_Error_to_gnu): Likewise.
2678         <N_Indexed_Component>: Deal with character index types.  Remove
2679         obsolete code.
2680         <N_Slice>: Likewise.
2681         <N_Type_Conversion>: Deal with character types.  Minor tweak.
2682         <N_Unchecked_Type_Conversion>: Likewise.
2683         <N_In>: Likewise.
2684         <N_Op_Eq>: Likewise.
2685         (emit_index_check): Delete.
2686         * gcc-interface/utils.c (finish_character_type): New function.
2687         (gnat_signed_or_unsigned_type_for): Deal with built-in character types.
2688         * gcc-interface/utils2.c (expand_sloc): Replace unsigned_char_type_node
2689         with char_type_node.
2690         (build_call_raise): Likewise.
2691         (build_call_raise_column): Likewise.
2692         (build_call_raise_range): Likewise.
2694 2016-01-18  Eric Botcazou  <ebotcazou@adacore.com>
2696         * gcc-interface/gigi.h (build_call_raise_column): Adjust prototype.
2697         (build_call_raise_range): Likewise.
2698         (gnat_unsigned_type): Delete.
2699         (gnat_signed_type): Likewise.
2700         (gnat_signed_or_unsigned_type_for): New prototype.
2701         (gnat_unsigned_type_for): New inline function.
2702         (gnat_signed_type_for): Likewise.
2703         * gcc-interface/cuintp.c (build_cst_from_int): Call build_int_cst.
2704         * gcc-interface/decl.c (gnat_to_gnu_entity): Likewise.
2705         (gnat_to_gnu_entity) <E_Array_Type>: Always translate the index types
2706         and compute their base type from that.
2707         <E_Array_Subtype>: Remove duplicate declaration.
2708         * gcc-interface/misc.c (get_array_bit_stride): Call build_int_cst.
2709         * gcc-interface/trans.c (get_type_length): Likewise.
2710         (Attribute_to_gnu): Likewise.
2711         (Loop_Statement_to_gnu): Likewise.
2712         (Call_to_gnu): Likewise.
2713         (gnat_to_gnu): Call build_real, build_int_cst, gnat_unsigned_type_for
2714         and gnat_signed_type_for.  Minor tweaks.
2715         (build_binary_op_trapv): Likewise.
2716         (emit_check): Likewise.
2717         (convert_with_check): Likewise.
2718         (Raise_Error_to_gnu): Adjust calls to the build_call_raise family of
2719         functions.  Minor tweaks.
2720         (Case_Statement_to_gnu): Remove dead code.
2721         (gnat_to_gnu): Call gnat_unsigned_type_for and gnat_signed_type_for.
2722         (init_code_table): Minor reordering.
2723         * gcc-interface/utils.c (gnat_unsigned_type): Delete.
2724         (gnat_signed_type): Likewise.
2725         (gnat_signed_or_unsigned_type_for): New function.
2726         (unchecked_convert): Use directly the size in the test for precision
2727         vs size adjustments.
2728         (install_builtin_elementary_types): Call gnat_signed_type_for.
2729         * gcc-interface/utils2.c (nonbinary_modular_operation): Call
2730         build_int_cst.
2731         (build_goto_raise): New function taken from...
2732         (build_call_raise): ...here.  Call it.
2733         (build_call_raise_column): Add KIND parameter and call it.
2734         (build_call_raise_range): Likewise.
2736 2016-01-18  Eric Botcazou  <ebotcazou@adacore.com>
2738         * gcc-interface/ada-tree.h (TYPE_IMPLEMENTS_PACKED_ARRAY_P): Rename to
2739         (TYPE_IMPL_PACKED_ARRAY_P): ...this.
2740         (TYPE_CAN_HAVE_DEBUG_TYPE_P): Do not test TYPE_DEBUG_TYPE.
2741         * gcc-interface/decl.c (gnat_to_gnu_entity): Simplify NULL_TREE tests
2742         and tweak gnat_encodings tests throughout.
2743         (initial_value_needs_conversion): Likewise.
2744         (intrin_arglists_compatible_p): Likewise.
2745         * gcc-interface/misc.c (gnat_print_type): Likewise.
2746         (gnat_get_debug_type): Likewise.
2747         (gnat_get_fixed_point_type_info): Likewise.
2748         (gnat_get_array_descr_info): Likewise.
2749         (get_array_bit_stride): Likewise.
2750         (gnat_get_type_bias): Fix formatting.
2751         (enumerate_modes): Likewise.
2752         * gcc-interface/trans.c (gnat_to_gnu): Likewise.
2753         (add_decl_expr): Simplify NULL_TREE test.
2754         (end_stmt_group): Likewise.
2755         (build_binary_op_trapv): Fix formatting.
2756         (get_exception_label): Use switch statement.
2757         (init_code_table): Move around.
2758         * gcc-interface/utils.c (global_bindings_p): Simplify NULL_TREE test.
2759         (gnat_poplevel): Likewise.
2760         (gnat_set_type_context): Likewise.
2761         (defer_or_set_type_context): Fix formatting.
2762         (gnat_pushdecl): Simplify NULL_TREE test.
2763         (maybe_pad_type): Likewise.
2764         (add_parallel_type): Likewise.
2765         (create_range_type): Likewise.
2766         (process_deferred_decl_context): Likewise.
2767         (convert): Likewise.
2768         (def_builtin_1): Likewise.
2769         * gcc-interface/utils2.c (find_common_type): Likewise.
2770         (build_binary_op): Likewise.
2771         (gnat_rewrite_reference): Likewise.
2772         (get_inner_constant_reference): Likewise.
2774 2016-01-18  Eric Botcazou  <ebotcazou@adacore.com>
2776         PR ada/69219
2777         * gcc-interface/trans.c (check_inlining_for_nested_subprog): Consider
2778         the parent function instead of the current function in order to issue
2779         the warning or the error.  Add guard for ignored functions.
2781 2016-01-17  Jakub Jelinek  <jakub@redhat.com>
2783         * adaint.c (__gnat_killprocesstree): Avoid -Wparentheses warning.
2785 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
2787         * adaint.c (__gnat_locate_exec_on_path): Use const char * instead
2788         of char * for path_val to avoid warnings.
2790 2016-01-06  Pierre-Marie de Rodat  <derodat@adacore.com>
2792         * gcc-interface/utils.c: Bump copyright year.
2793         (rest_of_record_type_compilation): Add XVE/XVU parallel types to
2794         the current lexical scope.
2796 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
2798         * gnat_ugn.texi: Bump @copying's copyright year.
2799         * gnat_rm.texi: Likewise.
2801 2016-01-02  Eric Botcazou  <ebotcazou@adacore.com>
2803         * gnatvsn.ads: Bump copyright year.
2806 Copyright (C) 2016 Free Software Foundation, Inc.
2808 Copying and distribution of this file, with or without modification,
2809 are permitted in any medium without royalty provided the copyright
2810 notice and this notice are preserved.