OSDN Git Service

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