1 2010-04-13 Eric Botcazou <ebotcazou@adacore.com>
3 * gcc-interface/ada-tree.h (TYPE_BY_REFERENCE_P): Delete.
4 (DECL_CONST_ADDRESS_P): New macro.
5 (SET_DECL_ORIGINAL_FIELD_TO_FIELD): Likewise.
6 (SAME_FIELD_P): Likewise.
7 * gcc-interface/decl.c (constructor_address_p): New static function.
8 (gnat_to_gnu_entity) <object>: Set DECL_CONST_ADDRESS_P according to
9 the return value of above function.
10 (gnat_to_gnu_entity) <E_Record_Type>: Force BLKmode for all types
12 <E_Record_Subtype>: Likewise.
13 Set TREE_ADDRESSABLE on the type if it passed by reference.
14 (make_packable_type): Use SET_DECL_ORIGINAL_FIELD_TO_FIELD.
15 (create_field_decl_from): Likewise.
16 (substitute_in_type): Likewise.
17 (purpose_member_field): Use SAME_FIELD_P.
18 * gcc-interface/misc.c (must_pass_by_ref): Test TREE_ADDRESSABLE.
19 * gcc-interface/trans.c (lvalue_required_p): Add ADDRESS_OF_CONSTANT
20 parameter and adjust recursive calls.
21 <N_Explicit_Dereference>: New case.
22 <N_Object_Declaration>: Return 1 if the object is of a class-wide type.
23 Adjust calls to lvalue_required_p. Do not return the initializer of a
24 DECL_CONST_ADDRESS_P constant if an lvalue is required for it.
25 (call_to_gnu): Delay issuing error message for a misaligned actual and
26 avoid the associated back-end assertion. Test TREE_ADDRESSABLE.
27 (gnat_gimplify_expr) <ADDR_EXPR>: Handle non-static constructors.
28 * gcc-interface/utils.c (make_dummy_type): Set TREE_ADDRESSABLE if the
29 type is passed by reference.
30 (convert) <CONSTRUCTOR>: Convert in-place in more cases.
31 * gcc-interface/utils2.c (build_cond_expr): Drop TYPE_BY_REFERENCE_P.
32 (build_simple_component_ref): Use SAME_FIELD_P.
34 2010-04-12 Eric Botcazou <ebotcazou@adacore.com>
36 * gcc-interface/trans.c (Identifier_to_gnu): Use boolean variable.
37 (call_to_gnu): Test gigi's flag TYPE_BY_REFERENCE_P instead of calling
38 front-end's predicate Is_By_Reference_Type. Use consistent order and
39 remove ??? comment. Use original conversion in all cases, if any.
40 * gcc-interface/utils.c (make_dummy_type): Minor tweak.
41 (convert): Use local copy in more cases.
42 <INDIRECT_REF>: Remove deactivated code.
43 (unchecked_convert): Use a couple of local copies.
45 2010-04-11 Eric Botcazou <ebotcazou@adacore.com>
47 * gcc-interface/trans.c (lvalue_required_for_attribute_p): New static
49 (lvalue_required_p) <N_Attribute_Reference>: Call it.
50 (gnat_to_gnu) <N_Selected_Component>: Prevent build_component_ref from
51 folding the result only if lvalue_required_for_attribute_p is true.
52 * gcc-interface/utils.c (maybe_unconstrained_array): Pass correctly
53 typed constant to build_component_ref.
54 (unchecked_convert): Likewise.
55 * gcc-interface/utils2.c (maybe_wrap_malloc): Likewise.
56 (build_allocator): Likewise.
58 2010-04-11 Eric Botcazou <ebotcazou@adacore.com>
60 * gcc-interface/utils2.c (build_cond_expr): Take the address and
61 dereference if the result type is passed by reference.
63 2010-04-11 Eric Botcazou <ebotcazou@adacore.com>
65 * gcc-interface/trans.c (Case_Statement_to_gnu): Bool-ify variable.
66 (gnat_to_gnu) <N_Null_Statement>: When not optimizing, generate a
67 goto to the next statement.
69 2010-04-09 Eric Botcazou <ebotcazou@adacore.com>
71 * gcc-interface/gigi.h (maybe_variable): Delete.
72 (protect_multiple_eval): Likewise.
73 (maybe_stabilize_reference): Likewise.
74 (gnat_save_expr): Declare.
75 (gnat_protect_expr): Likewise.
76 (gnat_stabilize_reference): Likewise.
77 * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Use
78 gnat_stabilize_reference.
79 (maybe_variable): Delete.
80 (elaborate_expression_1): Use gnat_save_expr.
81 * gcc-interface/trans.c (Attribute_to_gnu): Use gnat_protect_expr.
82 (call_to_gnu): Pass NULL to gnat_stabilize_reference.
83 (gnat_to_gnu) <N_Object_Declaration>: Use gnat_save_expr.
84 <N_Slice>: Use gnat_protect_exp.
85 <N_Selected_Component>: Pass NULL to gnat_stabilize_reference.
86 <N_In>: Use gnat_protect_expr.
87 Pass NULL to gnat_stabilize_reference.
88 (build_unary_op_trapv): Use gnat_protect_expr.
89 (build_binary_op_trapv): Likewise.
90 (emit_range_check): Likewise.
91 (emit_index_check): Likewise.
92 (convert_with_check): Likewise.
93 (protect_multiple_eval): Move to utils2.c file.
94 (maybe_stabilize_reference): Merge into...
95 (gnat_stabilize_reference): ...this. Move to utils2.c file.
96 (gnat_stabilize_reference_1): Likewise.
97 * gcc-interface/utils.c (convert_to_fat_pointer): Use gnat_protect_expr
98 instead of protect_multiple_eval.
99 * gcc-interface/utils2.c (compare_arrays): Likewise.
100 (nonbinary_modular_operation): Likewise.
101 (maybe_wrap_malloc): Likewise.
102 (build_allocator): Likewise.
103 (gnat_save_expr): New function.
104 (gnat_protect_expr): Rename from protect_multiple_eval. Early return
105 in common cases. Propagate TREE_READONLY onto dereferences.
106 (gnat_stabilize_reference_1): Move from trans.c file.
107 (gnat_stabilize_reference): Likewise.
109 2010-04-09 Eric Botcazou <ebotcazou@adacore.com>
111 * gcc-interface/gigi.h (gnat_mark_addressable): Rename parameter.
112 * gcc-interface/decl.c (maybe_variable): Do not set TREE_STATIC on _REF
113 node. Use the type of the operand to set TREE_READONLY.
114 * gcc-interface/trans.c (Identifier_to_gnu): Do not set TREE_STATIC on
115 _REF node. Do not overwrite TREE_READONLY.
116 (call_to_gnu): Rename local variable and fix various nits. In the
117 copy-in/copy-out case, build the SAVE_EXPR manually.
118 (convert_with_check): Call protect_multiple_eval in lieu of save_expr
119 and fold the computations.
120 (protect_multiple_eval): Always save entire fat pointers.
121 (maybe_stabilize_reference): Minor tweaks.
122 (gnat_stabilize_reference_1): Likewise. Do not deal with tcc_constant,
123 tcc_type and tcc_statement.
124 * gcc-interface/utils.c (convert_to_fat_pointer): Call
125 protect_multiple_eval in lieu of save_expr.
126 (convert): Minor tweaks.
127 (maybe_unconstrained_array): Do not set TREE_STATIC on _REF node.
128 (builtin_type_for_size): Call gnat_type_for_size directly.
129 * gcc-interface/utils2.c (contains_save_expr_p): Delete.
130 (contains_null_expr): Likewise
131 (gnat_build_constructor): Do not call it.
132 (compare_arrays): Deal with all side-effects, use protect_multiple_eval
133 instead of gnat_stabilize_reference to protect the operands.
134 (nonbinary_modular_operation): Call protect_multiple_eval in lieu of
136 (maybe_wrap_malloc): Likewise.
137 (build_allocator): Likewise.
138 (build_unary_op) <INDIRECT_REF>: Do not set TREE_STATIC on _REF node.
139 (gnat_mark_addressable): Rename parameter.
141 2010-04-08 Eric Botcazou <ebotcazou@adacore.com>
143 * gcc-interface/ada-tree.h (TYPE_RETURNS_UNCONSTRAINED_P): Rename into.
144 (TYPE_RETURN_UNCONSTRAINED_P): ...this.
145 (TYPE_RETURNS_BY_REF_P): Rename into.
146 (TYPE_RETURN_BY_DIRECT_REF_P): ...this.
147 (TYPE_RETURNS_BY_TARGET_PTR_P): Delete.
148 * gcc-interface/gigi.h (create_subprog_type): Adjust parameter names.
149 (build_return_expr): Likewise.
150 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>:
151 Rename local variables. If the return Mechanism is By_Reference, pass
152 return_by_invisible_ref_p to create_subprog_type instead of toggling
153 TREE_ADDRESSABLE. Test return_by_invisible_ref_p in order to annotate
154 the mechanism. Use regular return for contrained types with non-static
155 size and return by invisible reference for unconstrained return types
156 with default discriminants. Update comment.
157 * gcc-interface/trans.c (Subprogram_Body_to_gnu): If the function
158 returns by invisible reference, turn the RESULT_DECL into a pointer.
159 Do not handle DECL_BY_REF_P in the CICO case here.
160 (call_to_gnu): Remove code handling return by target pointer. For a
161 function call, if the return type has non-constant size, generate the
162 assignment with an INIT_EXPR.
163 (gnat_to_gnu) <N_Return_Statement>: Remove dead code in the CICO case.
164 If the function returns by invisible reference, build the copy return
166 (add_decl_expr): Initialize the variable with an INIT_EXPR.
167 * gcc-interface/utils.c (create_subprog_type): Adjust parameter names.
168 Adjust for renaming of macros. Copy the node only when necessary.
169 (create_subprog_decl): Do not toggle TREE_ADDRESSABLE on the return
170 type, only change DECL_BY_REFERENCE on the RETURN_DECL.
171 (convert_from_reference): Delete.
172 (is_byref_result): Likewise.
173 (gnat_genericize_r): Likewise.
174 (gnat_genericize): Likewise.
175 (end_subprog_body): Do not call gnat_genericize.
176 * gcc-interface/utils2.c (build_binary_op) <INIT_EXPR>: New case.
177 (build_return_expr): Adjust parameter names, logic and comment.
179 2010-04-07 Eric Botcazou <ebotcazou@adacore.com>
181 * exp_pakd.adb (Create_Packed_Array_Type): Always use a modular type
182 if the size is small enough. Propagate the alignment if there is an
183 alignment clause on the original array type.
184 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Modular_Integer_Subtype>
185 Deal with under-aligned packed array types. Copy the size onto the
186 justified modular type and don't lay it out again. Likewise for the
187 padding type built for other under-aligned subtypes.
188 * gcc-interface/utils.c (finish_record_type): Do not set a default mode
191 2010-04-07 Eric Botcazou <ebotcazou@adacore.com>
193 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Procedure>: Set default
194 alignment on the RETURN type built for the Copy-In Copy-Out mechanism.
196 2010-04-07 Eric Botcazou <ebotcazou@adacore.com>
198 * gcc-interface/trans.c (call_to_gnu): In the return-by-target-ptr case
199 do not set the result type if there is a specified target and do not
200 convert the result in any cases.
201 (protect_multiple_eval): Make direct SAVE_EXPR for CALL_EXPR.
202 (maybe_stabilize_reference) <COMPOUND_EXPR>: Merge with CALL_EXPR.
204 2010-03-10 Eric Botcazou <ebotcazou@adacore.com>
206 * gcc-interface/Makefile.in (SPARC/Solaris): Use sparcv8plus.
208 2010-02-27 Eric Botcazou <ebotcazou@adacore.com>
211 * gcc-interface/utils2.c (build_binary_op) <EQ_EXPR>: Assert that fat
212 pointer base types are variant of each other. Apply special treatment
213 for null to fat pointer types in all cases.
215 2010-01-28 Pascal Obry <obry@adacore.com>
217 * s-win32.ads: Add some missing constants.
219 2010-01-28 Vincent Celier <celier@adacore.com>
221 * prj-attr-pm.adb (Add_Attribute): Do nothing if To_Package is
224 2010-01-28 Robert Dewar <dewar@adacore.com>
226 * gnat_rm.texi: Minor correction
228 2010-01-27 Pascal Obry <obry@adacore.com>
230 * g-awk.adb: ensure that an AWK session is reusable.
232 2010-01-27 Vasiliy Fofanov <fofanov@adacore.com>
234 * g-regist.adb (For_Every_Key): Fix previous change.
237 2010-01-27 Thomas Quinot <quinot@adacore.com>
239 * lib-writ.ads: Current version of spec for new N (note) ALI lines
241 2010-01-27 Yannick Moy <moy@adacore.com>
243 * a-cdlili.adb (Insert): Correct exception message when cursor
244 designates wrong list.
246 2010-01-27 Vincent Celier <celier@adacore.com>
248 * gnatcmd.adb: When there is only one main specified, the package
249 support Switches (<main>) and attribute Switches is specified for the
250 main, use these switches, instead of Default_Switches ("Ada").
252 2010-01-27 Robert Dewar <dewar@adacore.com>
254 * sem_prag.adb, par-prag.adb, snames.ads-tmpl: pragma Dimension initial
256 * exp_disp.adb: Minor reformatting
258 2010-01-27 Tristan Gingold <gingold@adacore.com>
260 * seh_init.c: Use __ImageBase instead of _ImageBase.
262 2010-01-27 Javier Miranda <miranda@adacore.com>
264 * exp_disp.ads, exp_disp.adb (Expand_Interface_Thunk): Modify the
265 profile of interface thunks. The type of the controlling formal is now
266 the covered interface type (instead of the target tagged type).
268 2010-01-27 Sergey Rybin <rybin@adacore.com>
270 * gnat_rm.texi, gnat_ugn.texi: Update gnatcheck doc.
272 2010-01-27 Robert Dewar <dewar@adacore.com>
274 * sinput.ads, sinput.adb (Sloc_Range): Applies to all nodes, formal
275 changed from Expr to N.
277 2010-01-26 Thomas Quinot <quinot@adacore.com>
279 * gnat_ugn.texi: Adjust documentation of -gnatz switches.
280 * usage.adb: Replace line for -gnatz with two lines for -gnatzc and
283 2010-01-26 Vincent Celier <celier@adacore.com>
285 * prj-attr.adb: Add new attribute Library_Install_Name_Option
286 Replace attribute Run_Path_Origin_Supported with Run_Path_Origin
287 * prj-nmsc.adb (Process_Project_Level_Simple_Attributes): Process
288 attributes Run_Path_Option and Library_Install_Name_Option.
289 * prj.ads (Project_Configuration): Replace component
290 Run_Path_Origin_Supported with component Run_Path_Origin. Add new
291 component Library_Install_Name_Option.
292 * snames.ads-tmpl: Add new standard name Library_Install_Name_Option
293 Replace Run_Path_Origin_Supported with Run_Path_Origin
295 2010-01-26 Ed Schonberg <schonberg@adacore.com>
297 * sem_ch8.adb (Use_One_Package): Within an instance, an actual package
298 is not hidden by a homograph declared in another actual package.
300 2010-01-26 Robert Dewar <dewar@adacore.com>
302 * par_sco.adb (Traverse_Declarations_Or_Statements): Only generate
303 decisions for pragmas Assert, Check, Precondition, Postcondition if
305 * scos.ads: Update comments.
306 * get_scos.adb, put_scos.adb: Minor fix to code reading statement SCOs.
307 Also remove obsolete code for CT (exit point) SCOs.
309 2010-01-26 Thomas Quinot <quinot@adacore.com>
311 * switch-c.adb: Fix handling of -gnatz*
313 2010-01-26 Robert Dewar <dewar@adacore.com>
315 * par_sco.adb (Traverse_Declarations_Or_Statements): Separate F/W
316 qualifiers for FOR/WHILE loops
317 * scos.ads: Use separate type letters F/W for for/while loops
319 2010-01-26 Robert Dewar <dewar@adacore.com>
321 * get_scos.adb (Get_SCOs): Implement new form of CS entries (multiple
322 entries per line, one for each statement in the sequence).
323 * par_sco.adb (Traverse_Declarations_Or_Statements): Increase array
324 size from 100 to 10_000 for SC_Array to avoid any real possibility of
325 overflow. Output decisions in for loops.
326 Exclude labels from CS lines.
327 * scos.ads: Clarify that label is not included in the entry point
329 2010-01-26 Robert Dewar <dewar@adacore.com>
331 * par_sco.adb (Traverse_Declarations_Or_Statments): Implement new
332 format of statement sequence SCO entries (one location/statement).
333 * put_scos.adb (Put_SCOs): Implement new format of CS lines
334 * scos.ads: Update comments.
335 * sem_eval.adb: Minor reformatting.
337 2010-01-26 Robert Dewar <dewar@adacore.com>
339 * par_sco.ads, par_sco.adb (Set_Statement_Entry): New handling of exits
340 (Extend_Statement_Sequence): New procedures
341 (Traverse_Declarations_Or_Statements): New handling for exits.
343 2010-01-26 Robert Dewar <dewar@adacore.com>
345 * par_sco.adb (Traverse_Declarations_Or_Statements): Add processing for
348 2010-01-26 Robert Dewar <dewar@adacore.com>
350 * par_sco.adb (Is_Logical_Operator): Exclude AND/OR/XOR
351 * scos.ads: Clarify handling of logical operators
353 2010-01-26 Arnaud Charlet <charlet@adacore.com>
355 * s-tpoben.adb: Update comments.
357 2010-01-26 Robert Dewar <dewar@adacore.com>
359 * freeze.adb (Set_Small_Size): Don't set size if alignment clause
362 2010-01-26 Robert Dewar <dewar@adacore.com>
364 * scos.ads: Clean up documentation, remove obsolete XOR references
365 2010-01-26 Vincent Celier <celier@adacore.com>
367 * gnat_ugn.texi: Complete documentation on the restrictions for
368 combined options in -gnatxxx switches.
371 2010-01-26 Arnaud Charlet <charlet@adacore.com>
373 * s-tpoben.adb (Initialize_Protection_Entries): If a PO is created from
374 a controlled operation, abort is already deferred at this point, so we
375 need to use Defer_Abort_Nestable.
377 2010-01-26 Vincent Celier <celier@adacore.com>
379 * prj-conf.adb (Get_Config_Switches): Check for a default language for
380 a project extending a project with no languages.
382 2010-01-26 Vincent Celier <celier@adacore.com>
384 * switch-c.adb (Scan_Front_End_Switches): Take into account options
386 Allow -gnateG to be followed by other options.
388 2010-01-26 Robert Dewar <dewar@adacore.com>
390 * s-commun.ads, s-osprim-mingw.adb, s-stchop-vxworks.adb, sem_aggr.adb,
391 s-vxwext.adb, sem_ch10.adb, sem_eval.adb, sem_prag.adb: Minor
394 2010-01-26 Vasiliy Fofanov <fofanov@adacore.com>
396 * g-regist.adb, g-regist.ads (For_Every_Key): New generic procedure
397 that allows to iterate over all subkeys of a key.
399 2010-01-26 Ed Falis <falis@adacore.com>
401 * sysdep.c: enable NFS for VxWorks MILS
402 * env.c: enable __gnat_environ for VxWorks MILS
403 * gcc-interface/Makefile.in: Add VxWorks MILS target pairs.
405 2010-01-25 Bob Duff <duff@adacore.com>
407 * sem_aggr.adb (Resolve_Array_Aggregate): Check for the case where this
408 is an internally-generated positional aggregate, and the bounds are
409 already correctly set. We don't want to overwrite those bounds with
410 bounds determined by context.
412 2010-01-25 Robert Dewar <dewar@adacore.com>
414 * g-sercom.ads, gnatcmd.adb, gnatlink.adb, a-ststio.adb, exp_ch6.adb,
415 exp_ch9.adb, g-sechas.ads: Minor reformatting.
417 2010-01-25 Thomas Quinot <quinot@adacore.com>
419 * s-commun.adb (Last_Index): Count must be converted to SEO (a signed
420 integer type) before subtracting 1, otherwise the computation may wrap
421 (because size_t is modular) and cause the conversion to fail.
423 2010-01-25 Ed Falis <falis@adacore.com>
425 * sysdep.c, init.c: Adapt to support full run-time on VxWorks MILS.
427 2010-01-25 Vincent Celier <celier@adacore.com>
429 * prj-attr.adb: New attribute Run_Path_Origin_Required
430 * prj-nmsc.adb (Process_Project_Level_Simple_Attributes): Process new
431 attribute Run_Path_Origin_Required.
432 * prj.ads (Project_Configuration): New component
433 Run_Path_Origin_Supported.
434 * snames.ads-tmpl: New standard name Run_Path_Origin_Required
436 2010-01-25 Ed Schonberg <schonberg@adacore.com>
438 * sem_aggr.adb (Resolve_Array_Aggregate): If the bounds in a choice
439 have errors, do not continue resolution of the aggregate.
440 * sem_eval.adb (Eval_Indexed_Component): Do not attempt to evaluate if
441 the array type indicates an error.
443 2010-01-25 Bob Duff <duff@adacore.com>
445 * sinfo.ads: Minor comment fixes.
447 2010-01-25 Bob Duff <duff@adacore.com>
449 * exp_ch4.adb, exp_aggr.adb: Minor comment fixes and code clean up.
451 2010-01-25 Arnaud Charlet <charlet@adacore.com>
453 * gnatvsn.ads (Current_Year): Update.
455 2010-01-25 Florian Villoing <villoing@adacore.com>
457 * gnat_ugn.texi: Fix typo.
459 2010-01-25 Thomas Quinot <quinot@adacore.com>
461 * scos.ads: Update specification.
463 2010-01-25 Ed Schonberg <schonberg@adacore.com>
465 * sem_ch6.adb (Process_PPCs): If a postcondition is present and the
466 enclosing subprogram has no previous spec, attach postcondition
467 procedure to the defining entity for the body.
469 2010-01-25 Ed Schonberg <schonberg@adacore.com>
471 * exp_aggr.adb (Build_Record_Aggr_Code); Do not generate call to
472 initialization procedure of the ancestor part of an extension aggregate
473 if it is an interface type.
475 2010-01-25 Vincent Celier <celier@adacore.com>
477 * gnatlink.adb (Process_Binder_File): The directory for the shared
478 version of libgcc in the run path options is found in the subdirectory
479 indicated by __gnat_default_libgcc_subdir.
480 * link.c: Declare new const char * __gnat_default_libgcc_subdir for
483 2010-01-25 Ed Schonberg <schonberg@adacore.com>
485 * sem_prag.adb: More flexible pragma Annotate.
487 2010-01-22 Eric Botcazou <ebotcazou@adacore.com>
489 * system-linux-armel.ads (Stack_Check_Probes): Set to True.
490 * system-linux-armeb.ads (Stack_Check_Probes): Likewise.
492 2010-01-18 Eric Botcazou <ebotcazou@adacore.com>
494 * gcc-interface/utils.c (create_var_decl_1): Fix formatting nits.
496 2010-01-18 Jan Hubicka <jh@suse.cz>
499 * gcc-interface/utils.c (create_var_decl_1): Do not set COMMON flag for
500 unit local variables.
502 2010-01-17 Laurent GUERBY <laurent@guerby.net>
504 * gcc-interface/Makefile.in: Fix typo in arm*-*-linux-gnueabi.
506 2010-01-11 Mikael Pettersson <mikpe@it.uu.se>
508 * gcc-interface/Makefile.in: Add arm*-*-linux-gnueabi.
509 * system-linux-armeb.ads, system-linux-armel.ads: New files.
511 2010-01-09 Simon Wright <simon@pushface.org>
514 * gcc-interface/Makefile.in (gnatlib-shared-darwin): Add missing
519 Copyright (C) 2010 Free Software Foundation, Inc.
521 Copying and distribution of this file, with or without modification,
522 are permitted in any medium without royalty provided the copyright
523 notice and this notice are preserved.