OSDN Git Service

5641887a2176764d4c6fcd629c1473701a5eb30c
[pf3gnuchains/gcc-fork.git] / gcc / ada / ChangeLog
1 2007-02-03  Kazu Hirata  <kazu@codesourcery.com>
2
3         * misc.c, utils2.c: Fix comment typos.
4
5 2007-01-24  Roger Sayle  <roger@eyesopen.com>
6
7         * decl.c (gnat_to_gnu_entity): Use TREE_OVERFLOW instead of
8         TREE_CONSTANT_OVERFLOW.
9         (allocatable_size_p, annotate_value): Likewise.
10         * trans.c (gnat_to_gnu): Likewise.
11         * utils.c (unchecked_convert): Likewise.
12         * utils2.c (build_simple_component_ref): Likewise.
13
14 2007-01-23  Richard Guenther  <rguenther@suse.de>
15
16         PR bootstrap/30541
17         * Make-lang.in: Replace invocations of gnatmake with $(GNATMAKE).
18         (gnatboot2): Pass staged GNATMAKE instead of STAGE_PREFIX.
19         (gnatboot3): Likewise.
20         (GNATBIND): Do not define.
21         * Makefile.in (GNATBIND): Do not define.
22
23 2007-01-08  Richard Guenther  <rguenther@suse.de>
24
25         * cuintp.c (build_cst_from_int): Use built_int_cst_type.
26         * trans.c (gnat_to_gnu): Likewise.
27
28 2006-12-07  Geoffrey Keating  <geoffk@apple.com>
29
30         * Makefile.in: Replace CROSS_COMPILE with CROSS_DIRECTORY_STRUCTURE.
31         * adaint.c: Likewise.
32
33 2006-12-05  Aldy Hernandez  <aldyh@redhat.com>
34
35         Merge from gimple-tuples-branch.
36
37         2006-11-02  Aldy Hernandez  <aldyh@redhat.com>
38         * ada-tree.h (lang_tree_node): Handle gimple tuples.
39         * trans.c (gnat_gimplify_expr): Replace MODIFY_EXPR with
40         GIMPLE_MODIFY_STMT.
41
42 2006-12-02  Kazu Hirata  <kazu@codesourcery.com>
43
44         * Makefile.in, mingw32.h, trans.c: Fix comment typos.
45         * gnat_rm.texi, gnat_ugn.texi: Follow spelling conventions.
46         Fix typos.
47
48 2006-11-17  Eric Botcazou  <ebotcazou@adacore.com>
49
50         PR ada/27936
51         * trans.c (add_decl_expr): Do not dynamically elaborate padded objects
52         if the initializer takes into account the padding.
53
54 2006-11-11  Richard Guenther  <rguenther@suse.de>
55
56         * trans.c (maybe_stabilize_reference): Remove handling of
57         FIX_CEIL_EXPR, FIX_FLOOR_EXPR and FIX_ROUND_EXPR.
58
59 2006-11-05  Arnaud Charlet  <charlet@adacore.com>
60
61         * s-osinte-linux-alpha.ads, s-osinte-linux-hppa.ads
62         (To_Target_Priority): New function.
63         Fix PR ada/29707
64
65 2006-10-31  Robert Dewar  <dewar@adacore.com>
66
67         * a-taster.adb, s-traent-vms.adb, a-elchha.ads, a-elchha.adb,
68         a-exctra.adb, ali-util.adb, exp_disp.ads, s-stalib.ads, s-traent.adb,
69         s-addope.ads, s-addope.adb, a-rbtgso.adb, a-crbltr.ads, a-coprnu.adb,
70         a-cgcaso.adb, a-cgarso.adb, a-cgaaso.adb, a-coormu.adb, a-ciormu.adb,
71         a-rbtgso.ads, a-stunha.adb, a-stunha.adb, a-ciorma.adb, a-coorma.adb,
72         a-secain.adb, a-slcain.adb, a-shcain.adb, a-stwiha.adb, a-stwiha.adb,
73         a-strhas.adb, a-strhas.adb, a-stzhas.adb, a-stzhas.adb, a-szuzha.adb,
74         a-chacon.adb, a-chacon.adb, a-chacon.ads, a-stboha.adb, a-swbwha.adb,
75         a-szbzha.adb: Minor reformatting. Fix header.
76
77         * a-numaux-x86.adb: Add parentheses for use of unary minus
78         * a-ngcefu.adb: Supply missing parentheses for unary minus
79         * a-ngcoty.adb: Add parens for use of unary minus
80         * a-ngelfu.adb: Add missing parens for unary minus
81         * a-tifiio.adb: Add parentheses for uses of unary minus
82
83 2006-10-31  Robert Dewar  <dewar@adacore.com>
84             Bob Duff  <duff@adacore.com>
85             Ed Schonberg  <schonberg@adacore.com>
86
87         * sem_res.adb (Resolve_Unary_Op): Add warning for use of unary minus
88         with multiplying operator.
89         (Expected_Type_Is_Any_Real): New function to determine from the Parent
90         pointer whether the context expects "any real type".
91         (Resolve_Arithmetic_Op): Do not give an error on calls to the
92         universal_fixed "*" and "/" operators when they are used in a context
93         that expects any real type. Also set the type of the node to
94         Universal_Real in this case, because downstream processing requires it
95         (mainly static expression evaluation).
96         Reword some continuation messages
97         Add some \\ sequences to continuation messages
98         (Resolve_Call): Refine infinite recursion case. The test has been
99         sharpened to eliminate some false positives.
100         Check for Current_Task usage now includes entry barrier, and is now a
101         warning, not an error.
102         (Resolve): If the call is ambiguous, indicate whether an interpretation
103         is an inherited operation.
104         (Check_Aggr): When resolving aggregates, skip associations with a box,
105         which are priori correct, and will be replaced by an actual default
106         expression in the course of expansion.
107         (Resolve_Type_Conversion): Add missing support for conversion from
108         a class-wide interface to a tagged type. Minor code cleanup.
109         (Valid_Tagged_Converion): Add support for abstact interface type
110         conversions.
111         (Resolve_Selected_Component): Call Generate_Reference here rather than
112         during analysis, and use May_Be_Lvalue to distinguish read/write.
113         (Valid_Array_Conversion): New procedure, abstracted from
114         Valid_Conversion, to incorporate accessibility checks for arrays of
115         anonymous access types.
116         (Valid_Conversion): For a conversion to a numeric type occurring in an
117         instance or inlined body, no need to check that the operand type is
118         numeric, since this has been checked during analysis of the template.
119         Remove legacy test for scope name Unchecked_Conversion.
120
121         * sem_res.ads: Minor reformatting
122
123         * a-except.adb, a-except-2005.adb: Turn off subprogram ordering
124         (PE_Current_Task_In_Entry_Body): New exception code
125         (SE_Restriction_Violation): Removed, not used
126
127         * a-except.ads:  Update comments.
128
129         * types.h, types.ads: Add definition for Validity_Check
130         (PE_Current_Task_In_Entry_Body): New exception code
131         (SE_Restriction_Violation): Removed, not used
132
133 2006-10-31  Thomas Quinot  <quinot@adacore.com>
134
135         * g-socthi-vxworks.adb (C_Gethostbyname): Fix wrong test for returned
136         error status.
137
138 2006-10-31  Hristian Kirtchev  <kirtchev@adacore.com>
139             Jose Ruiz  <ruiz@adacore.com>
140
141         * a-calend-vms.adb (Leap_Sec_Ops): Temp body for package in private
142         part of Ada.Calendar: all subprogram raise Unimplemented.
143         (Split_W_Offset): Temp function body, raising Unimplemented
144
145         * a-calend.ads, a-calend-vms.ads: 
146         Add imported variable Invalid_TZ_Offset used to designate targets unable
147         to support time zones.
148         (Unimplemented): Temporary function raised by the body of new
149         subprograms below.
150         (Leap_Sec_Ops): New package in the private part of Ada.Calendar. This
151         unit provides handling of leap seconds and is used by the new Ada 2005
152         packages Ada.Calendar.Arithmetic and Ada.Calendar.Formatting.
153         (Split_W_Offset): Identical spec to that of Ada.Calendar.Split. This
154         version returns an extra value which is the offset to UTC.
155
156         * a-calend.adb (Split_W_Offset): Add call to localtime_tzoff.
157         (Leap_Sec_Ops): New body for package in private part of Ada.Calendar.
158         (Split_W_Offset): New function body.
159         (Time_Of): When a date is close to UNIX epoch, compute the time for
160         that date plus one day (that amount is later substracted after
161         executing mktime) so there are no problems with time zone adjustments.
162
163         * a-calend-mingw.adb: Remove Windows specific version no longer needed.
164
165         * a-calari.ads, a-calari.adb, a-calfor.ads, a-calfor.adb,
166         a-catizo.ads, a-catizo.adb: New files.
167
168         * impunit.adb: Add new Ada 2005 entries
169
170         * sysdep.c: Add external variable __gnat_invalid_tz_offset.
171         Rename all occurences of "__gnat_localtime_r" to
172         "__gnat_localtime_tzoff".
173         (__gnat_localtime_tzoff for Windows): Add logic to retrieve the time
174         zone data and calculate the GMT offset.
175         (__gnat_localtime_tzoff for Darwin, Free BSD, Linux, Lynx and Tru64):
176         Use the field "tm_gmtoff" to extract the GMT offset.
177         (__gnat_localtime_tzoff for AIX, HPUX, SGI Irix and Sun Solaris): Use
178         the external variable "timezone" to calculate the GMT offset.
179
180 2006-10-31  Arnaud Charlet  <charlet@adacore.com>
181             Jose Ruiz  <ruiz@adacore.com>
182
183         * s-osinte-posix.adb, s-osinte-linux.ads, s-osinte-freebsd.adb, 
184         s-osinte-freebsd.ads, s-osinte-solaris-posix.ads, s-osinte-hpux.ads, 
185         s-osinte-darwin.adb, s-osinte-darwin.ads, s-osinte-lynxos-3.ads,
186         s-osinte-lynxos-3.adb (To_Target_Priority): New function maps from
187         System.Any_Priority to a POSIX priority on the target.
188
189         * system-linux-ia64.ads: 
190         Extend range of Priority types on Linux to use the whole range made
191         available by the system.
192
193         * s-osinte-aix.adb, s-osinte-aix.ads (To_Target_Priority): New
194         function maps from System.Any_Priority to a POSIX priority on the
195         target.
196         (PTHREAD_PRIO_PROTECT): Set real value.
197         (PTHREAD_PRIO_INHERIT): Now a function.
198         (SIGCPUFAIL): New signal.
199         (Reserved): Add SIGALRM1, SIGWAITING, SIGCPUFAIL, since these signals
200         are documented as reserved by the OS.
201
202         * system-aix.ads: Use the full range of priorities provided by the
203         system on AIX.
204
205         * s-taprop-posix.adb: Call new function To_Target_Priority.
206         (Set_Priority): Take into account Task_Dispatching_Policy and
207         Priority_Specific_Dispatching pragmas when determining if Round Robin
208         must be used for scheduling the task.
209
210         * system-linux-x86_64.ads, system-linux-x86.ads, 
211         system-linux-ppc.ads: Extend range of Priority types on Linux to use
212         the whole range made available by the system.
213
214         * s-taprop-vms.adb, s-taprop-mingw.adb, s-taprop-irix.adb, 
215         s-taprop-tru64.adb, s-taprop-linux.adb, s-taprop-hpux-dce.adb, 
216         s-taprop-lynxos.adb (Finalize_TCB): invalidate the stack-check cache
217         when deallocating the TCB in order to avoid potential references to
218         deallocated data.
219         (Set_Priority): Take into account Task_Dispatching_Policy and
220         Priority_Specific_Dispatching pragmas when determining if Round Robin
221         or FIFO within priorities must be used for scheduling the task.
222
223         * s-taprop-vxworks.adb (Enter_Task): Store the user-level task id in
224         the Thread field (to be used internally by the run-time system) and the
225         kernel-level task id in the LWP field (to be used by the debugger).
226         (Create_Task): Reorganize to unify the calls to taskSpawn into a single
227         instance, and propagate the current task options to the spawned task.
228         (Set_Priority): Take into account Priority_Specific_Dispatching pragmas.
229         (Initialize): Set Round Robin dispatching when the corresponding pragma
230         is in effect.
231
232 2006-10-31  Robert Dewar  <dewar@adacore.com>
233
234         * system-vms_64.ads, system-darwin-ppc.ads, system-vxworks-x86.ads, 
235         system-linux-hppa.ads, system-hpux-ia64.ads, 
236         system-lynxos-ppc.ads, system-lynxos-x86.ads, system-tru64.ads, 
237         system-vxworks-sparcv9.ads, system-solaris-x86.ads, 
238         system-irix-o32.ads, system-irix-n32.ads, system-hpux.ads, 
239         system-vxworks-m68k.ads, system-vxworks-mips.ads, system-interix.ads, 
240         system-solaris-sparc.ads, system-solaris-sparcv9.ads, system-vms.ads, 
241         system-mingw.ads, system-vms-zcx.ads, system-vxworks-ppc.ads, 
242         system-vxworks-alpha.ads, system.ads: Add pragma Warnings(Off,
243         Default_Bit_Order) to kill constant condition warnings for references
244         to this switch.
245
246 2006-10-31  Vincent Celier  <celier@adacore.com>
247             Eric Botcazou  <ebotcazou@adacore.com>
248
249         * mlib-tgt-lynxos.adb, mlib-tgt-mingw.adb, mlib-tgt-tru64.adb,
250         mlib-tgt-aix.adb, mlib-tgt-irix.adb, mlib-tgt-hpux.adb,
251         mlib-tgt-linux.adb, mlib-tgt-solaris.adb: Use Append_To, instead of
252         Ext_To, when building the library file name
253
254         * mlib-tgt-vxworks.adb: ditto.
255         (Get_Target_Suffix): Add support for x86 targets.
256
257         * mlib-fil.ads, mlib-fil.adb: (Append_To): New function
258
259         * mlib-tgt-darwin.adb: 
260         Use Append_To, instead of Ext_To, when building the library file name
261         (Flat_Namespace): New global variable.
262         (No_Shared_Libgcc_Switch): Rename to No_Shared_Libgcc_Options.
263         (Shared_Libgcc_Switch): Rename to With_Shared_Libgcc_Options.
264         (Link_Shared_Libgcc): Delete.
265         (Build_Dynamic_Library): Adjust for above changes.
266         Use Opt package.
267         (Build_Dynamic_Library): Pass -shared-libgcc if GCC 4 or later.
268
269 2006-10-31  Eric Botcazou  <ebotcazou@adacore.com>
270
271         * s-taprop-solaris.adb: (Time_Slice_Val): Change type to Integer.
272         (Initialize): Add type conversions required by above change.
273
274 2006-10-31  Jose Ruiz  <ruiz@adacore.com>
275
276         * s-osinte-vxworks.ads, s-osinte-vxworks.adb: 
277         (getpid): New body for this function that uses the underlying taskIdSelf
278         function for VxWorks 5 and VxWorks 6 in kernel mode.
279         (unsigned_int): New type, modular to allow logical bit operations.
280         (taskOptionsGet): New imported function.
281
282         * s-taspri-vxworks.ads (Private_Data): Change the type for the LWP
283         field to be compliant with the type used by the corresponding operating
284         system primitive.
285
286 2006-10-31  Pascal Obry  <obry@adacore.com>
287             Eric Botcazou  <ebotcazou@adacore.com>
288             Vincent Celier  <celier@adacore.com>
289
290         * adaint.c (__gnat_get_libraries_from_registry): Call explicitly the
291         ASCII version of the registry API. This is needed as the GNAT runtime
292         is now UNICODE by default.
293         Include version.h.
294         (get_gcc_version): Do not hardcode the return value.
295         (__gnat_file_time_name): On Windows properly set the default returned
296         value to -1 which corresponds to Invalid_Time.
297         (__gnat_fopen): New routine. A simple wrapper on all plateforms
298          except on Windows where it does conversion for unicode support.
299         (__gnat_freopen): Idem.
300         (__gnat_locate_exec_on_path): If environment variable PATH does not
301         exist, return a NULL pointer
302
303         * adaint.h: (__gnat_fopen): Declare.
304         (__gnat_freopen): Likewise.
305
306         * mingw32.h (_tfreopen): Define this macro here for older MingW
307         version.
308         Activate the unicode support on platforms using a MingW runtime
309         version 3.9 or newer.
310
311         * s-crtl.ads (fopen): Is now an import to the wrapper __gnat_freopen.
312         This is needed for proper unicode support on Windows.
313         (freopen): Idem.
314
315 2006-10-31  Eric Botcazou  <ebotcazou@adacore.com>
316             Nicolas Setton  <setton@adacore.com>
317             Olivier Hainque  <hainque@adacore.com>
318             Gary Dismukes  <dismukes@adacore.com>
319
320         * gigi.h: (tree_code_for_record_type): Declare.
321         (add_global_renaming_pointer): Rename to record_global_renaming_pointer.
322         (get_global_renaming_pointers): Rename to
323         invalidate_global_renaming_pointers.
324         (static_ctors): Delete.
325         (static_dtors): Likewise.
326         (gnat_write_global_declarations): Declare.
327         (create_var_decl): Adjust descriptive comment to indicate that the
328         subprogram may return a CONST_DECL node.
329         (create_true_var_decl): Declare new function, similar to
330         create_var_decl but forcing the creation of a VAR_DECL node.
331         (get_global_renaming_pointers): Declare.
332         (add_global_renaming_pointer): Likewise.
333
334         * ada-tree.h (DECL_READONLY_ONCE_ELAB): New macro.
335
336         * decl.c (gnat_to_gnu_entity) <case E_Function>: Don't copy the type
337         tree before setting TREE_ADDRESSABLE for by-reference return mechanism
338         processing.
339         (gnat_to_gnu_entity): Remove From_With_Type from computation for
340         imported_p.
341         <E_Access_Type>: Use the Non_Limited_View as the full view of the
342         designated type if the pointer comes from a limited_with clause.  Make
343         incomplete designated type if it is in the main unit and has a freeze
344         node.
345         <E_Incomplete_Type>: Rework to treat Non_Limited_View, Full_View, and
346         Underlying_Full_View similarly.  Return earlier if the full view already
347         has an associated tree.
348         (gnat_to_gnu_entity) <E_Record_Type>: Restore comment.
349         (gnat_to_gnu_entity) <E_Record_Type>: Do not use a dummy type.
350         (gnat_to_gnu_entity) <E_Variable>: Set TYPE_REF_CAN_ALIAS_ALL on the
351         reference type built for objects with an address clause.
352         Use create_true_var_decl with const_flag set for
353         DECL_CONST_CORRESPONDING_VARs, ensuring a VAR_DECL is created with
354         TREE_READONLY set.
355         (gnat_to_gnu_entity, case E_Enumeration_Type): Set TYPE_NAME
356         for Character and Wide_Character types. This info is read by the
357         dwarf-2 writer, and is needed to be able to use the command "ptype
358         character" in the debugger.
359         (gnat_to_gnu_entity): When generating a type representing
360         a Character or Wide_Character type, set the flag TYPE_STRING_FLAG,
361         so that debug writers can distinguish it from ordinary integers.
362         (elaborate_expression_1): Test the DECL_READONLY_ONCE_ELAB flag in
363         addition to TREE_READONLY to assert the constantness of variables for
364         elaboration purposes.
365         (gnat_to_gnu_entity, subprogram cases): Change loops on formal
366         parameters to call new Einfo function First_Formal_With_Extras.
367         (gnat_to_gnu_entity): In type_annotate mode, replace a discriminant of a
368         protected type with its corresponding discriminant, to obtain a usable
369         declaration
370         (gnat_to_gnu_entity) <E_Access_Protected_Subprogram_Type>: Be prepared
371         for a multiple elaboration of the "equivalent" type.
372         (gnat_to_gnu_entity): Adjust for renaming of add_global_renaming_pointer
373         into record_global_renaming_pointer.
374         (gnat_to_gnu_entity) <E_Array_Type>: Do not force
375         TYPE_NONALIASED_COMPONENT to 0 if the element type is an aggregate.
376         <E_Array_Subtype>: Likewise.
377         (gnat_to_gnu_entity) <E_Incomplete_Subtype>: Add support for regular
378         incomplete subtypes and incomplete subtypes of incomplete types visible
379         through a limited with clause.
380         (gnat_to_gnu_entity) <E_Array_Subtype>: Take into account the bounds of
381         the base index type for the maximum size of the array only if they are
382         constant.
383         (gnat_to_gnu_entity, renaming object case): Do not wrap up the
384         expression into a SAVE_EXPR if stabilization failed.
385
386         * utils.c (create_subprog_decl): Turn TREE_ADDRESSABLE on the type of
387         a result decl into DECL_BY_REFERENCE on this decl, now what is expected
388         by lower level compilation passes.
389         (gnat_genericize): New function, lowering a function body to GENERIC.
390         Turn the type of RESULT_DECL into a real reference type if the decl
391         has been marked DECL_BY_REFERENCE, and adjust references to the latter
392         accordingly.
393         (gnat_genericize_r): New function. Tree walking callback for
394         gnat_genericize.
395         (convert_from_reference, is_byref_result): New functions. Helpers for
396         gnat_genericize_r.
397         (create_type_decl): Call gnat_pushdecl before calling
398         rest_of_decl_compilation, to make sure that field TYPE_NAME of
399         type_decl is properly set before calling the debug information writers.
400         (write_record_type_debug_info): The heuristics which compute the
401         alignment of a field in a variant record might not be accurate. Add a
402         safety test to make sure no alignment is set to a smaller value than
403         the alignment of the field type.
404         (make_dummy_type): Use the Non_Limited_View as the underlying type if
405         the type comes from a limited_with clause. Do not loop on the full view.
406         (GET_GNU_TREE, SET_GNU_TREE, PRESENT_GNU_TREE): New macros.
407         (dummy_node_table): New global variable, moved from decl.c.
408         (GET_DUMMY_NODE, SET_DUMMY_NODE, PRESENT_DUMMY_NODE): New macros.
409         (save_gnu_tree): Use above macros.
410         (get_gnu_tree): Likewise.
411         (present_gnu_tree): Likewise.
412         (init_dummy_type): New function, moved from decl.c. Use above macros.
413         (make_dummy_type): Likewise.
414         (tree_code_for_record_type): New function extracted from make_dummy_type
415         (init_gigi_decls): Set DECL_IS_MALLOC on gnat_malloc.
416         (static_ctors): Change it to a vector, make static.
417         (static_dtors): Likewise.
418         (end_subprog_body): Adjust for above change.
419         (build_global_cdtor): Moved from trans.c.
420         (gnat_write_global_declarations): Emit global constructor and
421         destructor, and call cgraph_optimize before emitting debug info for
422         global declarations.
423         (global_decls): New global variable.
424         (gnat_pushdecl): Store the global declarations in global_decls, for
425         later use.
426         (gnat_write_global_declarations): Emit debug information for global
427          declarations.
428         (create_var_decl_1): Former create_var_decl, with an extra argument to
429          state whether the creation of a CONST_DECL is allowed.
430         (create_var_decl): Behavior unchanged. Now a wrapper around
431         create_var_decl_1 allowing CONST_DECL creation.
432         (create_true_var_decl): New function, similar to create_var_decl but
433         forcing the creation of a VAR_DECL node (CONST_DECL not allowed).
434         (create_field_decl): Do not always mark the field as addressable
435         if its type is an aggregate.
436         (global_renaming_pointers): New static variable.
437         (add_global_renaming_pointer): New function.
438         (get_global_renaming_pointers): Likewise.
439
440         * misc.c (gnat_dwarf_name): New function.
441         (LANG_HOOKS_DWARF_NAME): Define to gnat_dwarf_name.
442         (gnat_post_options): Add comment about structural alias analysis.
443         (gnat_parse_file): Do not call cgraph_optimize here.
444         (LANG_HOOKS_WRITE_GLOBALS): Define to gnat_write_global_declarations.
445
446         * trans.c (process_freeze_entity): Don't abort if we already have a
447         non dummy GCC tree for a Concurrent_Record_Type, as it might
448         legitimately have been elaborated while processing the associated
449         Concurrent_Type prior to this explicit freeze node.
450         (Identifier_to_gnu): Do not make a variable referenced in a SJLJ
451         exception handler volatile if it is of variable size.
452         (process_type): Remove bypass for types coming from a limited_with
453         clause.
454         (call_to_gnu): When processing the copy-out of a N_Type_Conversion GNAT
455         actual, convert the corresponding gnu_actual to the real destination
456         type when necessary.
457         (add_decl_expr): Set the DECL_READONLY_ONCE_ELAB flag on variables
458         originally TREE_READONLY but whose elaboration cannot be performed
459         statically.
460         Part of fix for F504-021.
461         (tree_transform, subprogram cases): Change loops on formal parameters to
462         call new Einfo function First_Formal_With_Extras.
463         (gnat_to_gnu) <N_Op_Shift_Right_Arithmetic>: Ignore constant overflow
464         stemming from type conversion for the lhs.
465         (Attribute_to_gnu) <Attr_Alignment>: Also divide the alignment by the
466         number of bits per unit for components of records.
467         (gnat_to_gnu) <N_Code_Statement>: Mark operands addressable if needed.
468         (Handled_Sequence_Of_Statements_to_gnu): Register the cleanup associated
469         with At_End_Proc after the SJLJ EH cleanup.
470         (Compilation_Unit_to_gnu): Call elaborate_all_entities only on the main
471         compilation unit.
472         (elaborate_all_entities): Do not retest type_annotate_only.
473         (tree_transform) <N_Abstract_Subprogram_Declaration>: Process the
474         result type of an abstract subprogram, which may be an itype associated
475         with an anonymous access result (related to AI-318-02).
476         (build_global_cdtor): Move to utils.c.
477         (Case_Statement_to_gnu): Avoid adding the choice of a when statement if
478         this choice is not a null tree nor an integer constant.
479         (gigi): Run unshare_save_expr via walk_tree_without_duplicates
480         on the body of elaboration routines instead of mark_unvisited.
481         (add_stmt): Do not mark the tree.
482         (add_decl_expr): Tweak comment.
483         (mark_unvisited): Delete.
484         (unshare_save_expr): New static function.
485         (call_to_gnu): Issue an error when making a temporary around a
486         procedure call because of non-addressable actual parameter if the
487         type of the formal is by_reference.
488         (Compilation_Unit_to_gnu): Invalidate the global renaming pointers
489         after building the elaboration routine.
490
491 2006-10-31  Bob Duff  <duff@adacore.com>
492
493         * a-filico.adb (Finalize(List_Controller)): Mark the finalization list
494         as finalization-started, so we can raise Program_Error on 'new'.
495
496         * s-finimp.adb: Raise Program_Error on 'new' if finalization of the
497         collection has already started.
498
499         * s-finimp.ads (Collection_Finalization_Started): Added new special
500         flag value for indicating that a collection's finalization has started.
501
502         * s-tassta.adb (Create_Task): Raise Program_Error on an attempt to
503         create a task whose master has already waited for dependent tasks.
504
505 2006-10-31  Robert Dewar  <dewar@adacore.com>
506
507         * lib.adb, lib.ads: (In_Predefined_Unit): New functions
508
509         * a-finali.ads, a-ngcoty.ads, a-strbou.ads, a-stream.ads, a-strmap.ads, 
510         a-strunb.ads, a-stwibo.ads, a-stwima.ads, a-stwiun.ads, a-taside.ads, 
511         a-coorse.ads, a-convec.ads, a-coinve.ads, a-cohama.ads, a-ciorse.ads, 
512         a-cihama.ads, a-cihase.ads, a-cohase.ads, a-ciorma.ads, a-coorma.ads, 
513         a-ciormu.ads, a-coormu.ads, a-stzbou.ads, a-stzmap.ads, a-stzunb.ads, 
514         a-except-2005.ads: Add pragma Preelaborable_Warning
515
516 2006-10-31  Robert Dewar  <dewar@adacore.com>
517             Jose Ruiz  <ruiz@adacore.com>
518
519         * a-dispat.ads, a-dispat.adb, a-diroro.ads, a-diroro.adb: New files.
520
521         * ali.adb (Get_Name): Properly handle scanning of wide character names
522         encoded with brackets notation.
523         (Known_ALI_Lines): Add S lines to this list.
524         (Scan_ALI): Acquire S (priority specific dispatching) lines.
525         New flag Elaborate_All_Desirable in unit table
526
527         * ali.ads (Priority_Specific_Dispatching): Add this range of
528         identifiers to be used for Priority_Specific_Dispatching table entries.
529         (ALIs_Record): Add First_Specific_Dispatching and
530         Last_Specific_Dispatching that point to the first and last entries
531         respectively in the priority specific dispatching table for this unit.
532         (Specific_Dispatching): Add this table for storing each S (priority
533         specific dispatching) line encountered in the input ALI file.
534         New flag Elaborate_All_Desirable in unit table
535
536         * bcheck.adb: (Check_Configuration_Consistency): Add call to
537         Check_Consistent_Dispatching_Policy.
538         (Check_Consistent_Dispatching_Policy): Add this procedure in charge of
539         verifying that the use of Priority_Specific_Dispatching,
540         Task_Dispatching_Policy, and Locking_Policy is consistent across the
541         partition.
542
543         * bindgen.adb: (Public_Version_Warning): function removed.
544         (Set_PSD_Pragma_Table): Add this procedure in charge of getting the
545         required information from ALI files in order to initialize the table
546         containing the specific dispatching policy.
547         (Gen_Adainit_Ada): Generate the variables required for priority specific
548         dispatching entries (__gl_priority_specific_dispatching and
549         __gl_num_specific_dispatching).
550         (Gen_Adainit_C): Generate the variables required for priority specific
551         dispatching entries (__gl_priority_specific_dispatching and
552         __gl_num_specific_dispatching).
553         (Gen_Output_File): Acquire settings for Priority_Specific_Dispatching
554         pragma entries.
555         (Gen_Restrictions_String_1, Gen_Restrictions_String_2): Removed.
556         (Gen_Restrictions_Ada, Gen_Restrictions_C, Set_Boolean): New procedures.
557         (Tab_To): Removed.
558         (Gen_Output_File_Ada/_C): Set directly __gl_xxx variables instead of
559         a call to gnat_set_globals.
560         Generate a string containing settings from
561         Priority_Specific_Dispatching pragma entries.
562         (Gen_Object_Files_Options): Do not include the runtime libraries when
563         pragma No_Run_Time is specified.
564
565         * init.c (__gnat_install_handler, case FreeBSD): Use SA_SIGINFO, for
566         consistency with s-intman-posix.adb.
567         (__gnat_error_handler, case FreeBSD): Account for the fact that the
568         handler is installed with SA_SIGINFO.
569         (__gnat_adjust_context_for_raise, FreeBSD case): New function for
570         FreeBSD ZCX support, copied from Linux version.
571         Add MaRTE-specific definitions for the linux target. Redefine sigaction,
572         sigfillset, and sigemptyset so the routines defined by MaRTE.
573         (__gl_priority_specific_dispatching): Add this variable that stores the
574         string containing priority specific dispatching policies in the
575         partition.
576         (__gl_num_specific_dispatching): Add this variable that indicates the
577         highest priority for which a priority specific dispatching pragma
578         applies.
579         (__gnat_get_specific_dispatching): Add this routine that returns the
580         priority specific dispatching policy, as set by a
581         Priority_Specific_Dispatching pragma appearing anywhere in the current
582         partition. The input argument is the priority number, and the result
583         is the upper case first character of the policy name.
584         (__gnat_set_globals): Now a dummy function.
585         (__gnat_handle_vms_condition): Feed adjust_context_for_raise with
586         mechargs instead of sigargs, as the latter can be retrieved from the
587         former and sigargs is not what we want on ia64.
588         (__gnat_adjust_context_for_raise, alpha-vms): Fetch sigargs from the
589         mechargs argument.
590         (__gnat_adjust_context_for_raise, ia64-vms): New function.
591         (tasking_error): Remove unused symbol.
592         (_abort_signal): Move this symbol to the IRIX specific part since this
593         is the only target that uses this definition.
594         (Check_Abort_Status): Move this symbol to the IRIX specific part since
595         this is the only target that uses this definition.
596         (Lock_Task): Remove unused symbol.
597         (Unlock_Task): Remove unused symbol.
598
599         * lib-writ.adb (Write_ALI): Output new S lines for
600         Priority_Specific_Dispatching pragmas.
601         Implement new flag BD for elaborate body desirable
602
603         * lib-writ.ads: Document S lines for Priority Specific Dispatching.
604         (Specific_Dispatching): Add this table for storing the entries
605         corresponding to Priority_Specific_Dispatching pragmas.
606         Document new BD flag for elaborate body desirable
607
608         * par-prag.adb (Prag): Add Priority_Specific_Dispatching to the list
609         of known pragmas.
610
611 2006-10-31  Javier Miranda  <miranda@adacore.com>
612
613         * a-tags.ads, a-tags.adb: 
614         (Predefined_DT): New function that improves readability of the code.
615         (Get_Predefined_Prim_Op_Address, Set_Predefined_Prim_Op_Address,
616         Inherit_DT): Use the new function Predefined_DT to improve code
617         readability.
618         (Register_Interface_Tag): Update assertion.
619         (Set_Interface_Table): Update assertion.
620         (Interface_Ancestor_Tags): New subprogram required to implement AI-405:
621         determining progenitor interfaces in Tags.
622         (Inherit_CPP_DT): New subprogram.
623
624         * exp_disp.adb (Expand_Interface_Thunk): Suppress checks during the
625         analysis of the thunk code.
626         (Expand_Interface_Conversion): Handle run-time conversion of
627         access to class wide types.
628         (Expand_Dispatching_Call): When generating the profile for the
629         subprogram itype for a dispatching operation, properly terminate the
630         formal parameters chaind list (set the Next_Entity of the last formal
631         to Empty).
632         (Collect_All_Interfaces): Removed. This routine has been moved to
633         sem_util and renamed as Collect_All_Abstract_Interfaces.
634         (Set_All_DT_Position): Hidden entities associated with abstract
635         interface primitives are not taken into account in the check for
636         3.9.3(10); this check is done with the aliased entity.
637         (Make_DT, Set_All_DT_Position): Enable full ABI compatibility for
638         interfacing with CPP by default.
639         (Expand_Interface_Conversion): Add missing support for static conversion
640         from an interface to a tagged type.
641         (Collect_All_Interfaces): Add new out formal containing the list of
642         abstract interface types to cleanup the subprogram Make_DT.
643         (Make_DT): Update the code to generate the table of interfaces in case
644         of abstract interface types.
645         (Is_Predefined_Dispatching_Alias): New function that returns true if
646         a primitive is not a predefined dispatching primitive but it is an
647         alias of a predefined dispatching primitive.
648         (Make_DT): If the ancestor of the type is a CPP_Class and we are
649         compiling under full ABI compatibility mode we avoid the generation of
650         calls to run-time services that fill the dispatch tables because under
651         this mode we currently inherit the dispatch tables in the IP subprogram.
652         (Write_DT): Emit an "is null" indication for a null procedure primitive.
653         (Expand_Interface_Conversion): Use an address as the type of the formal
654         of the internally built function that handles the case in which the
655         target type is an access type.
656
657 2006-10-31  Robert Dewar  <dewar@adacore.com>
658
659         * binde.adb (Better_Choice, Worse_Choice): Implement new preferences.
660
661 2006-10-31  Robert Dewar  <dewar@adacore.com>
662
663         * bindusg.ads, bindusg.adb:
664         Change to package and rename procedure as Display, which
665         now ensures that it only outputs usage information once.
666
667 2006-10-31  Jose Ruiz  <ruiz@adacore.com>
668
669         * cal.c: Use the header sys/time.h for VxWorks 6.2 or greater when
670         using RTPs.
671
672         * mkdir.c: Use a different version of mkdir for VxWorks 6.2 or greater
673         when using RTPs.
674
675 2006-10-31  Robert Dewar  <dewar@adacore.com>
676             Ed Schonberg  <schonberg@adacore.com>
677
678         * treepr.adb: Use new subtype N_Membership_Test
679
680         * checks.ads, checks.adb: Add definition for Validity_Check
681         (Range_Or_Validity_Checks_Suppressed): New function
682         (Ensure_Valid): Test Validity_Check suppressed
683         (Insert_Valid_Check): Test Validity_Check suppressed
684         (Insert_Valid_Check): Preserve Do_Range_Check flag
685         (Validity_Check_Range): New procedure
686         (Expr_Known_Valid): Result of membership test is always valid
687         (Selected_Range_Checks): Range checks cannot be applied to discriminants
688         by themselves. Disabling those checks must also be done for task types,
689         where discriminants may be used for the bounds of entry families.
690         (Apply_Address_Clause_Check): Remove side-effects if address expression
691         is non-static and is not the name of a declared constant.
692         (Null_Exclusion_Static_Checks): Extend to handle Function_Specification.
693         Code cleanup and new error messages.
694         (Enable_Range_Check): Test for some cases of suppressed checks
695         (Generate_Index_Checks): Suppress index checks if index checks are
696         suppressed for array object or array type.
697         (Apply_Selected_Length_Checks): Give warning for compile-time detected
698         length check failure, even if checks are off.
699         (Ensure_Valid): Do not generate a check on an indexed component whose
700         prefix is a packed boolean array.
701         * checks.adb: (Alignment_Checks_Suppressed): New function
702         (Apply_Address_Clause_Check): New procedure, this is a completely
703         rewritten replacement for Apply_Alignment_Check
704         (Get_E_Length/Get_E_First_Or_Last): Add missing barrier to ensure that
705         we request a discriminal value only in case of discriminants.
706         (Apply_Discriminant_Check): For Ada_05, only call Get_Actual_Subtype for
707         assignments where the target subtype is unconstrained and the target
708         object is a parameter or dereference (other aliased cases are known
709         to be unconstrained).
710
711 2006-10-31  Robert Dewar  <dewar@adacore.com>
712
713         * clean.adb, gnatname.adb, gnatsym.adb, prep.adb, prep.ads,
714         prepcomp.adb, prj.ads, prj-strt.adb, sem_maps.ads,
715         vms_conv.adb: Fix bad table increment values (much too small)
716
717         * table.adb (Realloc): Make sure we get at least some new elements
718         Defends against silly small values for table increment
719
720 2006-10-31  Robert Dewar  <dewar@adacore.com>
721             Ed Schonberg  <schonberg@adacore.com>
722             Bob Duff  <duff@adacore.com>
723
724         * einfo.ads, einfo.adb (Obsolescent_Warning): Now defined on all
725         entities. Move other fields around to make this possible
726         (Is_Derived_Type): Add missing call to Is_Type.
727         (Extra_Formals): New function for subprograms, entries, subprogram
728         types.
729         (Set_Extra_Formals): New procedure for subprograms, entries, subp types.
730         (First_Formal_With_Extras): New function for subprogs, entries, subp
731         types.
732         (Write_Field28_Name): New procedure for node display of "Extra_Formals".
733         Add node information for E_Return_Statement.
734         (Elaborate_Body_Desirable): New flag
735         (Is_Return_By_Reference_Type): Rename Is_Return_By_Reference_Type
736         to be Is_Inherently_Limited_Type, because return-by-reference has
737         no meaning in Ada 2005.
738         (E_Return_Statement): New entity kind.
739         (Return_Applies_To): Field of E_Return_Statement.
740         (Is_Return_Object): New flag in object entities.
741         (Is_Dynamic_Scope): Make it True for E_Return_Statement.
742         (Must_Have_Preelab_Init): New flag
743         (Known_To_Have_Preelab_Init): New flag
744         (Is_Formal_Object): Move from Sem_Ch8 body to Einfo
745         (Is_Visible_Formal): New flag on entities in formal packages.
746         (Low_Bound_Known): New flag
747         (Non_Limited_View, Set_Non_Limited_View): Add membership test agains
748         Incomplete_Kind.
749         (Write_Field17_Name): Correct spelling of Non_Limited_View. Add name
750         output when Id is an incomplete subtype.
751
752 2006-10-31  Robert Dewar  <dewar@adacore.com>
753
754         * errout.ads, errout.adb (Finalize): Implement switch -gnatd.m
755         Avoid abbreviation Creat
756         (Finalize): List all sources in extended mail source if -gnatl
757         switch is active.
758         Suppress copyright notice to file in -gnatl=f mode if -gnatd7 set
759         (Finalize): Implement new -gnatl=xxx switch to output listing to file
760         (Set_Specific_Warning_On): New procedure
761         (Set_Specific_Warning_Off): New procedure
762         Add implementation of new insertion \\
763         (Error_Msg_Internal): Add handling for Error_Msg_Line_Length
764         (Unwind_Internal_Type): Improve report on anonymous access_to_subprogram
765         types.
766         (Error_Msg_Internal): Make sure that we set Last_Killed to
767         True when a message from another package is suppressed.
768         Implement insertion character ~ (insert string)
769         (First_Node): Minor adjustments to get better placement.
770
771         * frontend.adb: 
772         Implement new -gnatl=xxx switch to output listing to file
773
774         * gnat1drv.adb: 
775         Implement new -gnatl=xxx switch to output listing to file
776
777         * opt.ads: (Warn_On_Questionable_Missing_Paren): New switch
778         (Commands_To_Stdout): New flag
779         Implement new -gnatl=xxx switch to output listing to file
780         New switch Dump_Source_Text
781         (Warn_On_Deleted_Code): New warning flag for -gnatwt
782         Define Error_Msg_Line_Length
783         (Warn_On_Assumed_Low_Bound): New switch
784
785         * osint.ads, osint.adb
786         (Normalize_Directory_Name): Fix bug.
787         Implement new -gnatl=xxx switch to output listing to file
788         (Concat): Removed, replaced by real concatenation
789         Make use of concatenation now allowed in compiler
790         (Executable_Prefix.Get_Install_Dir): First get the full path, so that
791         we find the 'lib' or 'bin' directory even when the tool has been
792         invoked with a relative path.
793         (Executable_Name): New function taking string parameters.
794
795         * osint-c.ads, osint-c.adb: 
796         Implement new -gnatl=xxx switch to output listing to file
797
798         * sinput-d.adb: Change name Creat_Debug_File to Create_Debug_File
799
800         * switch-c.adb: 
801         Implement new -gnatl=xxx switch to output listing to file
802         Recognize new -gnatL switch
803         (no longer keep in old warning about old style usage)
804         Use concatenation to simplify code
805         Recognize -gnatjnn switch
806         (Scan_Front_End_Switches): Clean up handling of -gnatW
807         (Scan_Front_End_Switches): Include Warn_On_Assumed_Low_Bound for -gnatg
808
809 2006-10-31  Robert Dewar  <dewar@adacore.com>
810
811         * erroutc.ads, erroutc.adb (Set_Specific_Warning_On): New procedure
812         (Set_Specific_Warning_Off): New procedure
813         (Warning_Specifically_Suppressed): New function
814         (Validate_Specific_Warnings): New procedure
815         (Output_Msg_Text): Complete rewrite to support -gnatjnn
816
817         * err_vars.ads: Implement insertion character ~ (insert string)
818
819 2006-10-31  Bob Duff  <duff@adacore.com>
820             Ed Schonberg  <schonberg@adacore.com>
821
822         * exp_aggr.adb (Build_Record_Aggr_Code): For extension aggregates, if
823         the parent part is a build-in-place function call, generate assignments.
824         (Expand_Record_Aggregate): Call Convert_To_Assignments if any components
825         are build-in-place function calls.
826         (Replace_Self_Reference): New subsidiary of
827         Make_OK_Assignment_Statement, to replace an access attribute that is a
828         self-reference into an access to the appropriate component of the
829         target object. Generalizes previous mechanism to handle self-references
830         nested at any level.
831         (Is_Self_Referential_Init): Remove, not needed.
832         (Is_Self_Referential_Init): New predicate to simplify handling of self
833         referential components in record aggregates.
834         (Has_Default_Init_Comps, Make_OK_Assignment_Statement): Add guard to
835         check for presence of entity before checking for self-reference.
836         (Has_Default_Init_Comps): Return True if a component association is a
837         self-reference to the enclosing type, which can only come from a
838         default initialization.
839         (Make_OK_Assignment_Statement): If the expression is of the form
840         Typ'Acc, where Acc is an access attribute, the expression comes from a
841         default initialized self-referential component.
842         (Build_Record_Aggr_Code): If the type of the aggregate is a tagged type
843         that has been derived from several abstract interfaces we must also
844         initialize the tags of the secondary dispatch tables.
845
846 2006-10-31  Ed Schonberg  <schonberg@adacore.com>
847             Thomas Quinot  <quinot@adacore.com>
848             Javier Miranda  <miranda@adacore.com>
849             Robert Dewar  <dewar@adacore.com>
850         
851         * exp_attr.adb: 
852         (Expand_Access_To_Protected_Op): If the context indicates that an access
853         to a local operation may be transfered outside of the object, create an
854         access to the wrapper operation that must be used in an external call.
855         (Expand_N_Attribute_Reference, case Attribute_Valid): For the AAMP
856         target, pass the Valid attribute applied to a floating-point prefix on
857         to the back end without expansion.
858         (Storage_Size): Use the new run-time function Storage_Size to retrieve
859         the allocated storage when it is specified by a per-object expression.
860         (Expand_N_Attribute_Reference): Add case for Attribute_Stub_Type.
861         Nothing to do here, the attribute has been rewritten during semantic
862         analysis.
863         (Expand_Attribute_Reference): Handle expansion of the new Priority
864         attribute
865         (Find_Fat_Info): Handle case of universal real
866         (Expand_Access_To_Protected_Op): Fix use of access to protected
867         subprogram from inside the body of a protected entry.
868         (Expand_Access_To_Protected_Op): Common procedure for the expansion of
869         'Access and 'Unrestricted_Access, to transform the attribute reference
870         into a fat pointer.
871         (Is_Constrained_Aliased_View): New predicate to help determine whether a
872         subcomponent's enclosing variable is aliased with a constrained subtype.
873         (Expand_N_Attribute_Reference, case Attribute_Constrained): For Ada_05,
874         test Is_Constrained_Aliased_View rather than Is_Aliased_View, because
875         an aliased prefix must be known to be constrained in order to use True
876         for the attribute value, and now it's possible for some aliased views
877         to be unconstrained.
878
879 2006-10-31  Robert Dewar  <dewar@adacore.com>
880
881         * exp_ch2.adb: Change Is_Lvalue to May_Be_Lvalue
882         (Expand_Entity_Reference): Correct error of not handling subprogram
883         formals in current_value processing.
884
885 2006-10-31  Javier Miranda  <miranda@adacore.com>
886             Robert Dewar  <dewar@adacore.com>
887             Ed Schonberg  <schonberg@adacore.com>
888             Gary Dismukes  <dismukes@adacore.com>
889
890         * exp_ch3.ads, exp_ch3.adb (Expand_N_Object_Declaration): Do not
891         register in the final list objects containing class-wide interfaces;
892         otherwise we incorrectly register the tag of the interface in the final
893         list.
894         (Make_Controlling_Function_Wrappers): Add missing barrier to do not
895         generate the wrapper if the parent primitive is abstract. This is
896         required to report the correct error message.
897         (Expand_N_Subtype_Indication): Do validity checks on range
898         (Clean_Task_Names): If an initialization procedure includes a call to
899         initialize a task (sub)component, indicate that the procedure will use
900         the secondary stack.
901         (Build_Init_Procedure, Init_Secondary_Tags): Enable full ABI
902         compatibility for interfacing with CPP by default.
903         (Expand_N_Object_Declaration): Only build an Adjust call when the
904         object's type is a nonlimited controlled type.
905         * exp_ch3.adb: Add with and use of Exp_Ch6.
906         (Expand_N_Object_Declaration): Check for object initialization that is a
907         call to build-in-place function and apply Make_Build_In_Place_Call_In_
908         Object_Declaration to the call.
909         (Freeze_Type): When the designated type of an RACW was not frozen at the
910         point where the RACW was declared, validate the primitive operations
911         with respect to E.2.2(14) when it finally is frozen.
912         (Build_Initialization_Call,Expand_Record_Controller): Rename
913         Is_Return_By_Reference_Type to be Is_Inherently_Limited_Type, because
914         return-by-reference has no meaning in Ada 2005.
915         (Init_Secondary_Tags): Add missing call to Set_Offset_To_Top
916         to register tag of the immediate ancestor interfaces in the
917         run-time structure.
918         (Init_Secondary_Tags): Moved to the specification to allow the
919         initialization of extension aggregates with abstract interfaces.
920         (Build_Master_Renaming): Make public, for use by function declarations
921         whose return type is an anonymous access type.
922         (Freeze_Record_Type): Replace call to Insert_List_Before by call to
923         Insert_List_Before_And_Analyze after the generation of the specs
924         associated with null procedures.
925         (Expand_Tagged_Root): Update documentation in its specification.
926         (Init_Secondary_Tags): Update documentation.
927         (Build_Init_Procedure): If we are compiling under CPP full ABI compa-
928         tibility mode and the immediate ancestor is a CPP_Pragma tagged type
929         then generate code to inherit the contents of the dispatch table
930         directly from the ancestor.
931         (Expand_Record_Controller): Insert controller component after tags of
932         implemented interfaces.
933         (Freeze_Record_Type): Call new procedure Make_Null_Procedure_Specs to
934         create null procedure overridings when null procedures are inherited
935         from interfaces.
936         (Make_Null_Procedure_Specs): New procedure to generate null procedure
937         declarations for overriding null primitives inherited from interfaces.
938         (Is_Null_Interface_Procedure): New function in
939         Make_Null_Procedure_Specs.
940         (Make_Predefined_Primitive_Specs/Predefined_Primitive_Bodies): If the
941         immediate ancestor of a tagged type is an abstract interface type we
942         must generate the specification of the predefined primitives associated
943         with controlled types (because the dispatch table of the ancestor is
944         null and hence these entries cannot be inherited). This is required to
945         elaborate well the dispatch table.
946
947 2006-10-31  Javier Miranda  <miranda@adacore.com>
948             Ed Schonberg  <schonberg@adacore.com>
949             Bob Duff  <duff@adacore.com>
950             Gary Dismukes  <dismukes@adacore.com>
951             Robert Dewar  <dewar@adacore.com>
952         
953         * exp_ch4.adb (Expand_N_Type_Conversion): Handle missing interface type
954         conversion.
955         (Expand_N_In): Do validity checks on range
956         (Expand_Selected_Component): Use updated for of Denotes_Discriminant.
957         (Expand_N_Allocator): For "new T", if the object is constrained by
958         discriminant defaults, allocate the right amount of memory, rather than
959         the maximum for type T.
960         (Expand_Allocator_Expression): Suppress the call to Remove_Side_Effects
961         when the allocator is initialized by a build-in-place call, since the
962         allocator is already rewritten as a reference to the function result,
963         and this prevents an unwanted duplication of the function call.
964         Add with and use of Exp_Ch6.
965         (Expand_Allocator_Expresssion): Check for an allocator whose expression
966         is a call to build-in-place function and apply
967         Make_Build_In_Place_Call_In_Allocator to the call (for both tagged and
968         untagged designated types).
969         (Expand_N_Unchecked_Type_Conversion): Do not do integer literal
970         optimization if source or target is biased.
971         (Expand_N_Allocator): Add comments for case of an allocator within a
972         function that returns an anonymous access type designating tasks.
973         (Expand_N_Allocator): apply discriminant checks for access
974         discriminants of anonymous access types (AI-402, AI-416)
975
976 2006-10-31  Bob Duff  <duff@adacore.com>
977             Robert Dewar  <dewar@adacore.com>
978             Gary Dismukes  <dismukes@adacore.com>
979             Ed Schonberg  <schonberg@adacore.com>
980
981         * exp_ch5.ads (Expand_N_Extended_Return_Statement): New procedure.
982
983         * exp_ch5.adb (Expand_N_Loop_Statement): Do validity checks on range
984         (Expand_N_Assignment_Statement): Call
985         Make_Build_In_Place_Call_In_Assignment if the right-hand side is a
986         build-in-place function call. Currently, this can happen only for
987         assignments that come from aggregates.
988         Add -gnatd.l --Use Ada 95 semantics for limited function returns,
989         in order to alleviate the upward compatibility introduced by AI-318.
990         (Expand_N_Extended_Return_Statement): Add support for handling the
991         return object as a build-in-place result.
992         (Expand_Non_Function_Return): Implement simple return statements nested
993         within an extended return.
994         (Enable_New_Return_Processing): Turn on the new processing of return
995         statements.
996         (Expand_Non_Function_Return): For a return within an extended return,
997         don't raise Program_Error, because Sem_Ch6 now gives a warning.
998         (Expand_N_Extended_Return_Statement): Implement AI-318
999         (Expand_Simple_Function_Return): Ditto.
1000         (Expand_N_If_Statement): Handle new -gnatwt warning
1001         (Expand_N_Case_Statement): Handle new -gnatwt warning
1002         (Expand_N_Assignment): Handle assignment to the Priority attribute of
1003         a protected object.
1004         (Expand_N_Assignment_Statement): Implement -gnatVe/E to control
1005         validity checking of assignments to elementary record components.
1006         (Expand_N_Return_Statement): return Class Wide types on the secondary
1007         stack independantly of their controlled status since with HIE runtimes,
1008         class wide types are not potentially controlled anymore.
1009
1010         * expander.adb (Expand): Add case for new N_Extended_Return_Statement
1011         node kind.
1012
1013         * exp_ch11.adb (Expand_N_Handled_Sequence_Of_Statements): Avoid
1014         Expand_Cleanup_Actions in case of N_Extended_Return_Statement, because
1015         it expects a block, procedure, or task. The return statement will get
1016         turned into a block, and Expand_Cleanup_Actions will happen then.
1017
1018 2006-10-31  Robert Dewar  <dewar@adacore.com>
1019             Ed Schonberg  <schonberg@adacore.com>
1020             Bob Duff  <duff@adacore.com>
1021             Gary Dismukes  <dismukes@adacore.com>
1022
1023         * exp_ch6.ads, exp_ch6.adb: Use new Validity_Check suppression
1024         capability.
1025         (Expand_Inlined_Call): Tagged types are by-reference types, and
1026         therefore should be replaced by a renaming declaration in the expanded
1027         body, as is done for limited types.
1028         (Expand_Call): If this is a call to a function with dispatching access
1029         result, propagate tag from context.
1030         (Freeze_Subprogram): Enable full ABI compatibility for interfacing with
1031         CPP by default.
1032         (Make_Build_In_Place_Call_In_Assignment): New procedure to do
1033         build-in-place when the right-hand side of an assignment is a
1034         build-in-place function call.
1035         (Make_Build_In_Place_Call_In_Allocator): Apply an unchecked conversion
1036         of the explicit dereference of the allocator to the result subtype of
1037         the build-in-place function. This is needed to satisfy type checking
1038         in cases where the caller's return object is created by an allocator for
1039         a class-wide access type and the type named in the allocator is a
1040         specific type.
1041         (Make_Build_In_Place_Call_In_Object_Declaration): Apply an unchecked
1042         conversion of the reference to the declared object to the result subtype
1043         of the build-in-place function. This is needed to satisfy type checking
1044         in cases where the declared object has a class-wide type. Also, in the
1045         class-wide case, change the type of the object entity to the specific
1046         result subtype of the function, to avoid passing a class-wide object
1047         without explicit initialization to the back end.
1048         (Register_Interface_DT_Entry): Moved outside the body of
1049         Freeze_Subprogram because this routine is now public; it is called from
1050         Check_Dispatching_Overriding to handle late overriding of abstract
1051         interface primitives.
1052         (Add_Access_Actual_To_Build_In_Place_Call): New utility procedure for
1053         adding an implicit access actual on a call to a build-in-place function.
1054         (Expand_Actuals): Test for an actual parameter that is a call to a
1055         build-in-place function and apply
1056         Make_Build_In_Place_Call_In_Anonymous_Context to the call.
1057         (Is_Build_In_Place_Function): New function to determine whether an
1058         entity is a function whose calls should be handled as build-in-place.
1059         (Is_Build_In_Place_Function_Call): New function to determine whether an
1060         expression is a function call that should handled as build-in-place.
1061         (Make_Build_In_Place_Call_In_Allocator): New procedure for handling
1062         calls to build-in-place functions as the initialization of an allocator.
1063         (Make_Build_In_Place_Call_In_Anonymous_Context): New procedure for
1064         handling calls to build-in-place functions in contexts that do not
1065         involve init of a separate object (for example, actuals of subprogram
1066         calls).
1067         (Make_Build_In_Place_Call_In_Object_Declaration): New procedure for
1068         handling calls to build-in-place functions as the initialization of an
1069         object declaration.
1070         (Detect_Infinite_Recursion): Add explicit parameter Process to
1071         instantiation of Traverse_Body to avoid unreferenced warning.
1072         (Check_Overriding_Inherited_Interfaces): Removed.
1073         (Register_Interface_DT_Entry): Code cleanup.
1074         (Register_Predefined_DT_Entry): Code cleanup.
1075         (Expand_Inlined_Call.Rewrite_Procedure_Call): Do not omit block around
1076         inlined statements if within a transient scope.
1077         (Expand_Inlined_Call.Process_Formals): When replacing occurrences of
1078         formal parameters with occurrences of actuals in inlined body, establish
1079         visibility on the proper view of the actual's subtype for the body's
1080         context.
1081         (Freeze_Subprogram): Do nothing if we are compiling under full ABI
1082         compatibility mode and we have an imported CPP subprogram because
1083         for now we assume that imported CPP primitives correspond with
1084         objects whose constructor is in the CPP side (and therefore we
1085         don't need to generate code to register them in the dispatch table).
1086         (Expand_Actuals): Introduce copy of actual, only if it might be a bit-
1087         aligned selected component.
1088         (Add_Call_By_Copy_Node): Add missing code to handle the case in which
1089         the actual of an in-mode parameter is a type conversion.
1090         (Expand_Actuals): If the call does not come from source and the actual
1091         is potentially misaligned, let gigi handle it rather than rejecting the
1092         (Expand_N_Subprogram_Body, Freeze_Subprogram): set subprograms returning
1093         Class Wide types as returning by reference independantly of their
1094         controlled status since with HIE runtimes class wide types are not
1095         potentially controlled anymore.
1096
1097 2006-10-31  Ed Schonberg  <schonberg@adacore.com>             
1098
1099         * exp_ch9.adb (Update_Prival_Types): Simplify code for entity
1100         references that are private components of the protected object.
1101         (Build_Barrier_Function): Set flag Is_Entry_Barrier_Function
1102         (Update_Prival_Subtypes): Add explicit Process argument to Traverse_Proc
1103         instantiation to deal with warnings.
1104         (Initialize_Protection): If expression for priority is non-static, use
1105         System_Priority as its expected type, in case the expression has not
1106         been analyzed yet.
1107
1108 2006-10-31  Robert Dewar  <dewar@adacore.com>
1109
1110         * exp_dbug.ads, exp_dbug.adb (Get_External_Name): Add missing
1111         initialization of Homonym_Len.
1112         (Fully_Qualify_Name): Remove kludge to eliminate anonymous block
1113         names from fully qualified name. Fixes problem of duplicate
1114         external names differing only in the presence of such a block name.
1115
1116 2006-10-31  Thomas Quinot  <quinot@adacore.com>
1117             Pablo Oliveira  <oliveira@adacore.com>
1118         
1119         * exp_dist.adb (Get_Subprogram_Ids): This function will no more assign
1120         subprogram Ids, even if they are not yet assigned.
1121         (Build_Subprogram_Id): It is now this function that will take care of
1122         calling Assign_Subprogram_Ids if necessary.
1123         (Add_Receiving_Stubs_To_Declarations): Checking the subprograms ids
1124         should be done only once they are assigned.
1125         (Build_From_Any_Function, case of tagged types): Add missing call to
1126         Allocate_Buffer.
1127         (Corresponding_Stub_Type): New subprogram. Returns the associated stub
1128         type for an RACW type.
1129         (Add_RACW_Features): When processing an RACW declaration for which the
1130         designated type is already frozen, enforce E.2.2(14) rules immediately.
1131         (GARLIC_Support.Build_Subprogram_Receiving_Stubs): Do not perform any
1132         special reordering of controlling formals.
1133
1134         * exp_dist.ads (Corresponding_Stub_Type): New subprogram. Returns the
1135         associated stub type for an RACW type.
1136
1137 2006-10-31  Ed Schonberg  <schonberg@adacore.com>
1138
1139         * exp_fixd.adb (Rounded_Result_Set): For multiplication and division of
1140         fixed-point operations in an integer context, i.e. as operands of a
1141         conversion to an integer type, indicate that result must be rounded.
1142
1143 2006-10-31  Robert Dewar  <dewar@adacore.com>
1144
1145         * exp_imgv.adb (Expand_Image_Attribute): For Wide_[Wide_]Character
1146         cases, pass the encoding method, since it is now required by the run
1147         time.
1148
1149         * s-valwch.ads, s-valwch.adb (Value_Wide_Wide_Character): Avoid
1150         assumption that Str'First = 1.
1151         (Value_Wide_Character): Takes EM (encoding method) parameter and passes
1152         it on to the Value_Wide_Wide_Character call.
1153         (Value_Wide_Wide_Character): Takes EM (encoding method) parameter and
1154         properly handles a string of the form quote-encoded_wide_char-quote.
1155
1156         * s-wchcnv.adb: Minor reformatting
1157
1158 2006-10-31  Javier Miranda  <miranda@adacore.com>
1159         
1160         * exp_intr.adb (Expand_Dispatching_Constructor_Call): Add missing
1161         run-time membership test to ensure that the constructed object
1162         implements the target abstract interface.
1163
1164 2006-10-31  Robert Dewar  <dewar@adacore.com>
1165
1166         * exp_prag.adb (Expand_Pragma_Common_Object): Use a single
1167         Machine_Attribute pragma internally to implement the user pragma.
1168         Add processing for pragma Interface so that it is now completely
1169         equivalent to pragma Import.
1170
1171         * sem_prag.adb (Analyze_Pragma, case Obsolescent): Extend this pragma
1172         so that it can be applied to all entities, including record components
1173         and enumeration literals.
1174         (Analyze_Pragma, case Priority_Specific_Dispatching): Check whether
1175         priority ranges are correct, verify compatibility against task
1176         dispatching and locking policies, and if everything is correct an entry
1177         is added to the table containing priority specific dispatching entries
1178         for this compilation unit.
1179         (Delay_Config_Pragma_Analyze): Delay processing
1180         Priority_Specific_Dispatching pragmas because when processing the
1181         pragma we need to access run-time data, such as the range of
1182         System.Any_Priority.
1183         (Sig_Flags): Add Pragma_Priority_Specific_Dispatching.
1184         Allow pragma Unreferenced as a context item
1185         Add pragma Preelaborable_Initialization
1186         (Analyze_Pragma, case Interface): Interface is extended so that it is
1187         now syntactically and semantically equivalent to Import.
1188         (Analyze_Pragma, case Compile_Time_Warning): Fix error of blowups on
1189         insertion characters.
1190         Add handling for Pragma_Wide_Character_Encoding
1191         (Process_Restrictions_Restriction_Warnings): Ensure that a warning
1192         never supercedes a real restriction, and that a real restriction
1193         always supercedes a warning.
1194         (Analyze_Pragma, case Assert): Set Low_Bound_Known if assert is of
1195         appropriate form.
1196
1197 2006-10-31  Bob Duff  <duff@adacore.com>
1198             Ed Schonberg  <schonberg@adacore.com>
1199             Robert Dewar  <dewar@adacore.com>
1200
1201         * exp_ch7.adb (Build_Array_Deep_Procs, Build_Record_Deep_Procs,
1202         Make_Deep_Record_Body): Rename Is_Return_By_Reference_Type to be
1203         Is_Inherently_Limited_Type, because return-by-reference has no meaning
1204         in Ada 2005.
1205         (Find_Node_To_Be_Wrapped): Use new method of determining the result
1206         type of the function containing a return statement, because the
1207         Return_Type field was removed. We now use the Return_Applies_To field.
1208
1209         * exp_util.ads, exp_util.adb: Use new subtype N_Membership_Test
1210         (Build_Task_Image_Decl): If procedure is not called from an
1211         initialization procedure, indicate that function that builds task name
1212         uses the sec. stack. Otherwise the enclosing initialization procedure
1213         will carry the indication.
1214         (Insert_Actions): Remove N_Return_Object_Declaration. We now use
1215         N_Object_Declaration instead.
1216         (Kill_Dead_Code): New interface to implement -gnatwt warning for
1217         conditional dead code killed, and change implementation accordingly.
1218         (Insert_Actions): Add N_Return_Object_Declaration case.
1219         Correct comment to mention N_Extension_Aggregate node.
1220         (Set_Current_Value_Condition): Call Safe_To_Capture_Value to avoid bad
1221         attempts to save information for global variables which cannot be
1222         safely tracked.
1223         (Get_Current_Value_Condition): Handle conditions the other way round
1224         (constant on left). Also handle right operand of AND and AND THEN
1225         (Set_Current_Value_Condition): Corresponding changes
1226         (Append_Freeze_Action): Remove unnecessary initialization of Fnode.
1227         (Get_Current_Value_Condition): Handle simple boolean operands
1228         (Get_Current_Value_Condition): Handle left operand of AND or AND THEN
1229         (Get_Current_Value_Condition): If the variable reference is within an
1230         if-statement, does not appear in the list of then_statments, and does
1231         not come from source, treat it as being at unknown location.
1232         (Get_Current_Value_Condition): Enhance to allow while statements to be
1233         processed as well as if statements.
1234         (New_Class_Wide_Subtype): The entity for a class-wide subtype does not
1235         come from source.
1236         (OK_To_Do_Constant_Replacement): Allow constant replacement within body
1237         of loop. This is safe now that we fixed Kill_Current_Values.
1238         (OK_To_Do_Constant_Replacement): Check whether current scope is
1239         Standard, before examining outer scopes.
1240
1241 2006-10-31  Vincent Celier  <celier@adacore.com>
1242
1243         * krunch.ads, krunch.adb (Krunch): New Boolean parameter VMS_On_Target.
1244         When True, apply VMS treatment to children of packages A, G, I and S.
1245         For F320-016
1246
1247         * fname-uf.adb (Get_File_Name): Call Krunch with OpenVMS_On_Target
1248
1249 2006-10-31  Robert Dewar  <dewar@adacore.com>
1250             Ed Schonberg  <schonberg@adacore.com>
1251
1252         * freeze.adb: Add handling of Last_Assignment field
1253         (Warn_Overlay): Supply missing continuation marks in error msgs
1254         (Freeze_Entity): Add check for Preelaborable_Initialization
1255
1256         * g-comlin.adb: Add Warnings (Off) to prevent new warning
1257
1258         * g-expect.adb: Add Warnings (Off) to prevent new warning
1259
1260         * lib-xref.adb: Add handling of Last_Assignment field
1261         (Generate_Reference): Centralize handling of pragma Obsolescent here
1262         (Generate_Reference): Accept an implicit reference generated for a
1263         default in an instance.
1264         (Generate_Reference): Accept a reference for a node that is not in the
1265         main unit, if it is the generic body corresponding to an subprogram
1266         instantiation.
1267
1268         * xref_lib.adb: Add pragma Warnings (Off) to avoid new warnings
1269
1270         * sem_warn.ads, sem_warn.adb (Set_Warning_Switch): Add processing for
1271         -gnatwq/Q.
1272         (Warn_On_Useless_Assignment): Suppress warning if enclosing inner
1273         exception handler.
1274         (Output_Obsolescent_Entity_Warnings): Rewrite to avoid any messages on
1275         use clauses, to avoid messages on packages used to qualify, and also
1276         to avoid messages from obsolescent units.
1277         (Warn_On_Useless_Assignments): Don't generate messages for imported
1278         and exported variables.
1279         (Warn_On_Useless_Assignments): New procedure
1280         (Output_Obsolescent_Entity_Warnings): New procedure
1281         (Check_Code_Statement): New procedure
1282
1283         * einfo.ads, einfo.adb (Has_Static_Discriminants): New flag
1284         Change name Is_Ada_2005 to Is_Ada_2005_Only
1285         (Last_Assignment): New field for useless assignment warning
1286
1287 2006-10-31  Olivier Hainque  <hainque@adacore.com>
1288
1289         * g-alleve.adb (lvx, stvx): Ceil-Round the Effective Address to the
1290         closest multiple of VECTOR_ALIGNMENT and not the closest multiple of 16.
1291
1292 2006-10-31  Bob Duff  <duff@adacore.com>
1293             Robert Dewar  <dewar@adacore.com>
1294             Ed Schonberg  <schonberg@adacore.com>
1295
1296         * g-awk.adb (Default_Session, Current_Session): Compile this file in
1297         Ada 95 mode, because it violates the new rules for AI-318.
1298
1299         * g-awk.ads: Use overloaded subprograms in every case where we used to
1300         have a default of Current_Session. This makes the code closer to be
1301         correct for both Ada 95 and 2005.
1302
1303         * g-moreex.adb (Occurrence): Turn off warnings for illegal-in-Ada-2005
1304         code, relying on the fact that the compiler generates a warning
1305         instead of an error in -gnatg mode.
1306
1307         * lib-xref.ads (Xref_Entity_Letters): Add entry for new
1308         E_Return_Statement entity kind.
1309         Add an entry for E_Incomplete_Subtype in Xref_Entity_Letters.
1310
1311         * par.adb (P_Interface_Type_Definition): Addition of one formal to
1312         report an error if the reserved word abstract has been previously found.
1313         (SS_End_Type): Add E_Return for new extended_return_statement syntax.
1314         
1315         * par-ch4.adb (P_Aggregate_Or_Paren_Expr): Improve message for
1316         parenthesized range attribute usage
1317         (P_Expression_No_Right_Paren): Add missing comment about error recovery.
1318
1319         * par-ch6.adb (P_Return_Object_Declaration): AI-318: Allow "constant"
1320         in the syntax for extended_return_statement. This is not in the latest
1321         RM, but the ARG is expected to issue an AI allowing this.
1322         (P_Return_Subtype_Indication,P_Return_Subtype_Indication): Remove
1323         N_Return_Object_Declaration. We now use N_Object_Declaration instead.
1324         (P_Return_Object_Declaration, P_Return_Subtype_Indication,
1325         P_Return_Statement): Parse the new syntax for extended_return_statement.
1326
1327         * par-endh.adb (Check_End, Output_End_Deleted, Output_End_Expected,
1328         Output_End_Missing): Add error-recovery code for the new
1329         extended_return_statement syntax; that is, the new E_Return entry on
1330         the scope stack.
1331
1332         * s-auxdec-vms_64.ads, s-auxdec.ads (AST_Handler): Change type from
1333         limited to nonlimited, because otherwise we violate the new Ada 2005
1334         rules about returning limited types in function Create_AST_Handler in
1335         s-asthan.adb.
1336
1337         * sem.adb (Analyze): Add cases for new node kinds
1338         N_Extended_Return_Statement and N_Return_Object_Declaration.
1339
1340         * sem_aggr.adb (Aggregate_Constraint_Checks): Verify that component
1341         type is in the same category as type of context before applying check,
1342         to prevent anomalies in instantiations.
1343         (Resolve_Aggregate): Remove test for limited components in aggregates.
1344         It's unnecessary in Ada 95, because if it has limited components, then
1345         it must be limited. It's wrong in Ada 2005, because limited aggregates
1346         are now allowed.
1347         (Resolve_Record_Aggregate): Move check for limited types later, because
1348         OK_For_Limited_Init requires its argument to have been resolved.
1349         (Get_Value): When copying the component default expression for a
1350         defaulted association in an aggregate, use the sloc of the aggregate
1351         and not that of the original expression, to prevent spurious
1352         elaboration errors, when the expression includes function calls.
1353         (Check_Non_Limited_Type): Correct code for AI-287, extension aggregates
1354         were missing. We also didn't handle qualified expressions. Now also
1355         allow function calls. Use new common routine OK_For_Limited_Init.
1356         (Resolve_Extension_Aggregate): Minor fix to bad error message (started
1357         with space can upper case letter).
1358
1359         * sem_ch3.ads, sem_ch3.adb (Create_Constrained_Components): Set
1360         Has_Static_Discriminants flag
1361         (Record_Type_Declaration): Diagnose an attempt to declare an interface
1362         type with discriminants.
1363         (Process_Range_Expr_In_Decl): Do validity checks on range
1364         (Build_Discriminant_Constraints): Use updated form of
1365         Denotes_Discriminant.
1366         (Process_Subtype): If the subtype is a private subtype whose full view
1367         is a concurrent subtype, introduce an itype reference to prevent scope
1368         anomalies in gigi.
1369         (Build_Derived_Record_Type, Collect_Interface_Primitives,
1370         Record_Type_Declaration):  The functionality of the subprograms
1371         Collect_Abstract_Interfaces and Collect_All_Abstract_Interfaces
1372         is now performed by a single routine.
1373         (Build_Derived_Record_Type): If the type definition includes an explicit
1374         indication of limitedness, then the type must be marked as limited here
1375         to ensure that any access discriminants will not be treated as having
1376         a local anonymous access type.
1377         (Check_Abstract_Overriding): Issue a detailed error message when an
1378         abstract subprogram was not overridden due to incorrect mode of its
1379         first parameter.
1380         (Analyze_Private_Extension_Declaration): Add support for the analysis of
1381         synchronized private extension declarations. Verify that the ancestor is
1382         a limited or synchronized interface or in the generic case, the ancestor
1383         is a tagged limited type or synchronized interface and all progenitors
1384         are either limited or synchronized interfaces.
1385         Derived_Type_Declaration): Check for presence of private extension when
1386         dealing with synchronized formal derived types.
1387         Process_Full_View): Enchance the check done on the usage of "limited" by
1388         testing whether the private view is synchronized.
1389         Verify that a synchronized private view is completed by a protected or
1390         task type.
1391         (OK_For_Limited_Init_In_05): New function.
1392         (Analyze_Object_Declaration): Move check for limited types later,
1393         because OK_For_Limited_Init requires its argument to have been resolved.
1394         Add -gnatd.l --Use Ada 95 semantics for limited function returns,
1395         in order to alleviate the upward compatibility introduced by AI-318.
1396         (Constrain_Corresponding_Record): If the constraint is for a component
1397         subtype, mark the itype as frozen, to avoid out-of-scope references to
1398         discriminants in the back-end.
1399         (Collect_Implemented_Interfaces): Protect the recursive algorithm of
1400         this subprogram against wrong sources.
1401         (Get_Discr_Value, Is_Discriminant): Handle properly references to a
1402         discriminant of limited type completed with a protected type, when the
1403         discriminant is used to constrain a private component of the type, and
1404         expansion is disabled.
1405         (Find_Type_Of_Object): Do not treat a return subtype that is an
1406         anonymous subtype as a local_anonymous_type, because its accessibility
1407         level is the return type of the enclosing function.
1408         (Check_Initialization): In -gnatg mode, turn the error "cannot
1409         initialize entities of limited type" into a warning.
1410         (OK_For_Limited_Init): Return true for generated nodes, since it
1411         sometimes violates the legality rules.
1412         (Make_Incomplete_Declaration): If the type for which an incomplete
1413         declaration is created happens to be the currently visible entity,
1414         preserve the homonym chain when removing it from visibility.
1415         (Check_Conventions): Add support for Ada 2005 (AI-430): Conventions of
1416         inherited subprograms.
1417         (Access_Definition): If this is an access to function that is the return
1418         type of an access_to_function definition, context is a type declaration
1419         and the scope of the anonymous type is the current one.
1420         (Analyze_Subtype_Declaration): Add the defining identifier of a regular
1421         incomplete subtype to the set of private dependents of the original
1422         incomplete type.
1423         (Constrain_Discriminated_Type): Emit an error message whenever an
1424         incomplete subtype is being constrained.
1425         (Process_Incomplete_Dependents): Transform an incomplete subtype into a
1426         corresponding subtype of the full view of the original incomplete type.
1427         (Check_Incomplete): Properly detect invalid usage of incomplete types
1428         and subtypes.
1429
1430 2006-10-31  Hristian Kirtchev  <kirtchev@adacore.com>
1431
1432         * g-catiio.ads, g-catiio.adb (Value): New function.
1433         Given an input String, try and parse a valid Time value.
1434
1435 2006-10-31  Vincent Celier  <celier@adacore.com>
1436
1437         * g-debpoo.adb (Is_Valid): Correctly compute Offset using
1438         Integer_Address arithmetic, as in Set_Valid.
1439
1440 2006-10-31  Arnaud Charlet  <charlet@adacore.com>
1441             Robert Dewar  <dewar@adacore.com>
1442
1443         * gnatcmd.adb (Process_Link): Use Osint.Executable_Name instead of
1444         handling executable extension manually and duplicating code.
1445
1446         * make.adb: Implement new -S switch
1447         (Gnatmake): Use new function Osint.Executable_Name instead
1448         of handling executable extension manually.
1449
1450         * prj-util.adb (Executable_Of): Make sure that if an Executable_Suffix
1451         is specified, the executable name ends with this suffix.
1452         Take advantage of Osint.Executable_Name instead of duplicating code.
1453
1454         * switch-m.adb: Recognize new gnatmake -S switch
1455
1456         * targparm.ads, targparm.adb (Executable_Extension_On_Target): New
1457         variable.
1458         (Get_Target_Parameters): Set Executable_Extension_On_Target if
1459         available.
1460
1461         * makeusg.adb: Add line for gnatmake -S switch
1462
1463 2006-10-31  Vincent Celier  <celier@adacore.com>
1464
1465         * gnatlink.adb (Gnatlink): If gcc is not called with -shared-libgcc,
1466         call it with -static-libgcc, as there are some platforms, such as
1467         Darwin, where one of these two switches is compulsory to link.
1468
1469 2006-10-31  Vincent Celier  <celier@adacore.com>
1470         
1471         * gnatls.adb: Take into account GPR_PROJECT_PATH, when it is defined,
1472         instead of ADA_PROJECT_PATH, for the project path.
1473         (Gnatls): When displaying the project path directories, use host dir
1474         specs.
1475
1476         * prj-ext.adb (Prj.Ext elaboration): On VMS, only expand relative path
1477         names in the project path, as absolute paths may correspond to
1478         multi-valued VMS logical names.
1479
1480 2006-10-31  Vincent Celier  <celier@adacore.com>
1481
1482         * g-os_lib.ads, g-os_lib.adb (Locate_Exec_On_Path): Always return an
1483         absolute path name.
1484         (Locate_Regular_File): Ditto
1485         (Change_Dir): Remove, no longer used
1486         (Normalize_Pathname): Do not use Change_Dir to get the drive letter
1487         on Windows. Get it calling Get_Current_Dir.
1488         (OpenVMS): Remove imported boolean, no longer needed.
1489         (Normalize_Pathname)[VMS]: Do not resolve directory names.
1490         (Pid_To_Integer): New function to convert a Process_Id to  Integer
1491
1492 2006-10-31  Thomas Quinot  <quinot@adacore.com>
1493
1494         * g-socket.ads, g-socket.adb (Close_Selector): Once the signalling
1495         sockets are closed, reset the R_Sig_Socket and W_Sig_Socket components
1496         to No_Socket.
1497         (Selector_Type): Add default value of No_Socket for R_Sig_Socket and
1498         W_Sig_Socket.
1499
1500 2006-10-31  Robert Dewar  <dewar@adacore.com>
1501
1502         * g-speche.ads, g-speche.adb: Add special case to recognize misspelling
1503         initial letter o as a zero.
1504
1505 2006-10-31  Robert Dewar  <dewar@adacore.com>
1506
1507         * g-spipat.adb (S_To_PE): Remove incorrect use of 0 instead of Str'First
1508
1509 2006-10-31  Robert Dewar  <dewar@adacore.com>
1510
1511         * layout.adb (Layout_Record_Type): Deal with non-static subtypes of
1512         variant records
1513         (Layout_Variant_Record): Retrieve the discriminants from the entity
1514         rather than from the type definition, because in the case of a full
1515         type for a private type we need to take the discriminants from the
1516         partial view.
1517         (Layout_Component_List): When applying the Max operator to variants with
1518         a nonstatic size, check whether either operand is static and scale that
1519         operand from bits to storage units before applying Max.
1520         (Layout_Type): In VMS, if a C-convention access type has no explicit
1521         size clause (and does not inherit one in the case of a derived type),
1522         then the size is reset to 32 from 64.
1523
1524 2006-10-31  Vincent Celier  <celier@adacore.com>
1525
1526         * lib-load.adb (Load_Unit): Skip the test for a unit not found when
1527         its file has already been loaded, according to the unit being loaded,
1528         not to the current value of Multiple_Unit_Index.
1529
1530 2006-10-31  Thomas Quinot  <quinot@adacore.com>
1531             Eric Botcazou  <ebotcazou@adacore.com>
1532             Arnaud Charlet  <charlet@adacore.com>
1533
1534         * Makefile.in: Set EH mechanism to ZCX for FreeBSD.
1535         (NO_REORDER_ADAFLAGS): New var defined to -fno-toplevel-reorder if
1536         possible.
1537         (a-except.o): Pass it to the compiler.
1538         (gnatlib-shared-vms): Removed -nostartfiles switch in link step.
1539         (LIBGNAT_TARGET_PAIRS for Windows): Avoid the use of the specific
1540         a-calend-mingw.adb version.
1541
1542         * Makefile.rtl: Added s-dsaser.
1543         Add object entries for Ada.Calendar.[Arithmetic/Formatting/Time_Zones]
1544         (GNATRTL_TASKING_OBJS): Add Ada.Dispatching and
1545         Ada.Dispatching.Round_Robin.
1546         Added new unit Ada.Containers.Restricted_Bounded_Doubly_Linked_Lists
1547
1548         * Make-lang.in: Remove all references to gt-ada-decl.h.
1549         Add concatenation (s-strops/s-sopco3/s-sopco4/s-sopco5) to compiler
1550         sources.
1551         Add dependency on ada/s-restri.o for GNAT1 and GNATBIND objects.
1552         Update dependencies.
1553
1554         * system-freebsd-x86.ads: Make ZCX the default EH mechanism for FreeBSD
1555
1556 2006-10-31  Vincent Celier  <celier@adacore.com>
1557
1558         * mlib-utl.adb (Initialized): Remove, no longer used
1559         (Initialize): Remove, no longer used
1560         (Ar): If Ar_Exec is null, get the location of the archive builder and,
1561         if there is one, the archive indexer. Fail if the archive builder cannot
1562         be found.
1563         (Gcc): If the driver path is unknown, get it. Fail if the driver cannot
1564         be found.
1565
1566 2006-10-31  Ed Schonberg  <schonberg@adacore.com>
1567
1568         * sem_ch10.ads, sem_ch10.adb (Check_Redundant_Withs,
1569         Process_Body_Clauses): If the context of a body includes a use clause
1570         for P.Q then a with_clause for P in the same body is not redundant,
1571         even if the spec also has a with_clause on P.
1572         Add missing continuation mark to error msg
1573         (Build_Limited_Views): A limited view of a type is tagged if its
1574         declaration includes a record extension.
1575         (Analyze_Proper_Body): Set Corresponding_Stub field in N_Subunit
1576         node, even if the subunit has errors. This avoids malfunction by
1577         Lib.Check_Same_Extended_Unit in the presence of syntax errors.
1578         (Analyze_Compilation_Unit): Add circuit to make sure we get proper
1579         generation of obsolescent messages for with statements (cannot do
1580         this too early, or we cannot implement avoiding the messages in the
1581         case of obsolescent units withing obsolescent units).
1582         (Install_Siblings): If the with_clause is on a remote descendant of
1583         an ancestor of the current compilation unit, find whether there is
1584         a sibling child unit that is immediately visible.
1585         (Remove_Private_With_Clauses): New procedure, invoked after completing
1586         the analysis of the private part of a nested package, to remove from
1587         visibility the private with_clauses of the enclosing package
1588         declaration.
1589         (Analyze_With_Clause): Remove Check_Obsolescent call, this checking is
1590         now centralized in Generate_Reference.
1591         (Install_Limited_Context_Clauses): Remove superfluous error
1592         message associated with unlimited view visible through use
1593         and renamings. In addition, at the point in which the error
1594         is reported, we add the backslash to the text of the error
1595         to ensure that it is reported as a single error message.
1596         Use new // insertion for some continuation messages
1597         (Expand_Limited_With_Clause): Use copy of name rather than name itself,
1598         to create implicit with_clause for parent unit mentioned in original
1599         limited_with_clause.
1600         (Install_Limited_With_Unit): Set entity of parent identifiers if the
1601         unit is a child unit. For ASIS queries.
1602         (Analyze_Subunit): If the subunit appears within a child unit, make all
1603         ancestor child units directly visible again.
1604
1605 2006-10-31  Robert Dewar  <dewar@adacore.com>
1606
1607         * par-ch10.adb (P_Context_Clause): Minor error message fix
1608
1609 2006-10-31  Hristian Kirtchev  <kirtchev@adacore.com>
1610             Javier Miranda  <miranda@adacore.com>
1611
1612         * par-ch12.adb: Grammar update and cleanup.
1613         (P_Formal_Type_Definition, P_Formal_Derived_Type_Definition): Add
1614         support for synchronized derived type definitions.
1615         Add the new actual Abstract_Present to every call to
1616         P_Interface_Type_Definition.
1617         (P_Formal_Object_Declarations): Update grammar rules. Handle parsing of
1618         a formal object declaration with an access definition or a subtype mark
1619         with a null exclusion.
1620         (P_Generic_Association): Handle association with box, and others_choice
1621         with box, to support Ada 2005 partially parametrized formal packages.
1622
1623 2006-10-31  Robert Dewar  <dewar@adacore.com>
1624             Javier Miranda  <miranda@adacore.com>
1625         
1626         * par-ch3.adb (P_Range_Or_Subtype_Mark): Check for bad parentheses
1627         (P_Type_Declaration): Remove barrier against the reserved word "limited"
1628         after "abstract" to give support to the new syntax of AARM 3.4 (2/2).
1629         (P_Type_Declaration): Minor code cleanup. Add support for synchronized
1630         private extensions.
1631         (P_Type_Declaration): Add the new actual Abstract_Present to every call
1632         to P_Interface_Type_Definition.
1633         (P_Interface_Type_Definition): Addition of one formal to report an error
1634         if the reserved word abstract has been previously found.
1635         (P_Identifier_Declarations): Update grammar rules. Handle parsing of an
1636         object renaming declaration with an access definition or subtype mark
1637         with a possible null exclusion.
1638
1639         * par-ch9.adb: Minor error msg fix
1640
1641         * par-load.adb: Add missing continuation mark to error msg
1642
1643         * par-tchk.adb: (Wrong_Token): Code cleanup, use concatenation
1644
1645 2006-10-31  Vincent Celier  <celier@adacore.com>
1646
1647         * prj-dect.adb (Parse_Attribute_Declaration): Do not issue warning for
1648         unknown attribute in unknown package or in package that does not need
1649         to be checked.
1650         (Parse_Package_Declaration): Do not issue warning for unknown package in
1651         quiet output.
1652
1653 2006-10-31  Vincent Celier  <celier@adacore.com>
1654
1655         * prj-makr.adb (Packages_To_Check_By_Gnatname): New global constant
1656         (Make): Call Parse with Packages_To_Check_By_Gnatname for parameter
1657         Packages_To_Check.
1658
1659 2006-10-31  Vincent Celier  <celier@adacore.com>
1660
1661         * prj-nmsc.adb (Check_Ada_Name): For children of package A, G, I and S
1662         on VMS, change "__" to '.' before checking the name.
1663         (Record_Ada_Source): Always add the source file name in the list of
1664         of sources, even if it is not the first time, as it is for another
1665         source index.
1666         (Get_Unit): Replace both '_' (after 'a', 'g', 'i' or 's') with a single
1667         dot, instead of replacing only the first '_'.
1668
1669         * prj-part.adb (Parse): Convert project file path to canonical form
1670
1671         * prj-proc.adb (Recursive_Process): Make sure that, when a project is
1672         extended, the project id of the project extending it is recorded in its
1673         data, even when it has already been processed as an imported project.
1674
1675 2006-10-31  Robert Dewar  <dewar@adacore.com>
1676
1677         * repinfo.adb (List_Entities): Don't list entities from renaming
1678         declarations.
1679
1680 2006-10-31  Arnaud Charlet  <charlet@adacore.com>
1681             Robert Dewar  <dewar@adacore.com>
1682
1683         * restrict.ads, restrict.adb (Restriction_Active): Now returns False if
1684         only a restriction warning is active for the given restriction. This is
1685         desirable because we do not want to modify code in the case where only
1686         a warning is set.
1687         (Set_Profile_Restrictions): Make sure that a Profile_Warnings never
1688         causes overriding of real restrictions.
1689         Take advantage of new No_Restrictions constant.
1690
1691         * raise.h: (__gnat_set_globals): Change profile.
1692
1693 2006-10-31  Arnaud Charlet  <charlet@adacore.com>
1694         
1695         * rtsfind.adb: Remove s-polint from comment as it exists no more.
1696
1697         * rtsfind.ads: 
1698         Move entity RE_Get_Active_Partition_Id to package System.DSA_Services.
1699         Move all the entities in obsolete package System.PolyORB_Interface to
1700         System.Partition_Interface.
1701         (RE_Storage_Size): New function in System.Tasking.
1702         (RE_Get_Ceiling): New entity.
1703         (RE_Set_Ceiling): New entity.
1704         (RO_PE_Get_Ceiling): New entity.
1705         (RO_RE_Set_Ceiling): New entity.
1706         (Inherit_CPP_DT): New entity
1707
1708 2006-10-31  Robert Dewar  <dewar@adacore.com>
1709
1710         * scng.adb (Scan, case of numeric literal): Better msg for identifier
1711         starting with a digit.
1712
1713 2006-10-31  Ed Schonberg  <schonberg@adacore.com>
1714             Thomas Quinot  <quinot@adacore.com>
1715             Javier Miranda  <miranda@adacore.com>
1716             Gary Dismukes  <dismukes@adacore.com>
1717
1718         * sem_attr.ads, sem_attr.adb (Analyze_Access_Attribute): Diagnose
1719         properly an attempt to apply Unchecked_Access to a protected operation.
1720         (OK_Self_Reference): New subprogram to check the legality of an access
1721         attribute whose prefix is the type of an enclosing aggregate.
1722         Generalizes previous mechanism to handle attribute references nested
1723         arbitrarily deep within the aggregate.
1724         (Analyze_Access_Attribute): An access attribute whose prefix is a type
1725         can appear in an aggregate if this is a default-initialized aggregate
1726         for a self-referential type.
1727         (Resolve_Attribute, case Access): Ditto.
1728         Add support for new implementation defined attribute Stub_Type.
1729         (Eval_Attribute, case Attribute_Stub_Type): New case.
1730         (Analyze_Attribute, case Attribute_Stub_Type): New case.
1731         (Stream_Attribute_Available): Implement using new subprogram from
1732         sem_cat, Has_Stream_Attribute_Definition, instead of incorrect
1733         Has_Specified_Stream_Attribute flag.
1734         Disallow Storage_Size and Storage_Pool for access to subprogram
1735         (Resolve_Attribute, case 'Access et al): Take into account anonymous
1736         access types of return subtypes in extended return statements. Remove
1737         accessibility checks on anonymous access types when Unchecked_Access is
1738         used.
1739         (Analyze_Attribute): Add support for the use of 'Class to convert
1740         a class-wide interface to a tagged type.
1741         Add support for the attribute Priority.
1742         (Resolve_Attribute, case Attribute_Access): For Ada_05, add test for
1743         whether the designated type is discriminated with a constrained partial
1744         view and require static matching in that case.
1745         Add local variable Des_Btyp. The Designated_Type
1746         of an access to incomplete subtype is either its non-limited view if
1747         coming from a limited with or its etype if regular incomplete subtype.
1748
1749         * sem_cat.ads, sem_cat.adb (Validate_Remote_Access_To_Class_Wide_Type):
1750         Fix predicate to identify and allow cases of (expander-generated)
1751         references to tag of designated object of a RACW.
1752         (Validate_Static_Object_Name): In Ada 2005, a formal object is
1753         non-static, and therefore cannot appear as a primary in a preelaborable
1754         package.
1755         (Has_Stream_Attribute_Definition): New subprogram, abstracted from
1756         Has_Read_Write_Attributes.
1757         (Has_Read_Write_Attributes): Reimplement in termes of
1758         Has_Stream_Attribute_Definition.
1759         (Missing_Read_Write_Attributes): When checking component types in a
1760         record, unconditionally call Missing_Read_Write_Attributes recursively
1761         (remove guard checking for Is_Record_Type / Is_Access_Type).
1762
1763 2006-10-31  Robert Dewar  <dewar@adacore.com>
1764
1765         * sem_ch11.adb (Analyze_Handled_Statements): Move final test for
1766         useless assignments here and conditionalize it on absence of exception
1767         handlers.
1768         (Analyze_Exception_Handlers): Small code reorganization of error
1769         detection code, for new handling of formal packages.
1770
1771 2006-10-31  Ed Schonberg  <schonberg@adacore.com>
1772             Hristian Kirtchev  <kirtchev@adacore.com>
1773         
1774         * sem_ch12.ads, sem_ch12.adb (Save_References): If node is an operator
1775         that has been constant-folded, preserve information of original tree,
1776         for ASIS uses.
1777         (Analyze_Formal_Derived_Type): Set the limited present flag of the newly
1778         generated private extension declaration if the formal derived type is
1779         synchronized. Carry synchronized present over to the generated private
1780         extension.
1781         (Validate_Derived_Type_Instance): Ensure that the actual of a
1782         synchronized formal derived type is a synchronized tagged type.
1783         (Instantiate_Formal_Package): When creating the instantiation used to
1784         validate the actual package of a formal declared without a box, check
1785         whether the formal itself depends on a prior actual.
1786         (Instantiate_Formal_Subprogram): Create new entities for the defining
1787         identifiers of the formals in the renaming declaration, for ASIS use.
1788         (Instantiate_Formal_Subprogram, Instantiate_Formal_Type): When creating
1789         a renaming declaration or a subtype declaration for an actual in an
1790         instance, capture location information of declaration in generic, for
1791         ASIS use.
1792         (Instantiate_Formal_Package): Add comments on needed additional tests.
1793         AI-317 (partial parametrization) is fully implemented.
1794         (Validate_Private_Type_Instance): Add check for actual which
1795         must have preelaborable initialization
1796         Use new // insertion for some continuation messages
1797         (Analyze_Formal_Object_Declaration): Change usage of Expression to
1798         Default_Expression. Add type retrieval when the declaration has an
1799         access definition. Update premature usage of incomplete type check.
1800         (Check_Access_Definition): New subsidiary routine. Check whether the
1801         current compilation version is Ada 05 and the supplied node has an
1802         access definition.
1803         (Instantiate object): Alphabetize local variables. Handle the creation
1804         of new renaming declarations with respect to the kind of definition
1805         used - either an access definition or a subtype mark. Guard against
1806         unnecessary error message in the context of anonymous access types after
1807         they have been resolved. Add check for required null exclusion in a
1808         formal object declaration.
1809         (Switch_View): A private subtype of a non-private type needs to be
1810         switched (the base type can have been switched without its private
1811         dependents because of the last branch of Check_Private_View.
1812         (Check_Private_View): Do not recompute Base_Type (T), instead use cached
1813         value from BT.
1814         (Instantiate_Type): Emit an error message whenever a class-wide type of
1815         a tagged incomplete type is used as a generic actual.
1816         (Find_Actual_Type): Extend routine to handle a component type in a child
1817         unit that is imported from a formal package in a parent.
1818         (Validate_Derived_Type_Instance): Check that analyzed formal and actual
1819         agree on constrainedness, rather than checking against ultimate ancestor
1820         (Instantiate_Subprogram_Body): Create a cross-reference link to the
1821         generic body, for navigation purposes.
1822
1823 2006-10-31  Robert Dewar  <dewar@adacore.com>
1824             Thomas Quinot  <quinot@adacore.com>
1825
1826         * sem_ch13.adb: Storage pool cannot be given for access to subprogram
1827         type.
1828         (New_Stream_Subprogram): When processing an attribute definition clause
1829         for a stream-oriented subprogram, record an entity node occurring at
1830         the point of clause to use for checking the visibility of the clause,
1831         as defined by 8.3(23) as amended by AI-195.
1832         (New_Stream_Subprogram): New procedure, factoring behaviour from both
1833          New_Stream_Function and New_Stream_Procedure.
1834         (New_Stream_Function, New_Stream_Procedure): Removed.
1835         (Analyze_Attribute_Definition_Clause, case Address): Check new
1836         Alignment_Check check
1837
1838 2006-10-31  Ed Schonberg  <schonberg@adacore.com>
1839             Javier Miranda  <miranda@adacore.com>
1840             Robert Dewar  <dewar@adacore.com>
1841
1842         * sem_ch4.adb (Try_Primitive_Operation): Code cleanup to ensure that we
1843         generate the same errors compiling under -gnatc.
1844         (Try_Object_Operation): If no candidate interpretation succeeds, but
1845         there is at least one primitive operation with the right name, report
1846         error in call rather than on a malformed selected component.
1847         (Analyze_Selected_Component): If the prefix is an incomplete type from
1848         a limited view, and the full view is available, use the full view to
1849         determine whether this is a prefixed call to a primitive operation.
1850         (Operator_Check): Verify that a candidate interpretation is a binary
1851         operation before checking the type of its second formal.
1852         (Analyze_Call): Add additional warnings for function call contexts not
1853         yet supported.
1854         (Analyze_Allocator): Move the check for "initialization not allowed for
1855         limited types" after analyzing the expression. This is necessary,
1856         because OK_For_Limited_Init looks at the structure of the expression.
1857         Before analysis, we don't necessarily know what sort of expression it
1858         is. For example, we don't know whether F(X) is a function call or an
1859         indexed component; the former is legal in Ada 2005; the latter is not.
1860         (Analyze_Allocator): Correct code for AI-287 -- extension aggregates
1861         were missing. We also didn't handle qualified expressions. Now also
1862         allow function calls. Use new common routine OK_For_Limited_Init.
1863         (Analyze_Type_Conversion): Do not perform some legality checks in an
1864         instance, because the error message will be redundant or spurious.
1865         (Analyze_Overloaded_Selected_Component): Do not do style check when
1866         setting an entity, since we do not know it is the right entity yet.
1867         (Analyze_Selected_Component): Move Generate_Reference call to Sem_Res
1868         (Analyze_Overloaded_Selected_Component): Same change
1869         (Analyze_Selected_Component): Remove unnecessary prefix type retrieval
1870         since regular incomplete subtypes are transformed into corresponding
1871         subtypes of their full views.
1872         (Complete_Object_Operation): Treat name of transformed subprogram call
1873         as coming from source, for browsing purposes.
1874         (Try_Primitive_Operation): If formal is an access parameter, compare
1875         with base type of object to determine whether it is a primitive
1876         operation.
1877         (Operator_Check): If no interpretation of the operator matches, check
1878         whether a use clause on any candidate might make the operation legal.
1879         (Try_Class_Wide_Operation): Check whether the first parameter is an
1880         access type whose designated type is class-wide.
1881
1882 2006-10-31  Robert Dewar  <dewar@adacore.com>
1883             Ed Schonberg  <schonberg@adacore.com>
1884             Gary Dismukes  <dismukes@adacore.com>
1885
1886         * sem_ch5.ads, sem_ch5.adb (Analyze_Loop_Statement): Add circuit to
1887         warn on infinite loops.
1888         Add \\ to some continuation messages
1889         (Analyze_Assignment_Statement): Call Warn_On_Useless_Assignment
1890         (Process_Bounds): If the bounds are integer literals that result from
1891         constant-folding, and they carry a user-defined type, preserve that type
1892         rather than treating this as an integer range.
1893         (Analyze_Exit_Statement): Test for E_Return_Statement in legality check.
1894         (Analyze_Goto_Statement): Test for E_Return_Stateemnt in legality check.
1895         (Analyze_Assignment_Statement): Add call to Check_Elab_Assign for
1896         left hand side of assignment.
1897         (Analyze_Assignment): Add suport to manage assigments to the attribute
1898         priority of a protected object.
1899         (Check_Possible_Current_Value_Condition): Allow fully qualified names
1900         not just identifiers.
1901         (Check_Possible_Current_Value_Condition): Acquire left operand of AND
1902         or AND THEN for possible tracking.
1903         (Analyze_Iteration_Scheme): Check for setting Current_Value for the
1904         case of while loops so we can track values in the loop body.
1905
1906 2006-10-31  Ed Schonberg  <schonberg@adacore.com>
1907             Hristian Kirtchev  <kirtchev@adacore.com>
1908             Bob Duff  <duff@adacore.com>
1909         
1910         * sem_ch6.ads, sem_ch6.adb (Analyze_Subprogram_Declaration): A null
1911         procedure cannot be a protected operation (it is a basic_declaration,
1912         not a subprogram_declaration).
1913         (Check_Overriding_Indicator): Rename formal Does_Override to Overridden_
1914         Subp. Add logic for entry processing.
1915         (Check_Synchronized_Overriding): New procedure in New_Overloaded_Entity.
1916         Determine whether an entry or subprogram of a protected or task type
1917         override an inherited primitive of an implemented interface.
1918         (New_Overloaded_Entity): Add calls to Check_Synchronized_Overriding.
1919         Update the actual used in calls to Check_Overriding_Indicator.
1920         (Analyze_Generic_Subprogram_Body): If the subprogram is a child unit,
1921         generate the proper reference to the parent unit, for cross-reference.
1922         (Analyze_Subprogram_Declaration): Protect Is_Controlling_Formal with
1923         Is_Formal.
1924         Add -gnatd.l --Use Ada 95 semantics for limited function returns,
1925         (Add_Extra_Formal): Revise procedure to allow passing in associated
1926         entity, scope, and name suffix, and handle setting of the new
1927         Extra_Formals field.
1928         (Create_Extra_Formals): Change existing calls to Add_Extra_Formal to
1929         pass new parameters. Add support for adding the new extra access formal
1930         for functions whose calls are treated as build-in-place.
1931         (Analyze_A_Return_Statement): Correct casing in error message.
1932         Move Pop_Scope to after Analyze_Function_Return, because an extended
1933         return statement really is a full-fledged scope. Otherwise, visibility
1934         doesn't work right. Correct use of "\" for continuation messages.
1935         (Analyze_Function_Return): Call Analyze on the Obj_Decl, rather than
1936         evilly trying to call Analyze_Object_Declaration directly. Otherwise,
1937         the node doesn't get properly marked as analyzed.
1938         (Analyze_Subprogram_Body): If subprogram is a function that returns
1939         an anonymous access type that denotes a task, build a Master Entity
1940         for it.
1941         (Analyze_Return_Type): Add call to Null_Exclusion_Static_Checks. Verify
1942         proper usage of null exclusion in a result definition.
1943         (Process_Formals): Code cleanup and new error message.
1944         (Process_Formals): Detect incorrect application of null exclusion to
1945         non-access types.
1946         (Conforming_Types): Handle conformance between [sub]types and itypes
1947          generated for entities that have null exclusions applied to them.
1948         (Maybe_Primitive_Operation): Add an additional type retrieval when the
1949          base type is an access subtype. This case arrises with null exclusions.
1950         (New_Overloaded_Entity): Do not remove the overriden entity from the
1951         homonym chain if it corresponds with an abstract interface primitive.
1952         (Process_Formals): Replace membership test agains Incomplete_Kind with a
1953         call to the synthesized predicate Is_Incomplete_Type.
1954         (Analyze_Subprogram_Body): Check wrong placement of abstract interface
1955         primitives.
1956         (Analyze_Subprogram_Declaration): Check that abstract interface
1957         primitives are abstract or null.
1958         (Analyze_Subprogram_Specification): Remove previous check for abstract
1959         interfaces because it was not complete.
1960         (Has_Interface_Formals): Removed.
1961
1962 2006-10-31  Ed Schonberg  <schonberg@adacore.com>
1963             Javier Miranda  <miranda@adacore.com>
1964
1965         * sem_ch7.adb (Check_Anonymous_Access_Types): New procedure, subsidiary
1966         of Analyze_Package_Body, to create Itype references for anonymous
1967         access types created in the package declaration, whose designated types
1968         may have only a limited view.
1969         (Analyze_Package_Specification): For the private part of a nested
1970         package, install private_with_clauses of enclosing compilation unit if
1971         we are in its visible part.
1972         (Declare_Inherited_Private_Subprograms): Complete barrier
1973         to ensure that the primitive operation has an alias to some parent
1974         primitive. This is now required because, after the changes done for the
1975         implementation of abstract interfaces, the contents of the list of
1976         primitives has entities whose alias attribute references entities of
1977         such list of primitives.
1978         (Analyze_Package_Specification): Simplify code that handles parent units
1979         of instances and formal packages.
1980         (Uninstall_Declarations): Check the convention consistency among
1981         primitive overriding operations of a tagged record type.
1982
1983 2006-10-31  Robert Dewar  <dewar@adacore.com>
1984             Hristian Kirtchev  <kirtchev@adacore.com>
1985             Javier Miranda  <miranda@adacore.com>
1986             Ed Schonberg  <schonberg@adacore.com>
1987         
1988         * sem_ch8.adb: Minor error msg rewording
1989         (Undefined): When checking for misspellings, invert arguments (to get
1990         expected and found set right)
1991         (Analyze_Subprogram_Renaming): Propagate Is_Pure, Is_Preelaborated
1992         (Analyze_Generic_Renaming): Same fix
1993         (Use_One_Package): Do not take into account the internal entities of
1994         abstract interfaces during the analysis of entities that are marked
1995         as potentially use-visible.
1996         (Find_Type): Handle the case of an attribute reference for
1997         implementation defined attribute Stub_Type (simply let the analysis of
1998         the attribute reference rewrite it).
1999         (Use_One_Type, End_Use_Type): Reject a reference to a limited view of a
2000         type that appears in a Use_Type clause.
2001         (Analyze_Object_Renaming): Add support for renaming of the Priority
2002         attribute.
2003         (Find_Type): In Ada 2005, a task type can be used within its own body,
2004         when it appears in an access definition.
2005         (Analyze_Object_Renaming): Remove warning on null_exclusion.
2006         (Analyze_Object_Renaming): Introduce checks for required null exclusion
2007          in a formal object declaration or in a subtype declaration.
2008         (Analyze_Subprogram_Renaming): Add call to Check_Null_Exclusion.
2009         (Check_Null_Exclusion): New local routine to
2010         Analyze_Subprogram_Renaming. Check whether the formals and return
2011         profile of a renamed subprogram have required null exclusions when
2012         their counterparts of the renaming already impose them.
2013         (In_Generic_Scope): New local routine to Analyze_Object_Renaming.
2014         Determine whether an entity is inside a generic scope.
2015         (In_Open_Scope): First pass of documentation update.
2016         (Find_Expanded_Name): Add support for shadow entities associated with
2017         limited withed packages. This is required to handle nested packages.
2018         (Analyze_Package_Renaming): Remove the restriction imposed by AI-217
2019         that makes a renaming of a limited withed package illegal.
2020
2021 2006-10-31  Hristian Kirtchev  <kirtchev@adacore.com>
2022             Ed Schonberg  <schonberg@adacore.com>
2023
2024         * sem_ch9.adb (Analyze_Protected_Definition): Remove call to
2025         Check_Overriding_Indicator.
2026         (Analyze_Task_Definition): Ditto.
2027         (Analyze_Protected_Type, Analyze_Task_Type): Code cleanup.
2028         (Check_Overriding_Indicator): To find overridden interface operation,
2029         examine only homonyms that have an explicit subprogram declaration, not
2030         inherited operations created by an unrelated type derivation.
2031         (Check_Overriding_Indicator): When checking for the presence of "null"
2032         in a procedure, ensure that the queried node is a procedure
2033         specification.
2034         (Matches_Prefixed_View_Profile): Add mechanism to retrieve the parameter
2035         type when the formal is an access to variable.
2036         (Analyze_Protected_Type): Add check for Preelaborable_Initialization
2037         (Analyze_Task_Type): Same addition
2038         (Analyze_Entry_Declaration): Call Generate_Reference_To_Formals, to
2039         provide navigation capabilities for entries.
2040
2041 2006-10-31  Hristian Kirtchev  <kirtchev@adacore.com>
2042             Ed Schonberg  <schonberg@adacore.com>
2043             Javier Miranda  <miranda@adacore.com>
2044             Gary Dismukes  <dismukes@adacore.com>
2045
2046         * sem_disp.adb (Check_Dispatching_Operation): Do not flag subprograms
2047         inherited from an interface ancestor by another interface in the
2048         context of an instance as 'late'.
2049         (Is_Tag_Indeterminate, Propagate_Tag): Handle properly the dereference
2050         of a call to a function that dispatches on access result.
2051         (Check_Dispatching_Operation): In case of late overriding of a primitive
2052         that covers abstract interface subprograms we register it in all the
2053         secondary dispatch tables associated with abstract interfaces.
2054         (Check_Dispatching_Call): Add check that a dispatching call is not made
2055         to a function with a controlling result of a limited type. This is a
2056         current implementation restriction.
2057         (Check_Controlling_Formal): Remove bogus checks for E.2.2(14).
2058         (Check_Dispatching_Operation): Do no emit a warning if the controlling
2059         argument is an interface type that is a generic formal.
2060         (Is_Interface_Subprogram): Removed.
2061         (Check_Dispatching_Operation): If the subprogram is not a dispatching
2062         operation, check the formals to handle the case in which it is
2063         associated with an abstract interface type.
2064
2065 2006-10-31  Robert Dewar  <dewar@adacore.com>
2066             Ed Schonberg  <schonberg@adacore.com>
2067
2068         * sem_elab.ads, sem_elab.adb (Check_Elab_Assign): New procedure
2069         Add new calls to this procedure during traversal
2070         (Activate_Elaborate_All_Desirable): Do not set elaboration flag on
2071         another unit if expansion is disabled.
2072
2073 2006-10-31  Robert Dewar  <dewar@adacore.com>
2074
2075         * sem_eval.adb (Compile_Time_Compare): Make use of information from
2076         Current_Value in the conditional case, to evaluate additional
2077         comparisons at compile time.
2078
2079 2006-10-31  Ed Schonberg  <schonberg@adacore.com>
2080             Hristian Kirtchev  <kirtchev@adacore.com>
2081             Javier Miranda  <miranda@adacore.com>
2082
2083         * sem_type.adb (Add_One_Interp): If node is an indirect call, preserve
2084         subprogram type to provide better diagnostics in case of ambiguity.
2085         (Covers): Handle coverage of formal and actual anonymous access types in
2086         the context of generic instantiation.
2087         (Covers/Interface_Present_In_Ancestors): Use the base type to manage
2088         abstract interface types; this is required to handle concurrent types
2089         with discriminants and abstract interface types.
2090         (Covers): Include type coverage of both regular incomplete subtypes and
2091         incomplete subtypes of incomplete type visibles through a limited with
2092         clause.
2093
2094 2006-10-31  Robert Dewar  <dewar@adacore.com>
2095             Hristian Kirtchev  <kirtchev@adacore.com>
2096             Ed Schonberg  <schonberg@adacore.com>
2097         
2098         * sem_util.ads, sem_util.adb (Enter_Name): Exclude -gnatwh warning
2099         messages for entities in packages which are not used.
2100         (Collect_Synchronized_Interfaces): New procedure.
2101         (Overrides_Synchronized_Primitive): New function.
2102         (Denotes_Discriminant): Extend predicate to apply to task types.
2103         Add missing continuation marks in error msgs
2104         (Unqualify): New function for removing zero or more levels of
2105         qualification from an expression. There are numerous places where this
2106         ought to be used, but we currently only deal properly with zero or one
2107         level.
2108         (In_Instance); The analysis of the actuals in the instantiation of a
2109         child unit is not within an instantiation, even though the parent
2110         instance is on the scope stack.
2111         (Safe_To_Capture_Value): Exclude the case of variables that are
2112         renamings.
2113         (Check_Obsolescent): Removed
2114         (Is_Aliased_View): A reference to an enclosing instance in an aggregate
2115         is an aliased view, even when rewritten as a reference to the target
2116         object in an assignment.
2117         (Get_Subprogram_Entity): New function
2118         (Known_To_Be_Assigned): New function
2119         (Type_Access_Level): Compute properly the access level of a return
2120         subtype that is an anonymous access type.
2121         (Explain_Limited_Type): Correct use of "\" for continuation messages.
2122         (Is_Transfer): The new extended_return_statement causes a transfer of
2123         control.
2124         (Has_Preelaborable_Initialization): New function
2125         (Has_Null_Exclusion): New function. Given a node N, determine whether it
2126         has a null exclusion depending on its Nkind.
2127         Change Is_Lvalue to May_Be_Lvalue
2128         (May_Be_Lvalue): Extensive additional code to deal with subprogram
2129         arguments (IN parameters are not Lvalues, IN OUT parameters are).
2130         (Safe_To_Capture_Value): Extend functionality so it can be used for
2131         the current value condition case.
2132         (Has_Compatible_Alignment): New function
2133         (Is_Dependent_Component_Of_Mutable_Object): Revise the tests for mutable
2134         objects to handle the Ada 2005 case, where aliasedness no longer implies
2135         that the object is constrained. In particular, for dereferenced names,
2136         the designated object must be assumed to be unconstrained.
2137         (Kill_Current_Values): Properly deal with the case where we encounter
2138         a loop in the scope chain.
2139         (Safe_To_Capture_Value): Do not let a loop stop us from capturing
2140         a value.
2141         (Compile_Time_Constraint_Error): Improve error message in error case
2142
2143         * exp_ch13.adb (Expand_N_Freeze_Entity): Remove the freezing node
2144         associated with entities of abstract interface primitives.
2145         Call Apply_Address_Clause_Check instead of Apply_Alignment_Check
2146
2147 2006-10-31  Robert Dewar  <dewar@adacore.com>
2148
2149         * s-osinte-tru64.adb: 
2150         Mark Asm statements Volatile to prevent warnings (seems a
2151         reasonable change anyway)
2152         Fixes new warnings
2153
2154         * s-mastop-irix.adb: Add Volatile to Asm statements
2155         Suppresses warning, and seems appropriate in any case
2156
2157         * s-osinte-vms.adb: Add Volatile to Asm statement
2158
2159         * s-vaflop-vms-alpha.adb: Add Volatile to Asm statements
2160
2161         * exp_code.ads, exp_code.adb (Asm_Input_Value): Note that Error can be
2162         returned.
2163         Add call to Check_Code_Statement
2164
2165 2006-10-31  Robert Dewar  <dewar@adacore.com>
2166             Ed Schonberg  <schonberg@adacore.com>
2167             Bob Duff  <duff@adacore.com>
2168
2169         * sinfo.ads, sinfo.adb (Set_Synchronized_Present,
2170         Synchronized_Present): Add Formal_Derived_Type_Definition and
2171         Private_Extension_Declaration to the list of assertions.
2172         (Is_Entry_Barrier_Function): New flag
2173         (Has_Self_Reference): New flag on aggregates, to indicate that they
2174         contain a reference to the enclosing type, inserted through a default
2175         initialization.
2176         (Next_Rep_Item): Move from Node4 to Node5.
2177         (Entity): Add this field for N_Attribute_Definition_Clause.
2178         (Comes_From_Extended_Return_Statement): New flag on N_Return_Statement
2179         (N_Return_Object_Declaration): Remove this node kind. We now use
2180         N_Object_Declaration instead.
2181         (Actual_Designated_Subtype): Move to a different place to make room in
2182         N_Extended_Return_Statement.
2183         (Procedure_To_Call): Move to a different place to make room in
2184         N_Extended_Return_Statement.
2185         (Return_Type): Removed this field to make room in return statements
2186         (both kinds).
2187         (Return_Statement_Entity): New field in return statements, in part to
2188         replace Return_Type, and in part to support the fact that return
2189         statements are now pushed on the scope stack during semantic analysis.
2190         (Return_Object_Declarations): New field to support extended return
2191         statements.
2192         (N_Extended_Return_Statement): New node for extended_return_statement
2193         nonterminal.
2194         (N_Return_Object_Declaration): New node for part of
2195         extended_return_statement nonterminal. Needed because all the necessary
2196         fields won't fit in N_Extended_Return_Statement.
2197         Generic_associations now carry the Box_Present flag, to indicate a
2198         default for an actual in a partially parametrized formal package.
2199
2200         * snames.h, snames.ads, snames.adb: Add definition for Validity_Check
2201         (Preset_Names): Add entries for Priority_Specific_Dispatching pragma
2202         and for the new predefined dispatching policies: EDF_Across_Priorities,
2203         Non_Preemptive_Within_Priorities, and Round_Robin_Within_Priorities.
2204         Introduce new name Stub_Type for implementation defined attribute.
2205         Add pragma Preelaborable_Initialization
2206         Add entry for Priority attribute.
2207         Add Pragma_Wide_Character_Encoding
2208         (Get_Convention_Name): Given a convention id, this function returns the
2209         corresponding name id from the names table.
2210
2211 2006-10-31  Ed Schonberg  <schonberg@adacore.com>
2212             Robert Dewar  <dewar@adacore.com>
2213             Bob Duff  <duff@adacore.com>
2214
2215         * sprint.adb (Sprint_Node_Actual, case Parameter_Specification): Do not
2216         print null exclusion twice in the case of an access definition,
2217         Implement new -gnatL switch
2218         Remove N_Return_Object_Declaration. We now use
2219         N_Object_Declaration instead. Implement the case for
2220         N_Extended_Return_Statement. Alphabetize the cases.
2221         Add cases for new nodes N_Extended_Return_Statement and
2222         N_Return_Object_Declaration. The code is not yet written.
2223         Update the output for N_Formal_Object_Declaration
2224         and N_Object_Renaming_Declaration.
2225         (Write_Itype): Account for the case of a modular integer subtype whose
2226         base type is private.
2227
2228 2006-10-31  Arnaud Charlet  <charlet@adacore.com>
2229
2230         * s-restri.ads, s-restri.adb: Mark this package as Preelaborate.
2231         Remove elaboration code, now done in the binder.
2232
2233         * s-rident.ads: Make this unit Preelaborate.
2234         (No_Restrictions): New constant used to clean up code and follow
2235         preelaborate constraints.
2236
2237         * s-stalib.adb: 
2238         Add System.Restrictions dependence, referenced directly from the
2239         binder generated file.
2240
2241 2006-10-31  Gary Dismukes  <dismukes@adacore.com>
2242
2243         * s-scaval.adb (Initialize): Add new Boolean flag AFloat that is set
2244         True when AAMP extended floating-point is in use (48-bit). Change type
2245         ByteLF to ByteLLF, add new array type ByteLF and condition the size of
2246         the two byte array types on AFloat. Change type of IV_Ilf overlay
2247         variable from Byte8 to ByteLF. Add appropriate initializations of
2248         floating-point overlays for AAMP cases.
2249
2250 2006-10-31  Javier Miranda  <miranda@adacore.com>
2251
2252         * s-tpoben.ads, s-tpoben.adb, s-taprob.ads, s-taprob.adb
2253         (Get_Ceiling): New subprogram that returns
2254         the ceiling priority of the protected object.
2255         (Set_Ceiling): New subprogram that sets the new ceiling priority of
2256         the protected object.
2257
2258         * s-tarest.adb: (Create_Restricted_Task): Fix potential CE.
2259
2260         * s-taskin.ads, s-taskin.adb: (Storage_Size): New function.
2261
2262 2006-10-31  Jose Ruiz  <ruiz@adacore.com>
2263
2264         * s-tpobop.adb (Requeue_Call): Introduce a dispatching point when
2265         requeuing to the same protected object to give higher priority tasks
2266         the opportunity to execute.
2267
2268 2006-10-31  Robert Dewar  <dewar@adacore.com>
2269
2270         * widechar.adb (Is_Start_Of_Wide_Char): In case of brackets encoding,
2271         add more precise check for the character sequence that follows '[' to
2272         avoid possible confusion in case if '[' is the last character of a
2273         string literals.
2274         (Scan_Wide): Always allow brackets encoding
2275
2276 2006-10-31  Olivier Hainque  <hainque@adacore.com>
2277
2278         * s-stchop.ads: make this unit preelaborate. This is desirable in
2279         general and made mandatory by the use of this unit by s-taprop which
2280         is itself preelaborate.
2281
2282         * s-stchop-vxworks.adb (Set_Stack_Info, Task_Descriptor type): Add
2283         Td_Events component.
2284
2285 2006-10-31  Vincent Celier  <celier@adacore.com>
2286
2287         * a-dirval-vms.adb (Invalid_Character): Specify that digits are allowed
2288         in file names.
2289
2290 2006-10-31  Vincent Celier  <celier@adacore.com>
2291
2292         * a-direct.ads, a-direct.adb (Search): New procedure in Ada 2005
2293
2294 2006-10-31  Vincent Celier  <celier@adacore.com>
2295
2296         * makegpr.adb (Check_Compilation_Needed): Take into account path names
2297         with spaces.
2298         (Check_Compilation_Needed): When checking a C or C++ source, do not
2299         resolve symbolic links.
2300         (Display_Command): New Boolean parameter Ellipse, defaulted to False.
2301         When not in verbose mode and Ellipse is True, display "..." for the
2302         first argument with Display set to False.
2303         (Build_Global_Archive): Always set Display True for the first object
2304         file. Call Display_Command with Ellipse set to True.
2305
2306 2006-10-31  Matt Heaney  <heaney@adacore.com>
2307
2308         * a-crbtgo.ads: Commented each subprogram
2309
2310         * a-crbtgo.adb: Added reference to book from which algorithms were
2311         adapted.
2312
2313         * a-crbtgk.ads, a-crbtgk.adb (Generic_Insert_Post): pass flag to
2314         indicate which child.
2315         (Generic_Conditional_Insert): changed parameter name from "Success" to
2316         "Inserted".
2317         (Generic_Unconditional_Insert_With_Hint): improved algorithm
2318
2319         * a-coorse.adb (Replace_Element): changed parameter name in call to
2320         conditional insert operation.
2321
2322         * a-convec.adb, a-coinve.adb (Insert): removed obsolete comment
2323
2324         * a-cohama.adb (Iterate): manipulate busy-bit here, instead of in
2325         Generic_Iteration
2326
2327         * a-ciorse.adb (Replace_Element): changed parameter name in call to
2328         conditional insert operation.
2329
2330         * a-cihama.adb (Iterate): manipulate busy-bit here, instead of in
2331         Generic_Iteration.
2332
2333         * a-cidlli.ads, a-cidlli.adb (Splice): Position param is now mode in
2334         instead of mode inout.
2335
2336         * a-chtgop.adb (Adjust): modified comments to reflect current AI-302
2337         draft
2338         (Generic_Read): preserve existing buckets array if possible
2339         (Generic_Write): don't send buckets array length anymore
2340
2341         * a-cdlili.ads, a-cdlili.adb (Splice): Position param is now mode in
2342         instead of mode inout.
2343
2344         * a-cihase.adb (Difference): iterate over smaller of Tgt and Src sets
2345         (Iterate): manipulate busy-bit here, instead of in Generic_Iteration
2346
2347         * a-cohase.adb (Difference): iterate over smaller of Tgt and Src sets
2348         (Iterate): manipulate busy-bit here, instead of in Generic_Iteration
2349         (Replace_Element): local operation is now an instantiation
2350
2351         * a-chtgke.ads, a-chtgke.adb (Generic_Conditional_Insert): manually
2352         check current length.
2353         (Generic_Replace_Element): new operation
2354
2355 2006-10-31  Doug Rupp  <rupp@adacore.com>
2356
2357         * g-trasym-vms-alpha.adb: Dummy_User_Act_Proc: New function.
2358         Call TBK$SYMBOLIZE without omitting parameters.
2359
2360 2006-10-31  Vincent Celier  <celier@adacore.com>
2361
2362         * symbols-processing-vms-ia64.adb,
2363         symbols-processing-vms-alpha.adb (Process): Do not include symbols
2364         that come from generic instantiations in bodies.
2365
2366 2006-10-31  Pat Rogers  <rogers@adacore.com>
2367
2368         * a-rttiev.ads, a-rttiev.adb: 
2369         This is a significant redesign primarily for the sake of automatic
2370         timer task termination but also to fix a design flaw.
2371         Therefore we are now using an RTS lock, instead of a protected
2372         object, to provide mutual exclusion to the queue of pending events
2373         and the type Timing_Event is no longer a protected type.
2374
2375 2006-10-31  Robert Dewar  <dewar@adacore.com>
2376             Cyrille Comar  <comar@adacore.com>
2377             Ben Brosgol  <brosgol@adacore.com>
2378
2379         * debug.adb:  Update flags documentation
2380
2381         * gnat_ugn.texi: Add documentation for new -gnatwq switch
2382         Clean up documentation for several other warning switches
2383         Clarify how task stack size can be specified with various
2384         versions of Windows.
2385         Add note that -gnatVo includes ranges including loops
2386         Add documentation for -gnatL switch
2387         Add note on elaboration warning for initializing variables
2388         Add documentation for new -gnatwt warning switch
2389         Document new form of pragma Warnings (On|Off, string)
2390         Add comment on use of pragma Warnings to control warnings
2391         Add documentation for -gnatjnn switch
2392         Modify section on interfacing with C for VMS 64-bit.
2393         Add doc for -gnatVe/E
2394         Add documentation of new warning flags -gnatww/-gnatwW
2395         Add warnings about address clause overlays to list of warnings
2396         (Exception Handling Control): Document that the option --RTS must be
2397         used consistently for gcc and gnatbind.
2398         Clarify that inlining is not always possible
2399         Update documentation on pragma Unchecked_Union.
2400
2401         * gnat_rm.texi: 
2402         Add documentation for new extended version of pragma Obsolescent
2403         Add documentation for implementation defined attribute 'Stub_Type.
2404         Add note on use of Volatile in asm statements
2405         Add documentation on use of pragma Unreferenced in context clause
2406         Document new form of pragma Warnings (On|Off, pattern)
2407         Document pragma Wide_Character_Encoding
2408         Add note that pragma Restrictions (No_Elaboration_Code) is only fully
2409         enforced if code generation is active.
2410         Add section on pragma Suppress to document GNAT specific check
2411         Alignment_Check
2412         Clarify difference between No_Dispatching_Calls & No_Dispatch.
2413         Add documentation for pragma Restrictions (No_Elaboration_Code)
2414
2415         * gnat-style.texi: 
2416         Add comments on layout of subprogram local variables in the
2417         presence of nested subprograms.
2418
2419         * ug_words: Resync.
2420
2421         * elists.ads: Minor reformatting
2422         Node returns Node_Or_Entity_Id (doc change only)
2423
2424         * xgnatugn.adb: Replace ACADEMICEDITION with GPLEDITION
2425
2426         * g-arrspl.ads (Create): Update comments.
2427
2428         * sem.ads: Add details on the handling of the scope stack.
2429
2430         * usage.adb: Update documentation.
2431
2432         * validsw.ads, validsw.adb: 
2433         Add definition of Validity_Check_Components and implement -gnatVe/E
2434
2435         * vms_data.ads: Add missing VMS qualifiers.
2436
2437         * s-addope.ads: Add documentation on overflow and divide by zero
2438
2439 2006-10-31  Robert Dewar  <dewar@adacore.com>
2440             Thomas Quinot  <quinot@adacore.com>
2441             Arnaud Charlet  <charlet@adacore.com>
2442
2443         * fmap.adb: Put routines in alpha order
2444
2445         * g-boumai.ads: Remove redundant 'in' keywords
2446
2447         * g-cgi.adb: Minor reformatting
2448
2449         * g-cgi.ads: Remove redundant 'in' keywords
2450
2451         * get_targ.adb: Put routines in alpha order
2452
2453         * prj-attr.ads: Minor reformatting
2454
2455         * s-atacco.ads: Minor reformatting
2456
2457         * scn.adb: Put routines in alpha order
2458
2459         * sinput-l.adb: Minor comment fix
2460
2461         * sinput-p.adb: Minor comment fix
2462
2463         * s-maccod.ads: Minor reformatting
2464
2465         * s-memory.adb: Minor reformatting
2466
2467         * s-htable.adb: Fix typo in comment.
2468
2469         * s-secsta.adb: Minor comment update.
2470
2471         * s-soflin.adb: Minor reformatting
2472
2473         * s-stoele.ads: 
2474         Add comment about odd qualification in Storage_Offset declaration
2475
2476         * s-strxdr.adb: 
2477         Remove unnecessary 'in' keywords for formal parameters.
2478
2479         * treeprs.adt: Minor reformatting
2480
2481         * urealp.adb: Put routines in alpha order
2482
2483         * s-wchcon.ads, s-wchcon.adb (Get_WC_Encoding_Method): New version
2484         taking string.
2485
2486         * s-asthan-vms-alpha.adb: Remove redundant 'in' keywords
2487
2488         * g-trasym-vms-ia64.adb: Remove redundant 'in' keywords
2489
2490         * env.c (__gnat_unsetenv): Unsetenv is unavailable on LynxOS, so
2491         workaround as on other platforms.
2492
2493         * g-eacodu-vms.adb: Remove redundant 'in' keywords
2494         * g-expect-vms.adb: Remove redundant 'in' keywords
2495
2496         * gnatdll.adb (Add_Files_From_List): Handle Name_Error and report a
2497         clear error message if the list-of-files file cannot be opened.
2498
2499         * g-thread.adb (Unregister_Thread_Id): Add use type Thread_Id so the
2500         equality operator is always visible.
2501
2502         * lang.opt: Woverlength-strings: New option.
2503
2504         * nmake.adt: 
2505         Update copyright, since nmake.ads and nmake.adb have changed.
2506
2507         * osint-b.ads, osint-b.adb (Time_From_Last_Bind): removed function .
2508         (Binder_Output_Time_Stamps_Set): removed.
2509         (Old_Binder_Output_Time_Stamp): idem.
2510         (New_Binder_Output_Time_Stamp): idem.
2511         (Recording_Time_From_Last_Bind): idem.
2512         (Recording_Time_From_Last_Bind): Make constant.
2513
2514         * output.ads, output.adb (Write_Str): Allow LF characters
2515         (Write_Spaces): New procedure
2516
2517         * prepcomp.adb (Preproc_Data_Table): Change Increment from 5% to 100%
2518
2519         * inline.adb: Minor reformatting
2520
2521         * s-asthan-vms-alpha.adb: Remove redundant 'in' keywords
2522
2523         * s-mastop-vms.adb: Remove redundant 'in' keywords
2524
2525         * s-osprim-vms.adb: Remove redundant 'in' keywords
2526
2527         * s-trafor-default.adb: Remove redundant 'in' keywords
2528
2529         * 9drpc.adb: Remove redundant 'in' keywords
2530
2531         * s-osinte-mingw.ads: Minor reformatting
2532
2533         * s-inmaop-posix.adb: Minor reformatting
2534
2535         * a-direio.ads: Remove quotes from Compile_Time_Warning message
2536
2537         * a-exexda.adb: Minor code reorganization
2538
2539         * a-filico.adb: Minor reformatting
2540
2541         * a-finali.adb: Minor reformatting
2542
2543         * a-nudira.ads: Remove quote from Compile_Time_Warning message
2544
2545         * a-numeri.ads: Minor reformatting
2546
2547         * a-sequio.ads: Remove quotes from Compile_Time_Warning message
2548
2549         * exp_pakd.ads: Fix obsolete comment
2550
2551         * a-ztenau.adb, a-ztenio.adb, a-wtenau.adb, a-tienau.adb,
2552         a-wtenio.adb (Put): Avoid assuming low bound of string is 1.
2553         Probably not a bug, but certainly neater and more efficient.
2554
2555         * a-tienio.adb: Minor reformatting
2556
2557         * comperr.adb (Compiler_Abort): Call Cancel_Special_Output at start
2558         Avoid assuming low bound of string is 1.
2559
2560         * gnatbind.adb: Change Bindusg to package and rename procedure as
2561         Display, which now ensures that it only outputs usage information once.
2562         (Scan_Bind_Arg): Avoid assuming low bound of string is 1.
2563
2564         * g-pehage.adb (Build_Identical_Keysets): Replace use of 1 by
2565         Table'First.
2566
2567         * g-regpat.adb (Insert_Operator): Add pragma Warnings (Off) to kill
2568         warning.
2569         (Match): Add pragma Assert to ensure that Matches'First is zero
2570
2571         * g-regpat.ads (Match): Document that Matches lower bound must be zero
2572
2573         * makeutl.adb (Is_External_Assignment): Add pragma Assert's to check
2574         documented preconditions (also kills warnings about bad indexes).
2575
2576         * mdll.adb (Build_Dynamic_Library): Avoid assumption that Afiles'First
2577         is 1.
2578         (Build_Import_Library): Ditto;
2579
2580         * mdll-utl.adb: (Gnatbind): Avoid assumption that Alis'First = 1
2581
2582         * rtsfind.adb (RTE_Error_Msg): Avoid assuming low bound of string is 1.
2583
2584         * sem_case.adb (Analyze_Choices): Add pragma Assert to check that
2585         lower bound of choice table is 1.
2586
2587         * sem_case.ads (Analyze_Choices): Document that lower bound of
2588         Choice_Table is 1.
2589
2590         * s-imgdec.adb (Set_Decimal_Digits): Avoid assuming low bound of
2591         string is 1.
2592
2593         * uintp.adb (Init_Operand): Document that low bound of Vec is always 1,
2594         and add appropriate Assert pragma to suppress warnings.
2595
2596         * atree.h, atree.ads, atree.adb
2597         Change Elist24 to Elist25
2598         Add definitions of Field28 and Node28
2599         (Traverse_Field): Use new syntactic parent table in sinfo.
2600
2601         * cstand.adb: Change name Is_Ada_2005 to Is_Ada_2005_Only
2602
2603         * itypes.adb: Change name Is_Ada_2005 to Is_Ada_2005_Only
2604
2605         * exp_tss.adb: Put routines in alpha order
2606
2607         * fe.h: Remove redundant declarations.
2608
2609 2006-10-23 Rafael Avila de Espindola  <rafael.espindola@gmail.com>
2610         * utils.c (builtin_function): Rename to gnat_builtin_function.
2611         Move common code to add_builtin_function.
2612         * misc.c (LANG_HOOKS_BUILTIN_FUNCTION): Define as
2613         gnat_builtin_function.
2614         * gigi.h (builtin_function): Rename to gnat_builtin_function.
2615         Change the signature.
2616
2617 2006-10-16  Brooks Moses  <bmoses@stanford.edu>
2618
2619         * Makefile.in: Add TEXI2PDF definition.
2620         * Make-lang.in: Add "ada.pdf" target.
2621
2622 2006-10-03  Kazu Hirata  <kazu@codesourcery.com>
2623
2624         * decl.c, utils.c: Fix comment typos.
2625         * utils.c: Fix a typo.
2626
2627 2006-09-28  Eric Botcazou  <ebotcazou@adacore.com>
2628
2629         * decl.c (gnat_to_gnu_entity) <E_Procedure>: Do not set "const" flag
2630         on "pure" Ada subprograms if SJLJ exceptions are used.
2631         * trans.c (Handled_Sequence_Of_Statements_to_gnu): Set TREE_NO_WARNING
2632         on the declaration node of JMPBUF_SAVE.
2633         * utils.c (init_gigi_decls): Set DECL_IS_PURE on the declaration nodes
2634         of Get_Jmpbuf_Address_Soft and Get_GNAT_Exception.
2635         * utils2.c (build_call_0_expr): Do not set TREE_SIDE_EFFECTS.
2636
2637 2006-08-20  Laurent GUERBY  <laurent@guerby.net>
2638
2639         PR ada/28716
2640         g-socket.adb (Bind_Socket): Call Set_Address.
2641
2642 2006-09-15  Eric Botcazou  <ebotcazou@adacore.com>
2643
2644         PR ada/15802
2645         * decl.c (same_discriminant_p): New static function.
2646         (gnat_to_gnu_entity) <E_Record_Type>: When there is a parent
2647         subtype and we have discriminants, fix up the COMPONENT_REFs
2648         for the discriminants to make them reference the corresponding
2649         fields of the parent subtype after it has been built.
2650
2651 2006-09-15  Roger Sayle  <roger@eyesopen.com>
2652
2653         PR ada/18817
2654         * utils.c (max_size): Perform constant folding of (A ? B : C) - D
2655         into A ? B - D : C - D when calculating the size of a MINUS_EXPR.
2656
2657 2006-09-13  Olivier Hainque  <hainque@adacore.com>
2658
2659         PR ada/29025
2660         * trans.c (gnat_gimplify_expr) <ADDR_EXPR>: When taking the address
2661         of a SAVE_EXPR, just make the operand addressable/not-readonly and
2662         let the common gimplifier code make and propagate a temporary copy.
2663         (call_to_gnu): Clarify the use of SAVE_EXPR for not addressable
2664         out/in-out actuals and defer setting the addressable/readonly bits
2665         to the gimplifier.
2666
2667 2006-09-13  Eric Botcazou  <ebotcazou@adacore.com>
2668
2669         PR ada/28591
2670         * decl.c (components_to_record): Defer emitting debug info for the
2671         record type associated with the variant until after we are sure to
2672         actually use it.
2673
2674 2006-09-13  Eric Botcazou  <ebotcazou@adacore.com>
2675
2676         PR ada/21952
2677         * gigi.h (gnat_internal_attribute_table): Declare.
2678         * misc.c (LANG_HOOKS_ATTRIBUTE_TABLE): Define to above.
2679         * utils.c (gnat_internal_attribute_table): New global variable.
2680         (builtin_function): Always call decl_attributes on the builtin.
2681         (handle_const_attribute): New static function.
2682         (handle_nothrow_attribute): Likewise.
2683
2684 2006-07-28  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
2685
2686         * Make-lang.in: Use $(HEADER_H) instead of header.h in dependencies.
2687
2688 2006-06-23  Olivier Hainque  <hainque@adacore.com>
2689
2690         * misc.c (gnat_type_max_size): Look at TYPE_ADA_SIZE if we have
2691         not been able to get a constant upper bound from TYPE_SIZE_UNIT.
2692
2693 2006-06-20  James A. Morrison  <phython@gcc.gnu.org>
2694             Eric Botcazou  <ebotcazou@adacore.com>
2695
2696         PR ada/18692
2697         * Make-lang.in: Add check-gnat to lang_checks.  Rename existing
2698         check-gnat into check-acats.
2699
2700 2006-06-17  Karl Berry  <karl@gnu.org>
2701
2702         * gnat-style.texi (@dircategory): Use "Software development"
2703         instead of "Programming", following the Free Software Directory.
2704
2705 2006-06-12  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2706
2707         PR ada/27944
2708         * s-taprop-hpux-dce.adb: Delete redundant 'with System.Parameters'.
2709
2710 2006-06-06  Laurent GUERBY  <laurent@guerby.net>
2711
2712         PR ada/27769
2713         mlib-utl.adb: Use Program_Name.
2714         
2715 2006-05-28  Kazu Hirata  <kazu@codesourcery.com>
2716
2717         * decl.c, env.c, gigi.h, init.c, initialize.c, raise-gcc.c,
2718         sem_ch13.adb, sysdep.c, targtyps.c, tb-alvxw.c, tracebak.c,
2719         trans.c, utils.c: Fix comment typos.  Follow spelling
2720         conventions.
2721         * gnat_rm.texi, gnat_ugn.texi, : Fix typos.  Follow spelling
2722         conventions.
2723
2724 2006-05-19  Nicolas Setton  <setton@adacore.com>
2725
2726         * misc.c (gnat_dwarf_name): New function.
2727         (LANG_HOOKS_DWARF_NAME): Define to it.
2728
2729 2006-05-14  H.J. Lu  <hongjiu.lu@intel.com>
2730
2731         * Make-lang.in (ada/decl.o): Replace target.h with $(TARGET_H).
2732         (ada/misc.o): Likewise.
2733         (ada/utils.o): Likewise.
2734
2735 2006-04-08  Aurelien Jarno  <aurel32@debian.org>
2736
2737         * Makefile.in: Add Ada support for GNU/kFreeBSD.
2738         * s-osinte-kfreebsd-gnu.ads: New file.
2739
2740 2006-03-29  Carlos O'Donell  <carlos@codesourcery.com>
2741
2742         * Make-lang.in: Rename docdir to gcc_docdir.
2743
2744 2006-03-04  Eric Botcazou  <ebotcazou@adacore.com>
2745
2746         * gigi.h (get_ada_base_type): Delete.
2747         * utils2.c (get_ada_base_type): Likewise.
2748         * trans.c (convert_with_check): Operate in the real base type.
2749
2750 2006-03-03  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2751
2752         * uintp.adb (Num_Bits): Handle Uint_Int_First specially.
2753
2754 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
2755
2756         * utils.c (create_var_decl): Use have_global_bss_p when deciding
2757         whether to make the decl common.
2758
2759 2006-02-20 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
2760
2761         * Make-lang.in (Ada): Remove
2762         (.PHONY): Remove Ada
2763
2764 2006-02-17  Ed Schonberg  <schonberg@adacore.com>
2765
2766         * sem_ch4.adb (Find_Boolean_Types): If one of the operands is an
2767         aggregate, check the interpretations of the other operand to find one
2768         that may be a boolean array.
2769
2770         (Analyze_Selected_Component): Fix flow-of-control typo in case where
2771         the prefix is a private extension.
2772
2773 2006-02-17  Eric Botcazou  <botcazou@adacore.com>
2774
2775         PR ada/26315
2776
2777         * utils2.c (find_common_type): If both input types are BLKmode and
2778         have the same constant size, keep using the first one.
2779
2780         * bindgen.adb: (Gen_Versions_Ada): Revert previous workaround.
2781
2782         * decl.c (gnat_to_gnu_entity): Only check TREE_OVERFLOW for a constant.
2783
2784         * misc.c (gnat_handle_option): New case for -Woverlength-strings.
2785
2786 2006-02-17  Jose Ruiz  <ruiz@adacore.com>
2787
2788         * s-taprop-irix.adb, s-taprop-hpux-dce.adb, s-taprop-linux.adb, 
2789         s-taprop-solaris.adb, s-taprop-vms.adb, s-taprop-mingw.adb, 
2790         s-taprop-posix.adb, s-taprop-vxworks.adb, s-taprop-lynxos.adb, 
2791         s-taprop-tru64.adb (Set_False, Set_True, Suspend_Until_True): Add
2792         Abort_Defer/Undefer pairs to avoid the possibility of a task being
2793         aborted while owning a lock.
2794
2795 2006-02-17  Javier Miranda  <miranda@adacore.com>
2796             Robert Dewar  <dewar@adacore.com>
2797
2798         * exp_ch4.adb (Expand_N_Allocator): If the allocated object is accessed
2799         through an access to class-wide interface we force the displacement of
2800         the pointer to the allocated object to reference the corresponding
2801         secondary dispatch table.
2802         (Expand_N_Op_Divide): Allow 64 bit divisions by small power of 2,
2803         if Long_Shifts are supported on the target, even if 64 bit divides
2804         are not supported (configurable run time mode).
2805         (Expand_N_Type_Conversion): Do validity check if validity checks on
2806         operands are enabled.
2807         (Expand_N_Qualified_Expression): Do validity check if validity checks
2808         on operands are enabled.
2809
2810 2006-02-17  Ed Schonberg  <schonberg@adacore.com>
2811
2812         * exp_dbug.adb (Debug_Renaming_Declaration): Indicate that the entity
2813         must be materialized when the renamed expression is an explicit
2814         dereference.
2815
2816 2006-02-17  Ed Schonberg  <schonberg@adacore.com>
2817
2818         * freeze.adb (Statically_Discriminated_Components): Return false if
2819         the bounds of the type of the discriminant are not static expressions.
2820
2821         * sem_aggr.adb (Check_Static_Discriminated_Subtype): Return false if
2822         the bounds of the discriminant type are not static.
2823
2824 2006-02-17  Robert Dewar  <dewar@adacore.com>
2825
2826         * g-os_lib.adb (Copy_File): Make sure that if From has an Invalid_FD,
2827         then we close To if it is valid.
2828
2829 2006-02-17  Vasiliy Fofanov  <fofanov@adacore.com>
2830
2831         * init.c (facility_resignal_table): new array
2832         (__gnat_default_resignal_p): enhance default predicate to resignal if
2833         VMS condition has one of the predefined facility codes.
2834
2835 2006-02-17  Vasiliy Fofanov  <fofanov@adacore.com>
2836
2837         * Makefile.in: Use VMS64 specialized versions of several units in
2838         Interfaces.C hierarchy to be compatible with HP C default size choices.
2839         Use the default version of Ada.Synchronous_Task_Control for VxWorks 653.
2840
2841 2006-02-17  Ed Schonberg  <schonberg@adacore.com>
2842
2843         * sem_ch10.adb (Analyze_With_Clause): If the unit is a subprogram
2844         instantiation, the corresponding entity is the related_instance of the
2845         wrapper package created for the instance.
2846
2847 2006-02-17  Ed Schonberg  <schonberg@adacore.com>
2848
2849         * sem_ch12.adb (Analyze_Package_Instantiation): Inline_Now is false if
2850         the current instance is nested within another instance in a child unit.
2851
2852 2006-02-17  Javier Miranda  <miranda@adacore.com>
2853             Ed Schonberg  <schonberg@adacore.com>
2854
2855         * sem_ch3.adb (Build_Discriminated_Subtype): In case of concurrent
2856         type we cannot inherit the primitive operations; we inherit the
2857         Corresponding_Record_Type (which has the list of primitive operations).
2858         (Check_Anonymous_Access_Types): When creating anonymous access types for
2859         access components, use Rewrite in order to preserve the tree structure,
2860         for ASIS use.
2861         (Analyze_Object_Declaration): For limited types with access
2862         discriminants with defaults initialized by an aggregate, obtain
2863         subtype from aggregate as for other mutable types.
2864         (Derived_Type_Declaration): If the derived type is a limited interface,
2865         set the corresponding flag (Is_Limited_Record is not sufficient).
2866
2867 2006-02-17  Ed Schonberg  <schonberg@adacore.com>
2868
2869         * sem_ch6.adb (Build_Body_To_Inline): Enforce the rule that in order
2870         to inline a function that returns an unconstrained type, the return
2871         expression must be the first variable declared in the body of the
2872         function.
2873
2874 2006-02-17  Javier Miranda  <miranda@adacore.com>
2875
2876         * sem_res.adb (Resolve_Type_Conversion): In case of conversion to an
2877         abstract interface type, the static analysis is not enough to know if
2878         the interface is implemented or not by the source tagged type. Hence
2879         we must pass the work to the expander to generate the required code to
2880         evaluate the conversion at run-time.
2881         (Resolve_Equality_Op): Do not apply previous
2882         transformation if expansion is disasbled, to prevent anomalies when
2883         locating global references in a generic unit.
2884
2885 2006-02-17  Vincent Celier  <celier@adacore.com>
2886
2887         * snames.ads, snames.adb: New standard names for new project attributes:
2888         archive_builder, archive_indexer, compiler_pic_option,
2889         config_body_file_name, config_body_file_name_pattern,
2890         config_file_switches, config_file_unique, config_spec_file_name,
2891         config_spec_file_name_pattern, default_builder_switches,
2892         default_global_compiler_switches, default_language,
2893         dependency_file_kind, global_compiler_switches, include_path,
2894         include_path_file, language_kind, linker_executable_option,
2895         linker_lib_dir_option, linker_lib_name_option, mapping_file_switches,
2896         roots, runtime_project.
2897
2898 2006-02-17  Matthew Heaney  <heaney@adacore.com>
2899
2900         * a-convec.ads, a-convec.adb: 
2901         (operator "&"): handle potential overflow for large index types
2902         (Insert): removed Contraint_Error when using large index types
2903         (Insert_Space): removed Constraint_Error for large index types
2904         (Length): moved constraint check from Length to Insert
2905
2906         * a-coinve.ads, a-coinve.adb: Stream attribute procedures are declared
2907         as not null access.
2908         Explicit raise statements now include an exception message.
2909         (operator "&"): handle potential overflow for large index types
2910         (Insert): removed Contraint_Error when using large index types
2911         (Insert_Space): removed Constraint_Error for large index types
2912         (Length): moved constraint check from Length to Insert
2913
2914 2006-02-17  Robert Dewar  <dewar@adacore.com>
2915
2916         * s-wchcnv.adb: Document handling of [ on output (we do not change
2917         this to ["5B"] and the new comments say why not.
2918
2919         * gnat_ugn.texi: 
2920         Add note for -gnatVo that this now includes the cases of type
2921         conversions and qualified expressions.
2922         Add comments on handling of brackets encoding for Text_IO
2923
2924 2006-02-17  Ramon Fernandez  <fernandez@adacore.com>
2925             Thomas Quinot  <quinot@adacore.com>
2926             Robert Dewar  <dewar@adacore.com>
2927             Javier Miranda  <miranda@adacore.com>
2928
2929         * expander.adb: Fix typo in comment
2930
2931         * exp_pakd.adb: Fix typo
2932         Minor comment reformatting.
2933
2934         * g-dyntab.adb: Minor reformatting
2935
2936         * exp_ch6.adb (Register_Interface_DT_Entry): Traverse the list of
2937         aliased subprograms to look for the abstract interface subprogram.
2938
2939 2006-02-16  Eric Botcazou  <ebotcazou@adacore.com>
2940
2941         * env.c (__gnat_setenv): Use size_t.
2942         (__gnat_unsetenv): Likewise.
2943         (__gnat_clearenv): Likewise.
2944
2945 2006-02-16  Arnaud Charlet  <charlet@adacore.com>
2946
2947         * opt.ads (Ada_Version_Default): Set to Ada 2005 by default.
2948
2949 2006-02-13  Arnaud Charlet  <charlet@adacore.com>
2950
2951         * a-intnam-os2.ads, a-intnam-unixware.ads, g-soccon-unixware.ads,
2952         g-soliop-unixware.ads, i-os2err.ads, i-os2lib.adb, i-os2lib.ads,
2953         i-os2syn.ads, i-os2thr.ads, s-intman-irix-athread.adb,
2954         s-osinte-aix-fsu.ads, s-osinte-fsu.adb, s-parame-os2.adb,
2955         s-osinte-irix-athread.ads, s-osinte-linux-fsu.ads, s-osinte-os2.adb,
2956         s-osinte-os2.ads, s-osinte-solaris-fsu.ads, s-osinte-unixware.adb,
2957         s-osinte-unixware.ads, s-osprim-os2.adb, s-taprop-irix-athread.adb,
2958         s-taprop-os2.adb, s-tasinf-irix-athread.adb, s-tasinf-irix-athread.ads,
2959         s-taspri-os2.ads, system-os2.ads, system-unixware.ads: Removed,
2960         no longer used.
2961
2962 2006-02-13  Jose Ruiz  <ruiz@adacore.com>
2963
2964         * a-taster.adb (Current_Task_Fallback_Handler): Document why explicit
2965         protection against race conditions is not needed.
2966         (Set_Dependents_Fallback_Handler): Add mutual exclusive access to the
2967         fallback handler.
2968         (Set_Specific_Handler): Add mutual exclusive access to the specific
2969         handler.
2970         (Specific_Handler): Add mutual exclusive access for retrieving the
2971         specific handler.
2972
2973         * s-tarest.adb (Task_Wrapper): Add mutual exclusive access to the fall
2974         back handler.
2975
2976         * s-taskin.ads (Common_ATCB): Remove pragma Atomic for
2977         Fall_Back_Handler and Specific_Handler.
2978
2979         * s-tassta.adb (Task_Wrapper): Add mutual exclusive access to the task
2980         termination handlers.
2981         Set two different owerflow depending on the maximal stack size.
2982
2983         * s-solita.adb (Task_Termination_Handler_T): Document why explicit
2984         protection against race conditions is not needed when executing the
2985         task termination handler.
2986
2987 2006-02-13  Robert Dewar  <dewar@adacore.com>
2988
2989         * s-gloloc-mingw.adb, a-cgaaso.ads, a-stzmap.adb, a-stzmap.adb,
2990         a-stzmap.ads, a-ztcoio.adb, a-ztedit.adb, a-ztedit.ads, a-ztenau.adb,
2991         a-ztenau.ads, a-colien.adb, a-colien.ads, a-colire.adb, a-colire.ads,
2992         a-comlin.adb, a-decima.adb, a-decima.ads, a-direio.adb, a-direio.adb,
2993         a-direio.adb, a-direio.ads, a-ngcoty.adb, a-ngcoty.ads, a-nuflra.adb,
2994         a-nuflra.ads, a-sequio.adb, a-sequio.ads, a-sequio.ads, a-storio.ads,
2995         a-stream.ads, a-ststio.adb, a-ststio.adb, a-ststio.ads, a-ststio.ads,
2996         a-stwima.adb, a-stwima.adb, a-stwima.ads, a-stwise.adb, a-teioed.adb,
2997         a-teioed.ads, a-ticoau.adb, a-ticoau.ads, a-ticoio.adb, a-tasatt.ads,
2998         a-tideau.adb, a-tideau.ads, a-tideio.adb, a-tideio.ads, a-tienau.adb,
2999         a-tienau.ads, a-tienio.adb, a-tienio.ads, a-tifiio.ads, a-tiflau.adb,
3000         a-tiflau.ads, a-tiflio.adb, a-tiflio.adb, a-tiflio.ads, a-tigeau.ads,
3001         a-tiinau.adb, a-tiinau.ads, a-tiinio.adb, a-tiinio.ads, a-timoio.adb,
3002         a-timoio.ads, a-titest.adb, a-titest.ads, a-wtcoio.adb, a-wtdeau.adb,
3003         a-wtdeau.ads, a-wtdeio.adb, a-wtdeio.ads, a-wtedit.adb, a-wtedit.adb,
3004         a-wtedit.ads, a-wtenau.adb, a-wtenau.ads, a-wtenau.ads, a-wtenio.adb,
3005         a-wtenio.ads, a-wtfiio.adb, a-wtfiio.ads, a-wtflau.adb, a-wtflau.ads,
3006         a-wtflio.adb, a-wtflio.adb, a-wtflio.ads, a-wtgeau.ads, a-wtinau.adb,
3007         a-wtinau.ads, a-wtinio.adb, a-wtinio.ads, a-wtmoau.adb, a-wtmoau.ads,
3008         a-wtmoio.adb, a-wtmoio.ads, xref_lib.adb, xref_lib.ads, xr_tabls.adb,
3009         g-boubuf.adb, g-boubuf.ads, g-cgideb.adb, g-io.adb, gnatdll.adb,
3010         g-pehage.adb, i-c.ads, g-spitbo.adb, g-spitbo.ads, mdll.adb,
3011         mlib-fil.adb, mlib-utl.adb, mlib-utl.ads, prj-env.adb, prj-tree.adb,
3012         prj-tree.ads, prj-util.adb, s-arit64.adb, s-asthan.ads, s-auxdec.adb,
3013         s-auxdec.ads, s-chepoo.ads, s-direio.adb, s-direio.ads, s-errrep.adb,
3014         s-errrep.ads, s-fileio.adb, s-fileio.ads, s-finroo.adb, s-finroo.ads,
3015         s-gloloc.adb, s-gloloc.ads, s-io.adb, s-io.ads, s-rpc.adb,
3016         s-rpc.ads, s-shasto.ads, s-sequio.adb, s-stopoo.ads, s-stratt.adb,
3017         s-stratt.ads, s-taasde.adb, s-taasde.ads, s-tadert.adb, s-sequio.ads,
3018         s-taskin.adb, s-tasque.adb, s-tasque.ads, s-wchjis.ads, makegpr.adb,
3019         a-coinve.adb, a-cidlli.adb, eval_fat.adb, exp_dist.ads, exp_smem.adb,
3020         fmap.adb, g-dyntab.ads, g-expect.adb, lib-xref.ads, osint.adb,
3021         par-load.adb, restrict.adb, sinput-c.ads, a-cdlili.adb,
3022         system-vms.ads, system-vms-zcx.ads, system-vms_64.ads: Minor
3023         reformatting.
3024
3025 2006-02-13  Hristian Kirtchev  <kirtchev@adacore.com>
3026
3027         * a-tasatt.adb, s-osinte-lynxos-3.adb, s-osinte-lynxos.adb,
3028         s-osinte-aix.adb, s-interr-sigaction.adb, s-asthan-vms-alpha.adb,
3029         s-interr-vms.adb, s-intman-vms.adb, s-interr-vxworks.adb,
3030         s-intman-vxworks.adb, s-asthan-vms-alpha.adb, a-ztexio.adb,
3031         a-reatim.adb, a-taside.adb, a-textio.adb, a-witeio.adb, prj-attr.adb,
3032         s-intman-irix.adb, s-intman-solaris.adb, s-intman-posix.adb,
3033         a-dynpri.adb, a-interr.adb, g-dynhta.adb, s-asthan.adb, s-interr.adb,
3034         s-pooglo.adb, s-pooloc.adb, s-poosiz.adb, s-tasren.adb, s-tasuti.adb,
3035         s-tataat.adb, s-tpobop.adb: Remove redundant with clauses.
3036
3037 2006-02-13  Arnaud Charlet  <charlet@adacore.com>
3038
3039         * s-osinte-darwin.adb, s-osinte-darwin.ads, s-osinte-vxworks.ads, 
3040         s-osinte-solaris.ads, s-osinte-linux.ads, s-osinte-freebsd.ads, 
3041         s-osinte-solaris-posix.ads, s-osinte-lynxos-3.ads, s-osinte-lynxos.ads, 
3042         s-osinte-tru64.ads, s-osinte-aix.ads, s-osinte-irix.ads, 
3043         s-osinte-hpux-dce.ads, s-osinte-linux-hppa.ads, 
3044         s-osinte-linux-alpha.ads, s-inmaop-posix.adb (sigset_t_ptr): Removed,
3045         replaced by anonymous access type.
3046         (pthread_sigmask): Now take an access sigset_t
3047
3048         * s-osinte-hpux.ads:  Ditto.
3049         (pthread_mutex_t, pthread_cond_t): Update definitions to support
3050         properly 32 and 64 bit ABIs.
3051
3052 2006-02-13  Pascal Obry  <obry@adacore.com>
3053
3054         * s-taprop-posix.adb, s-taprop-vxworks.adb, s-taprop-tru64.adb, 
3055         s-taprop-lynxos.adb, s-taprop-irix.adb, s-taprop-hpux-dce.adb, 
3056         s-taprop-linux.adb, s-taprop-solaris.adb,
3057         s-taprop-vms.adb (Create_Task): Remove task adjustment code. This
3058         adjustement is already done when calling this routine.
3059
3060 2006-02-13  Pascal Obry  <obry@adacore.com>
3061
3062         * system-mingw.ads (Underlying_Priorities): Update the priority mapping
3063         table to take advantage of the 16 priority levels available on Windows
3064         2000 and XP. On NT4 there are only 7 priority levels, this is properly
3065         supported by this new mapping.
3066
3067 2006-02-13  Nicolas Setton  <setton@adacore.com>
3068
3069         * adadecode.h, adadecode.c: (__gnat_decode): Improve support of types.
3070         (get_encoding): New subprogram. Extracts the encodings from an encoded
3071         Ada name.
3072
3073 2006-02-13  Pascal Obry  <obry@adacore.com>
3074             Nicolas Roche  <roche@adacore.com>
3075             Arnaud Charlet  <charlet@adacore.com>
3076
3077         * adaint.h, adaint.c (DIR_SEPARATOR): Use _T() macro for Unicode
3078         support.
3079         (__gnat_try_lock): Add unicode support by using a specific section on
3080         Windows.
3081         (__gnat_get_current_dir): Idem.
3082         (__gnat_open_read): Idem.
3083         (__gnat_open_rw): Idem.
3084         (__gnat_open_create): Idem.
3085         (__gnat_create_output_file): Idem.
3086         (__gnat_open_append): Idem.
3087         (__gnat_open_new): Idem.
3088         (__gnat_file_time_name): Idem.
3089         (__gnat_set_file_time_name): Idem.
3090         (__gnat_stat): Idem.
3091         (win32_no_block_spawn): Idem.
3092         (__gnat_locate_exec_on_path): Idem.
3093         (__gnat_opendir): New routine.
3094         (__gnat_closedir): Idem.
3095         (__gnat_readdir): Add new parameter length (pointer to int). Update
3096         implementation to use it and add specific Win32 code for Unicode
3097         support.
3098         (__gnat_get_env_value_ptr): Remove. Replaced by __gnat_getenv in env.c
3099         (__gnat_set_env_value): Remove. Replaced by __gnat_setenv in env.c
3100         (convert_addresses): Do not define this dummy routine on VMS.
3101
3102         * mingw32.h (GNAT_UNICODE_SUPPORT): New definition, if set the GNAT
3103         runtime Unicode support will be activated.
3104         (S2WS): String to Wide-String conversion. This version just copy a
3105         string in non Unicode version.
3106         (WS2S): Wide-String to String conversion. This version just copy a
3107         string in non Unicode version.
3108
3109         * g-dirope.adb: (Close): Now import __gnat_closedir from adaint.c.
3110         (Open): Now import __gnat_opendir from adaint.c.
3111         (Read): Change the implementation to support unicode characters. It is
3112         not possible to use strlen() on Windows as this version supports only
3113         standard ASCII characters. So the length of the directory entry is now
3114         returned from the imported __gnat_readdir routine.
3115         Update copyright notice.
3116
3117         * s-crtl-vms64.ads, s-crtl.ads: (closedir): Moved to adaint.c.
3118         (opendir): Moved to adaint.c.
3119
3120         * g-os_lib.adb (Copy_Time_Stamp): Fix off-by-one range computation.
3121         (Get_Directory): Fix wrong indexing.
3122         (Getenv): replace __gnat_get_env_value_ptr from adaint.c by
3123         __gnat_getenv from env.c
3124         (Setenv): replace __gnat_set_env_value from adaint.c by __gnat_setenv
3125         from env.c
3126
3127         * env.h, env.c: New file.
3128
3129         * s-scaval.adb (Initialize): Replace __gnat_get_env_value_ptr from
3130         adaint.c by __gnat_getenv from env.c
3131
3132         * s-shasto.adb (Initialize): replace __gnat_get_env_value_ptr from
3133         adaint.c by __gnat_getenv from env.c
3134
3135         * Make-lang.in: Add env.o in the list of C object needed by gnat1
3136         and gnatbind.
3137         Update dependencies.
3138
3139 2006-02-13  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3140             Olivier Hainque  <hainque@adacore.com>
3141             Eric Botcazou  <ebotcazou@adacore.com>
3142
3143         * ada-tree.h: (TYPE_UNCHECKED_UNION_P): Deleted.
3144         
3145         * gigi.h (value_factor_p): Add prototype and description, now public.
3146
3147         * decl.c (gnat_to_gnu_field): Don't attempt BLKmode to integral type
3148         promotion for field with rep clause if the associated size was proven
3149         to be in error.
3150         Expand comments describing attempts to use a packable type.
3151         (gnat_to_gnu_entity) <E_Signed_Integer_Subtype,
3152         E_Floating_Point_Subtype>: Inherit alias set of what we are making a
3153         subtype of to ensure conflicts amongst all subtypes in a hierarchy,
3154         necessary since these are not different types and pointers may
3155         actually designate any subtype in this hierarchy.
3156         (gnat_to_gnu_entity, case E_Record_Type): Always make fields for
3157         discriminants but put them into record only if not Unchecked_Union;
3158         pass flag to components_to_record showing Unchecked_Union.
3159         (make_dummy_type): Use UNION_TYPE only if Unchecked_Union and no
3160         components before variants; don't set TYPE_UNCHECKED_UNION_P.
3161         (components_to_record): New argument UNCHECKED_UNION.
3162         Remove special case code for Unchecked_Union and instead use main code
3163         with small changes.
3164
3165         PR ada/26096
3166         (gnat_to_gnu_entity) <E_Variable>: Do not initialize the
3167         aligning variable with the expression being built, only its inner
3168         field.
3169
3170         * trans.c (Handled_Sequence_Of_Statements_to_gnu): Remove call to
3171         emit_sequence_entry_statements.
3172         (emit_sequence_entry_statements, body_with_handlers_p): Delete.
3173         (establish_gnat_vms_condition_handler): Move before
3174         Subprogram_Body_to_gnu.
3175         (Subprogram_Body_to_gnu): On VMS, establish_gnat_vms_condition_handler
3176         for a subprogram if it has a foreign convention or is exported.
3177         (Identifier_to_gnu): Manually unshare the DECL_INITIAL tree when it is
3178         substituted for a CONST_DECL.
3179         (tree_transform, case N_Aggregate): Remove code for UNION_TYPE and pass
3180         Etype to assoc_to_constructor.
3181         (assoc_to_constructor): New argument, GNAT_ENTITY; use it to ignore
3182         discriminants of Unchecked_Union.
3183         (TARGET_ABI_OPEN_VMS): Define to 0 if not defined, so that later uses
3184         don't need cluttering preprocessor directives.
3185         (establish_gnat_vms_condition_handler): New function. Establish the GNAT
3186         condition handler as current in the compiled function.
3187         (body_with_handlers_p): New function. Tell whether a given sequence of
3188         statements node is attached to a package or subprogram body and involves
3189         exception handlers possibly nested within inner block statements.
3190         (emit_sequence_entry_statements): New function, to emit special
3191         statements on entry of sequences when necessary. Establish GNAT
3192         condition handler in the proper cases for VMS.
3193         (Handled_Sequence_Of_Statements_to_gnu): Start block code with
3194         emit_sequence_entry_statements.
3195
3196         * utils2.c (find_common_type): If both input types are BLKmode and
3197         have a constant size, use the smaller one.
3198         (build_simple_component_ref): Also match if FIELD and NEW_FIELD are
3199         the same.
3200
3201         * utils.c (value_factor_p): Make public, to allow uses from other gigi
3202         units.
3203         (create_type_decl): Do not set the flag DECL_IGNORED_P for dummy types.
3204         (convert, case UNION_TYPE): Remove special treatment for unchecked
3205         unions.
3206
3207         PR ada/18659
3208         (update_pointer_to): Update variants of pointer types to
3209         unconstrained arrays by attaching the list of fields of the main
3210         variant.
3211
3212 2006-02-13  Arnaud Charlet  <charlet@adacore.com>
3213             Robert Dewar  <dewar@adacore.com>
3214
3215         * a-exexpr.adb, a-exexpr-gcc.adb
3216         (Process_Raise_Exception): Removed, merged with Propagate_Exception.
3217         (Propagate_Exception): Now take extra From_Signal_Handler parameter.
3218         Remove code unused for exception propagation for the compiler itself
3219         from a-except.adb and update to still share separate packages.
3220
3221         * a-except.ads, a-except.adb: Ditto.
3222         Add comments that this version is now used only by the compiler and
3223         other basic tools. The full version that includes the Ada 2005 stuff
3224         is in separate files a-except-2005.ads/adb. The reason is that we do
3225         not want to cause bootstrap problems with compilers not recognizing
3226         Wide_Wide_String.
3227         Add exception reason code PE_Implicit_Return
3228         Add new exception reason code (Null Exception_Id)
3229
3230         * a-except-2005.adb, a-except-2005.ads: New files.
3231
3232         * s-wchcon.ads: (Get_WC_Encoding_Method): New function.
3233
3234         * s-wchcon.adb: New file.
3235
3236         * Makefile.in (LIBGNAT_SRCS): Add tb-gcc.c.
3237         (traceback.o deps): Likewise.
3238         (SPARC/Solaris): Accept sparc[64|v9]-sun-solaris.
3239         Activate build of GMEM instrumentation library on VMS targets.
3240         (gnatlib-sjlj, gnatlib-zcx): Pass EH_MECHANISM to make gnatlib.
3241         Use a-except-2005.ads/adb for all run-time library builds unless
3242         specified otherwise.
3243         [VMS] (LIBGNAT_TARGET_PAIRS_AUX1,2): Rename s-parame-vms.ads to
3244         s-parame-vms-alpha.ads and add s-parame-vms-ia64.ads.
3245         Use s-parame.adb on all native platforms.
3246         Use s-parame-vxworks.adb on all vxworks platforms.
3247         Add env.c env.h in LIBGNAT_SRCS
3248         Add env.o in LIBGNAT_OBJS
3249         (GNATMAKE_OBJS): Remove ctrl_c.o object.
3250         (LIBGNAT_TARGET_PAIRS for x86-vxworks): Use an specialized version of
3251         s-osinte.adb, s-tpopsp.adb, and system.ads for the run time that
3252         supports VxWorks 6 RTPs.
3253         (EXTRA_GNATRTL_NONTASKING_OBJS for x86-vxworks): Remove the use of
3254         i-vxworks and i-vxwoio from the run time that supports VxWorks 6 RTPs.
3255
3256         * types.h, types.ads (Terminate_Program): New exception
3257         Add comment on modifying multiple versions of a-except.adb when the
3258         table of exception reasons is modified.
3259         Add exception reason code PE_Implicit_Return
3260         Add new exception reason code (Null Exception_Id)
3261
3262         * clean.adb (Initialize): Get the target parameters before checking
3263         if target is OpenVMS. Move the OpenVMS specific code here from package
3264         body elaboration code.
3265
3266 2006-02-13  Thomas Quinot  <quinot@adacore.com>
3267             Vincent Celier  <celier@adacore.com>
3268             Robert Dewar  <dewar@adacore.com>
3269
3270         * ali-util.adb (Get_File_Checksum): Update to account for change in
3271         profile of Initialize_Scanner.
3272
3273         * gprep.adb (Gnatprep): Update to account for change in profile of
3274         Initialize_Scanner.
3275         (Process_One_File): Same.
3276
3277         * lib.adb (Get_Code_Or_Source_Unit): New subprogram factoring the
3278         common code between Get_Code_Unit and Get_Source_Unit. Reimplement
3279         that behaviour using the new Unit information recorded in the source
3280         files table, rather than going through all units every time.
3281         (Get_Code_Unit): Reimplement in terms of Get_Code_Or_Source_Unit.
3282         (Get_Source_Unit): Same.
3283
3284         * prepcomp.adb (Parse_Preprocessing_Data_File): Update to account for
3285         change in profile of Initialize_Scanner.
3286         (Prepare_To_Preprocess): Same.
3287
3288         * lib.ads: Fix typo in comment (templace -> template).
3289
3290         * prj-part.adb (Parse_Single_Project): Update to account for change in
3291         profile of Initialize_Scanner.
3292
3293         * scn.adb (Initialize_Scanner): Account for change in profile of
3294         Scng.Initialize_Scanner: set Current_Source_Unit in Scn instead of Scng.
3295         Also record the association of the given Source_File_Index to the
3296         corresponding Unit_Number_Type.
3297
3298         * scng.ads, scng.adb (Initialize_Scanner.Set_Reserved): Remove
3299         procedure.
3300         (Initialize_Scanner): Call Scans.Initialize_Ada_Keywords.
3301         Remove Unit formal for generic scanner: this formal
3302         is only relevant to Scn (the scanner instance used to parse Ada source
3303         files), not to other instances. Update comment accordingly.
3304         (Scan): Use new function Snames.Is_Keyword_Name.
3305
3306         * sinfo-cn.adb: Fix typo in comment.
3307
3308         * sinput.adb (Unit, Set_Unit): Accessors for new source file attribute
3309         Unit.
3310
3311         * sinput.ads (Source_File_Record): New component Unit, used to capture
3312         the unit identifier (if any) associated to a source file.
3313
3314         * sinput-c.adb, sinput-l.adb (Load_File): Initialize new component
3315         Unit in Source_File_Record.
3316
3317         * sinput-p.adb (Source_File_Is_Subunit): Update to account for change
3318         in profile of Initialize_Scanner.
3319
3320         * scans.adb (Initialize_Ada_Keywords): New procedure
3321
3322         * scans.ads (Initialize_Ada_Keywords): New procedure to initialize the
3323         Ada keywords in the Namet table, without the need to call
3324         Initialize_Scanner.
3325
3326         * snames.adb: Add pragma Ada_2005 (synonym for Ada_05)
3327         (Is_Keyword_Name): New function
3328
3329         * snames.ads: Add subtype Configuration_Pragma_Names
3330         Add pragma Ada_2005 (synonym for Ada_05)
3331         (Is_Keyword_Name): New function
3332
3333         * snames.h: Add pragma Ada_2005 (synonym for Ada_05)
3334
3335 2006-02-13  Arnaud Charlet  <charlet@adacore.com>
3336
3337         * a-stwisu.adb, a-strsup.adb, a-stzsup.adb (Super_Slice): Fix slice
3338         index.
3339
3340         * a-stwima.adb (To_Set): Add extra check when N = 0.
3341
3342         * g-regpat.adb: (Match_Simple_Operator): Avoid possible overflow.
3343
3344 2006-02-13  Arnaud Charlet  <charlet@adacore.com>
3345
3346         * s-parame-mingw.adb, s-parame-linux.adb,
3347         s-parame-solaris.adb: Removed, replaced by s-parame.adb
3348
3349         * s-parame-vxworks.ads: Fix typo.
3350
3351         * s-parame-vxworks.adb: New file.
3352
3353         * s-parame.adb: Version now used by all native platforms.
3354         (Default_Stack_Size): Use 2 megs for default stack size and use
3355         __gl_default_stack_size when available.
3356         (Minimum_Stack_Size): Use 12K.
3357
3358         * s-taprop-mingw.adb: Set default stack size linker switch to 2megs.
3359         (Create_Task): Refine implementation taking advantage of the XP stack
3360         size support. On XP, we now create the thread using the flag
3361         STACK_SIZE_PARAM_IS_A_RESERVATION.
3362
3363         * s-osinte-mingw.ads (Stack_Size_Param_Is_A_Reservation): New constant.
3364
3365         * sysdep.c (__gnat_is_windows_xp): New routine, returns 1 on Windows
3366         XP and 0 on older Windows versions.
3367
3368         * interfac-vms.ads: Removed, no longer used.
3369
3370 2006-02-13  Matthew Heaney  <heaney@adacore.com>
3371
3372         * a-rbtgso.adb, a-crbtgo.adb, a-crbtgk.adb, a-coorse.adb, 
3373         a-cohama.adb, a-ciorse.adb, a-cihama.adb, a-cihase.adb, 
3374         a-cohase.adb: All explicit raise statements now include an exception
3375         message.
3376
3377         * a-ciormu.ads, a-ciormu.adb, a-coormu.ads, a-coormu.adb
3378         (Update_Element_Preserving_Key): renamed op to just Update_Element.
3379         Explicit raise statements now include an exception message
3380
3381         * a-cihase.ads, a-cohase.ads: Removed comment.
3382
3383         * a-stboha.ads, a-stboha.adb, a-stfiha.ads, a-envvar.adb,
3384         a-envvar.ads, a-swbwha.ads, a-swbwha.adb, a-swfwha.ads, a-szbzha.ads,
3385         a-szbzha.adb, a-szfzha.ads: New files.
3386
3387 2006-02-13  Matthew Heaney  <heaney@adacore.com>
3388
3389         * a-cgcaso.adb, a-cgaaso.adb: Implemented using heapsort instead of
3390         quicksort.
3391
3392 2006-02-13  Eric Botcazou  <ebotcazou@adacore.com>
3393
3394         * lang.opt: Wvariadic-macros: New option.
3395         Wold-style-definition: Likewise.
3396         Wmissing-format-attribute: Likewise.
3397
3398         * misc.c (gnat_handle_option): New cases for -Wvariadic-macros,
3399         -Wold-style-definition and -Wmissing-format-attribute.
3400
3401 2006-02-13  Robert Dewar  <dewar@adacore.com>
3402
3403         * a-ticoio.ads, a-ticoio.adb: Add use clause (moved here from spec)
3404
3405         * a-coteio.ads, a-lcteio.ads, a-llctio.ads, a-scteio.ads: New files.
3406
3407 2006-02-13  Nicolas Roche  <roche@adacore.com>
3408
3409         * a-envvar.adb, a-envvar.ads: New files.
3410
3411 2006-02-13  Douglas Rupp  <rupp@adacore.com>
3412
3413         * s-parame-vms.ads: Renamed to s-parame-vms-alpha.ads
3414
3415         * s-parame-vms-alpha.ads, s-parame-vms-ia64.ads: New files.
3416
3417 2006-02-13  Pat Rogers  <rogers@adacore.com>
3418
3419         * a-rttiev.adb, a-rttiev.ads: New files.
3420
3421 2006-02-13  Hristian Kirtchev  <kirtchev@adacore.com>
3422
3423         * a-tiboio.adb, a-tiboio.ads, a-wwboio.adb,
3424         a-wwboio.ads, a-zzboio.adb, a-zzboio.ads:  New files.
3425
3426         * impunit.adb, Makefile.rtl: Added new Ada 2005 units.
3427
3428 2006-02-13  Robert Dewar  <dewar@adacore.com>
3429
3430         * rtsfind.adb, exp_prag.adb, lib-writ.adb, par-labl.adb, 
3431         sem_case.adb: Minor code reorganization (not Present should be No)
3432
3433 2006-02-13  Geert Bosch  <bosch@adacore.com>
3434             Gary Dismukes  <dismukes@adacore.com>
3435
3436         * a-tifiio.adb (Put_Digits): Test Last against To'First - 1 instead of
3437         0, since the lower bound of the actual string may be greater than one.
3438
3439         PR ada/20753
3440
3441         (Put): Fix condition to raise Layout_Error when invalid
3442         layout is requested.
3443
3444 2006-02-13  Vincent Celier  <celier@adacore.com>
3445
3446         * back_end.adb (Scan_Compiler_Arguments): Check if
3447         Search_Directory_Present is True and, if it is, add the argument in
3448         the source search directory path.
3449
3450         * switch-c.adb (Scan_Front_End_Switches): Accept switch "-I". Set
3451         Search_Directory_Present to True.
3452
3453 2006-02-13  Joel Brobecker  <brobecke@adacore.com>
3454
3455         * bindgen.adb (Gen_Main_C): declare the ensure_reference variable as
3456         volatile, to tell the compiler to preserve this variable at any level
3457         of optimization.
3458         (Gen_Versions_Ada): Temporarily work around codegen bug.
3459
3460 2006-02-13  Vincent Celier  <celier@adacore.com>
3461
3462         * gnatlink.adb (Process_Binder_File): If -shared is specified, invoke
3463         gcc to link with option -shared-libgcc.
3464         (Gnatlink): Remove duplicate switches -shared-libgcc
3465
3466 2006-02-13  Robert Dewar  <dewar@adacore.com>
3467
3468         * gnatvsn.ads (Current_Year): New constant, used to easily update
3469         copyright on all GNAT tools.
3470
3471         * gnatls.adb, gnatname.adb, vms_conv.adb: Add 2006 to displayed
3472         copyright notice.
3473
3474 2006-02-13  Robert Dewar  <dewar@adacore.com>
3475
3476         * erroutc.ads, erroutc.adb (Set_Message_Blank): Don't insert space
3477         after hyphen (small aesthetic change useful for a range of numbers
3478         using ^-^.
3479         Suppress range checks for a couple of assignments which otherwise
3480         cause validity checks with validity checking turned on.
3481
3482         * sem_ch13.adb (Analyze_Attribute_Definition_Clause, case Size):
3483         Improvement in error message for object.
3484         (Rep_Item_Too_Late): Remove '!' in warning message.
3485
3486 2006-02-13  Robert Dewar  <dewar@adacore.com>
3487             Eric Botcazou  <ebotcazou@adacore.com>
3488
3489         * err_vars.ads: Suppress range checks for a couple of assignments
3490         which otherwise cause validity checks with validity checking turned on.
3491         Update comments.
3492
3493         * errout.adb (Error_Msg_Internal): Do not suppress warning messages.
3494         Make message unconditional if it is a warning.
3495         (Error_Msg_NEL): Always output warning messages.
3496         Suppress range checks for a couple of assignments which otherwise
3497         cause validity checks with validity checking turned on.
3498
3499         * errout.ads (Message Insertion Characters): Document that '!' is
3500         implied by '?' in error messages.
3501
3502         * gnat1drv.adb: (Bad_Body): Remove '!' in warning message.
3503         (Gnat1drv): Use a goto to end of main subprogram instead of
3504         Exit_Program (E_Success) so that finalization can occur normally.
3505
3506 2006-02-13  Eric Botcazou  <ebotcazou@adacore.com>
3507
3508         * s-stchop.adb (Stack_Check): Raise Storage_Error if the argument has
3509         wrapped around.
3510
3511 2006-02-13  Vincent Celier  <celier@adacore.com>
3512
3513         * a-direct.adb (Duration_To_Time, OS_Time_To_Long_Integer): New
3514         Unchecked_Conversion functions.
3515         (Modification_Time): Use direct conversion of OS_Time to Calendar time
3516         when OpenVMS returns False.
3517
3518         * a-dirval-mingw.adb, a-dirval-vms.adb, a-dirval.ads,
3519         a-dirval.adb (OpenVMS): New Boolean function
3520
3521 2006-02-13  Ed Schonberg  <schonberg@adacore.com>
3522             Thomas Quinot  <quinot@adacore.com>
3523
3524         * checks.adb (Build_Discriminant_Checks): If the expression being
3525         checks is an aggregate retrieve the values of its discriminants to
3526         generate the check, rather than creating a temporary and a reference
3527         to it.
3528         (Apply_Access_Check): Rewritten to handle new Is_Known_Null flag
3529         (Install_Null_Excluding_Check): Ditto
3530         (Selected_Length_Checks): Build actual subtype for the original Ck_Node,
3531         not for the renamed object, so that the actual itype is attached in the
3532         proper context.
3533
3534 2006-02-13  Robert Dewar  <dewar@adacore.com>
3535             Vincent Celier  <celier@adacore.com>
3536
3537         * debug.adb: Eliminate numeric switches for binder/gnatmake
3538
3539         * switch-m.adb (Normalize_Compiler_Switches): Record numeric debug
3540         switches for the compiler.
3541         (Scan_Make_Switches): Do not allow numeric debug switches for gnatmake
3542         (Scan_Make_Switches): When failing with an illegal switch, output an
3543         error message with the full switch.
3544         Eliminate numeric switches for binder/gnatmake
3545
3546         * switch.ads, switch.adb (Bad_Switch): New procedure
3547
3548         * switch-b.adb (Scan_Binder_Switches): Do not accept combined switches.
3549         Remove 0-9 as debug flag character possibilities
3550         -d is now controlling the primary stack size when its value is a
3551         positive. Also add checks against invalid values, and support for kb,
3552         mb. Ditto for -D switch.
3553
3554 2006-02-13  Robert Dewar  <dewar@adacore.com>
3555             Serguei Rybin  <rybin@adacore.com>
3556
3557         * opt.ads opt.adb: Add Ada_Version_Explicit_Config along with
3558         save/restore routines.
3559         Properly handle Ada_Version_Explicit and Ada_Version_Config, which
3560         were not always properly handled previously.
3561         Since we are changing the tree format anyway, also get rid of the
3562         junk obsolete Immediate_Errors flag.
3563         (Tree_Read): Change the way of reading Tree_Version_String - now we
3564         read the version string from the tree even if its length is not the
3565         same as the length of the version string computed from Gnatvsn.
3566         (Search_Directory_Present): New Boolean flag for the compiler.
3567         Define Tree_Version_String as a dynamic string.
3568         (Default_Stack_Size): new variable, used to handle switch -d.
3569
3570         * par-prag.adb: 
3571         For pragma Ada_2005, remove stuff about setting Ada_Version_Explicit
3572         only for main unit.
3573         Add pragma Ada_2005 (synonym for Ada_05)
3574         Properly handle Ada_Version_Explicit and Ada_Version_Config, which
3575         were not always properly handled previously.
3576
3577         * directio.ads, ioexcept.ads, sequenio.ads, text_io.ads: Change
3578         explicit Ada_95 to Ada_2005.
3579
3580 2006-02-13  Javier Miranda  <miranda@adacore.com>
3581             Robert Dewar  <dewar@adacore.com>
3582             Ed Schonberg  <schonberg@adacore.com>
3583
3584         * einfo.ads, einfo.adb (First_Tag_Component): Protect the frontend
3585         against errors in the source program: a private types for which the
3586         corresponding full type declaration is missing and pragma CPP_Virtual
3587         is used.
3588         (Is_Unchecked_Union): Check flag on Implementation_Base_Type.
3589         (Is_Known_Null): New flag
3590         (Has_Pragma_Pure): New flag
3591         (No_Return): Present in all entities, set only for procedures
3592         (Is_Limited_Type): A type whose ancestor is an interface is limited if
3593         explicitly declared limited.
3594         (DT_Offset_To_Top_Func): New attribute that is present in E_Component
3595         entities. Only used for component marked Is_Tag. If present it stores
3596         the Offset_To_Top function used to provide this value in tagged types
3597         whose ancestor has discriminants.
3598
3599         * exp_ch2.adb: Update status of new Is_Known_Null flag
3600
3601         * sem_ch7.adb: Maintain status of new Is_Known_Null flag
3602
3603         * sem_cat.adb (Get_Categorization): Don't treat function as Pure in
3604         the categorization sense if Is_Pure was set by pragma Pure_Function.
3605
3606 2006-02-13  Quentin Ochem  <ochem@adacore.com>
3607             Olivier Hainque  <hainque@adacore.com>
3608
3609         * bindusg.adb: Updated documentation for -d and -D switches.
3610
3611         * raise.h (__gnat_set_globals): added new parameter for
3612         Default_Stack_Size.
3613
3614         * init.c (__gnat_adjust_context_for_raise) <alpha-vms case>: Implement.
3615         (__gnat_handle_vms_condition): Adjust context before raise.
3616         (__gnat_install_handler): Restore the global vector setup for GCC
3617         versions before 3.4, as the frame based circtuitry is not available
3618         in this case.
3619         (__gnat_set_globals): added a parameter default_stack_size
3620         (__gl_default_stack_size): new variable.
3621
3622 2006-02-13  Ed Schonberg  <schonberg@adacore.com>
3623
3624         * exp_aggr.adb (Build_Array_Aggr_Code): Rename variable
3625         "Others_Mbox_Present" to "Others_Box_Present" because the mbox concept
3626         does not exist in the Ada RM.
3627         (Compatible_Int_Bounds): Determine whether two integer range bounds
3628         are of equal length and have the same start and end values.
3629         (Is_Int_Range_Bounds): Determine whether a node is an integer range.
3630         (Build_Record_Aggr_Code): Perform proper sliding of a nested array
3631         aggregate when it is part of an object declaration.
3632         (Build_Record_Aggr_Code)  If the aggregate ttype is a derived type that
3633         constrains discriminants of its parent, add explicitly the discriminant
3634         constraints of the ancestor by retrieving them from the
3635         stored_constraint of the parent.
3636
3637 2006-02-13  Robert Dewar  <dewar@adacore.com>
3638
3639         * exp_attr.adb (Expand_N_Attribute_Reference, case Mechanism_Code): If
3640         attribute Mechanism_Code is applied to renamed subprogram, modify
3641         prefix to point to base subprogram.
3642         Max/Min attributes now violate Restriction No_Implicit_Conditionals
3643
3644         * sinfo.ads: Document that Mechanism_Code cannot be applied to
3645         renamed subprograms so that the front-end must replace the prefix
3646         appropriately.
3647
3648 2006-02-13  Javier Miranda  <miranda@adacore.com>
3649             Gary Dismukes  <dismukes@adacore.com>
3650
3651         * exp_ch3.adb (Component_Needs_Simple_Initialization): Add check for
3652         availability of RE_Interface_Tag.
3653         (Build_Initialization_Call): Fix wrong access to the discriminant value.
3654         (Freeze_Record_Type): Do not generate the tables associated with
3655         timed and conditional dispatching calls through synchronized
3656         interfaces if compiling under No_Dispatching_Calls restriction.
3657         When compiling for Ada 2005, for a nonabstract
3658         type with a null extension, call Make_Controlling_Function_Wrappers
3659         and insert the wrapper function declarations and bodies (the latter
3660         being appended as freeze actions).
3661         (Predefined_Primitive_Bodies): Do not generate the bodies of the
3662         predefined primitives associated with timed and conditional
3663         dispatching calls through synchronized interfaces if we are
3664         compiling under No_Dispatching_Calls.
3665         (Build_Init_Procedure):  Use RTE_Available to check if a run-time
3666         service is available before generating a call.
3667         (Make_Controlling_Function_Wrappers): New procedure.
3668         (Expand_N_Full_Type_Declaration): Create a class-wide master for
3669         access-to-limited-interfaces because they can be used to reference
3670         tasks that implement such limited interface.
3671         (Build_Offset_To_Top_Functions): Build the tree corresponding to the
3672         procedure spec and body of the Offset_To_Top function that is generated
3673         when the parent of a type with discriminants has secondary dispatch
3674         tables.
3675         (Init_Secondary_Tags): Handle the case in which the parent of the type
3676         containing secondary dispatch tables has discriminants to generate the
3677         correct arguments to call Set_Offset_To_Top.
3678         (Build_Record_Init_Proc): Add call to Build_Offset_To_Top_Functions.
3679
3680         * a-tags.ads, a-tags.adb: (Check_Index): Removed.
3681         Add Wide_[Wide_]Expanded_Name.
3682         (Get_Predefined_Prim_Op_Address): New subprogram that provides exactly
3683         the same functionality of Get_Prim_Op_Address but applied to predefined
3684         primitive operations because the pointers to the predefined primitives
3685         are now saved in a separate table.
3686         (Parent_Size): Modified to get access to the separate table of primitive
3687         operations or the parent type.
3688         (Set_Predefined_Prim_Op_Address): New subprogram that provides the same
3689         functionality of Set_Prim_Op_Address but applied to predefined primitive
3690         operations.
3691         (Set_Signature): New subprogram used to store the signature of a DT.
3692         (Displace): If the Offset_To_Top value is not static then call the
3693         function generated by the expander to get such value; otherwise use
3694         the value stored in the table of interfaces.
3695         (Offset_To_Top): The type of the actual has been changed to Address to
3696         give the correct support to tagged types with discriminants. In this
3697         case this value is stored just immediately after the tag field.
3698         (Set_Offset_To_Top): Two new formals have been added to indicate if the
3699         offset_to_top value is static and hence pass this value to the run-time
3700         to store it in the table of interfaces, or else if this value is dynamic
3701         and then pass to the run-time the address of a function that is
3702         generated by the expander to provide this value for each object of the
3703         type.
3704
3705         * rtsfind.ads (Default_Prin_Op_Count): Removed.
3706         (Default_Prim_Op_Count): New entity
3707       &n