aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-20trans.c (struct language_function): Add GNAT_RET.Eric Botcazou1-9/+202
* gcc-interface/trans.c (struct language_function): Add GNAT_RET. (f_gnat_ret): New macro. (struct nrv_data): Add GNAT_RET. (finalize_nrv_unc_r): New helper function. (finalize_nrv): Add GNAT_RET parameter. Copy it into DATA. If the function returns unconstrained, use finalize_nrv_unc_r as callback. (return_value_ok_for_nrv_p): Test the alignment of RET_OBJ only if RET_OBJ is non-null. (Subprogram_Body_to_gnu): Pass GNAT_RET to finalize_nrv. (gnat_to_gnu) <N_Return_Statement>: In the return-unconstrained case, if optimization is enabled, record candidates for the Named Return Value optimization. From-SVN: r181528
2011-11-20trans.c (Subprogram_Body_to_gnu): Add comment.Eric Botcazou1-8/+7
* gcc-interface/trans.c (Subprogram_Body_to_gnu): Add comment. (gnat_to_gnu) <N_Return_Statement>: Add 'else' to avoid doing a useless test. Tweak default case. <N_Goto_Statement>: Use better formatting. * gcc-interface/utils2.c (maybe_wrap_malloc): Use INIT_EXPR instead of MODIFY_EXPR to initialize the storage. (build_allocator): Likewise. From-SVN: r181527
2011-11-10fe.h (Serious_Errors_Detected): New macro.Eric Botcazou1-17/+137
* fe.h (Serious_Errors_Detected): New macro. * gcc-interface/gigi.h (build_atomic_load): Declare. (build_atomic_store): Likewise. * gcc-interface/trans.c (atomic_sync_required_p): New predicate. (call_to_gnu): Add ATOMIC_SYNC parameter. Use local variable. Build an atomic load for an In or In Out parameter if needed. Build an atomic store for the assignment of an Out parameter if needed. Build an atomic store to the target if ATOMIC_SYNC is true. (present_in_lhs_or_actual_p): New predicate. (gnat_to_gnu) <N_Identifier>: Build an atomic load if needed. <N_Explicit_Dereference>: Likewise. <N_Indexed_Component>: Likewise. <N_Selected_Component>: Likewise. <N_Assignment_Statement>: Adjust call to call_to_gnu. Build an atomic store to the LHS if needed. <N_Function_Call>: Adjust call to call_to_gnu. * gcc-interface/utils2.c: Include toplev.h. (resolve_atomic_size): New static function. (build_atomic_load): New function. (build_atomic_store): Likewise. * gcc-interface/Make-lang.in (ada/utils2.o): Add toplev.h. From-SVN: r181267
2011-10-26decl.c (gnat_to_gnu_entity): Try to make a packable type for fields of union ↵Eric Botcazou1-4/+2
types as well. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Subtype>: Try to make a packable type for fields of union types as well. <is_type>: Use RECORD_OR_UNION_TYPE_P predicate. (gnat_to_gnu_component_type): Try to make a packable type for fields of union types as well. (make_packable_type): Use RECORD_OR_UNION_TYPE_P predicate. (maybe_pad_type): Try to make a packable type for fields of union types as well. (gnat_to_gnu_field): Likewise. (is_variable_size): Use RECORD_OR_UNION_TYPE_P predicate. (set_rm_size): Likewise. (rm_size): Likewise. * gcc-interface/misc.c (gnat_type_max_size): Likewise. * gcc-interface/trans.c (add_decl_expr): Likewise. * gcc-interface/utils.c (finish_record_type): Likewise. * gcc-interface/utils2.c (build_simple_component_ref): Likewise. From-SVN: r180540
2011-10-20trans.c (lhs_or_actual_p): New predicate.Eric Botcazou1-17/+31
* gcc-interface/trans.c (lhs_or_actual_p): New predicate. (unchecked_conversion_nop): Use it. (gnat_to_gnu): Likewise. From-SVN: r180243
2011-10-20back_end.adb (Call_Back_End): Pass the maximum logical line number instead ↵Eric Botcazou1-0/+4
of the maximum physical line... * back_end.adb (Call_Back_End): Pass the maximum logical line number instead of the maximum physical line number to gigi. * gcc-interface/trans.c (Sloc_to_locus): Cope with line zero. From-SVN: r180242
2011-10-17Linemap infrastructure for virtual locationsTom Tromey1-6/+4
This is the first instalment of a set which goal is to track locations of tokens across macro expansions. Tom Tromey did the original work and attached the patch to PR preprocessor/7263. This opus is a derivative of that original work. This patch modifies the linemap module of libcpp to add virtual locations support. A virtual location is a mapped location that can resolve to several different physical locations. It can always resolve to the spelling location of a token. For tokens resulting from macro expansion it can resolve to: - either the location of the expansion point of the macro. - or the location of the token in the definition of the macro - or, if the token is an argument of a function-like macro, the location of the use of the matching macro parameter in the definition of the macro The patch creates a new type of line map called a macro map. For every single macro expansion, there is a macro map that generates a virtual location for every single resulting token of the expansion. The good old type of line map we all know is now called an ordinary map. That one still encodes spelling locations as it has always had. As a result linemap_lookup as been extended to return a macro map when given a virtual location resulting from a macro expansion. The layout of structs line_map has changed to support this new type of map. So did the layout of struct line_maps. Accessor macros have been introduced to avoid messing with the implementation details of these datastructures directly. This helped already as we have been testing different ways of arranging these datastructure. Having to constantly adjust client code that is too tied with the internals of line_map and line_maps would have been even more painful. Of course, many new public functions have been added to the linemap module to handle the resolution of virtual locations. This patch introduces the infrastructure but no part of the compiler uses virtual locations yet. However the client code of the linemap data structures has been adjusted as per the changes. E.g, it's not anymore reliable for a client code to manipulate struct line_map directly if it just wants to deal with spelling locations, because struct line_map can now represent a macro map as well. In that case, it's better to use the convenient API to resolve the initial (possibly virtual) location to a spelling location (or to an ordinary map) and use that. This is the reason why the patch adjusts the Java, Ada and Fortran front ends. Also, note that virtual locations are not supposed to be ordered for relations '<' and '>' anymore. To test if a virtual location appears "before" another one, one has to use a new operator exposed by the line map interface. The patch updates the only spot (in the diagnostics module) I have found that was making the assumption that locations were ordered for these relations. This is the only change that introduces a use of the new line map API in this patch, so I am adding a regression test for it only. From-SVN: r180081
2011-10-12trans.c (Attribute_to_gnu): Use remove_conversions.Eric Botcazou1-12/+5
* gcc-interface/trans.c (Attribute_to_gnu): Use remove_conversions. (push_range_check_info): Likewise. (gnat_to_gnu) <N_Code_Statement>: Likewise. * gcc-interface/utils2.c (build_unary_op) <INDIRECT_REF>: Likewise. (gnat_invariant_expr): Likewise. * gcc-interface/utils.c (compute_related_constant): Likewise. (max_size): Fix handling of SAVE_EXPR. (remove_conversions): Fix formatting. From-SVN: r179873
2011-10-12ada-tree.h (DECL_LOOP_PARM_P): New flag.Eric Botcazou1-58/+209
* gcc-interface/ada-tree.h (DECL_LOOP_PARM_P): New flag. (DECL_INDUCTION_VAR): New macro. (SET_DECL_INDUCTION_VAR): Likewise. * gcc-interface/gigi.h (convert_to_index_type): Declare. (gnat_invariant_expr): Likewise. * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: If this is a loop parameter, set DECL_LOOP_PARM_P on it. * gcc-interface/misc.c (gnat_print_decl) <VAR_DECL>: If DECL_LOOP_PARM_P is set, print DECL_INDUCTION_VAR instead of DECL_RENAMED_OBJECT. * gcc-interface/trans.c (gnu_loop_label_stack): Delete. (struct range_check_info_d): New type. (struct loop_info_d): Likewise. (gnu_loop_stack): New stack. (Identifier_to_gnu): Set TREE_READONLY flag on the first dereference built for a by-double-ref read-only parameter. If DECL_LOOP_PARM_P is set, do not test DECL_RENAMED_OBJECT. (push_range_check_info): New function. (Loop_Statement_to_gnu): Push a new struct loop_info_d instead of just the label. Reference the label and the iteration variable from it. Build the special induction variable in the unsigned version of the size type, if it is larger than the base type. And attach it to the iteration variable if the latter isn't by-ref. In the iteration scheme case, initialize the invariant conditions in front of the loop if deemed profitable. Use gnu_loop_stack. (gnat_to_gnu) <N_Exit_Statement>: Use gnu_loop_stack. <N_Raise_Constraint_Error>: Always process the reason. In the range check and related cases, and if loop unswitching is enabled, compute invariant conditions and push this information onto the stack. Do not translate again the condition if it has been already translated. * gcc-interface/utils.c (record_global_renaming_pointer): Assert that DECL_LOOP_PARM_P isn't set. (convert_to_index_type): New function. * gcc-interface/utils2.c (build_binary_op) <ARRAY_REF>: Use it in order to convert the index from the base index type to sizetype. (gnat_invariant_expr): New function. From-SVN: r179868
2011-10-11Convert standard builtin functions from being arrays to using a functional ↵Michael Meissner1-2/+2
interface From-SVN: r179820
2011-10-07gigi.h (gnat_useless_type_conversion): Declare.Eric Botcazou1-6/+337
* gcc-interface/gigi.h (gnat_useless_type_conversion): Declare. (rest_of_subprog_body_compilation): Likewise. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: For renaming, test for useless conversions by means of gnat_useless_type_conversion. * gcc-interface/trans.c: Include bitmap.h and cgraph.h. (language_function): Add named_ret_val and other_ret_val. (f_named_ret_val): New macro. (f_other_ret_val): Likewise. (gigi): Call rest_of_subprog_body_compilation. (struct nrv_data): New structure. (is_nrv_p): New predicate. (prune_nrv_r): New helper function. (prune_nrv_in_block): New function. (finalize_nrv_r): New helper function. (finalize_nrv): New function. (return_value_ok_for_nrv_p): New predicate. (build_return_expr): If optimization is enabled, record candidates for the Named Return Value optimization. (build_function_stub): Call rest_of_subprog_body_compilation. (Subprogram_Body_to_gnu): If optimization is enabled and there are candidates, finalize the Named Return Value optimization. Call rest_of_subprog_body_compilation. (call_to_gnu): At the end, if a return value is needed, simplify the result before wrapping it up in a COMPOUND_EXPR. * gcc-interface/utils.c (end_subprog_body): Split into... (rest_of_subprog_body_compilation): ...this. New function. (gnat_useless_type_conversion): Likewise. From-SVN: r179650
2011-09-26gigi.h (create_subprog_decl): Replace TREE_CHAIN with DECL_CHAIN in comment.Eric Botcazou1-6/+6
* gcc-interface/gigi.h (create_subprog_decl): Replace TREE_CHAIN with DECL_CHAIN in comment. * gcc-interface/trans.c (gigi): Likewise. (Attribute_to_gnu): Likewise. (build_function_stub): Likewise. (gnat_to_gnu): Likewise. * gcc-interface/utils.c (create_subprog_decl): Likewise. (convert_vms_descriptor64): Likewise. (convert_vms_descriptor32): Likewise. From-SVN: r179185
2011-09-26trans.c (assoc_to_constructor): Minor tweaks.Eric Botcazou1-17/+10
* gcc-interface/trans.c (assoc_to_constructor): Minor tweaks. * gcc-interface/utils2.c (build_simple_component_ref): Fix formatting issues. Use COMPLETE_TYPE_P in assertion. Also set TREE_READONLY if the type of the record is TYPE_READONLY. From-SVN: r179184
2011-09-26ada-tree.h (TYPE_NULL_BOUNDS): New macro.Eric Botcazou1-0/+1
* gcc-interface/ada-tree.h (TYPE_NULL_BOUNDS): New macro. (SET_TYPE_NULL_BOUNDS): Likewise. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Set again TREE_THIS_NOTRAP on the INDIRECT_REF node built for the template. * gcc-interface/trans.c (Identifier_to_gnu): Return initializers of fat pointer types. * gcc-interface/utils.c (create_var_decl_1): If the object is external, check that the initializer is a valid constant expression for use in initializing a static variable. Add missing guard. (update_pointer_to): Adjust TYPE_NULL_BOUNDS if set. (convert_to_fat_pointer): In the null fat pointer case, build a valid pointer for the bounds. * gcc-interface/utils2.c (compare_fat_pointers): New function. (build_binary_op) <EQ_EXPR>: Call it to compare fat pointers. From-SVN: r179180
2011-09-25ada-tree.h (TREE_THIS_NOTRAP): Redefine.Eric Botcazou1-28/+38
* gcc-interface/ada-tree.h (TREE_THIS_NOTRAP): Redefine. * gcc-interface/trans.c (Identifier_to_gnu): Factor out common code in the by-ref case. Do not set TREE_READONLY on a renamed object. Set TREE_THIS_NOTRAP on UNCONSTRAINED_ARRAY_REF nodes. (Attribute_to_gnu) <Attr_Length>: Expand the use of the parameter cache to the indirect case. * gcc-interface/utils.c (convert) <UNCONSTRAINED_ARRAY_REF>: Preserve the TREE_THIS_NOTRAP flag. From-SVN: r179171
2011-09-25trans.c (Loop_Statement_to_gnu): In the case of an iteration scheme...Eric Botcazou1-60/+99
* gcc-interface/trans.c (Loop_Statement_to_gnu): In the case of an iteration scheme, always generate the do-while form if optimization is enabled. Use more straightforward test at the end. From-SVN: r179169
2011-09-25decl.c (gnat_to_gnu_entity): Use XNEW instead of xmalloc.Eric Botcazou1-52/+44
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Subtype>: Use XNEW instead of xmalloc. Do not build useless pointer type. <E_Anonymous_Access_Subprogram_Type>: Use XNEW instead of xmalloc. * gcc-interface/trans.c (gnat_to_gnu) <N_Raise_Constraint_Error>: Tidy. * gcc-interface/utils2.c (build_unary_op): Remove local variable. From-SVN: r179168
2011-09-11decl.c (maybe_pad_type): Do not try to change the form of an addressable type.Eric Botcazou1-0/+22
* gcc-interface/decl.c (maybe_pad_type): Do not try to change the form of an addressable type. * gcc-interface/trans.c (gnat_gimplify_expr) <VIEW_CONVERT_EXPR>: New. Deal with those cases for which creating a temporary is mandatory. From-SVN: r178764
2011-09-11trans.c (call_to_gnu): Use local variable.Eric Botcazou1-15/+10
* gcc-interface/trans.c (call_to_gnu): Use local variable. Make sure this is a real formal parameter before testing whether it is by ref. From-SVN: r178763
2011-09-11gigi.h (build_call_0_expr): Delete.Eric Botcazou1-22/+23
* gcc-interface/gigi.h (build_call_0_expr): Delete. (build_call_1_expr): Likewise. (build_call_2_expr): Likewise. (build_call_n_expr): New prototype. * gcc-interface/decl.c (gnat_to_gnu_entity): Use build_call_n_expr. * gcc-interface/trans.c (establish_gnat_vms_condition_handler): Ditto. (Handled_Sequence_Of_Statements_to_gnu): Likewise. (Exception_Handler_to_gnu_zcx): Likewise. (gnat_to_gnu): Likewise. (build_binary_op_trapv): Likewise. * gcc-interface/utils2.c (build_call_0_expr): Delete. (build_call_1_expr): Likewise. (build_call_2_expr): Likewise. (build_call_n_expr): New function. (build_call_raise): Use build_call_n_expr. (build_call_raise_range): Likewise. (build_call_raise_column): Likewise. (build_call_alloc_dealloc_proc): Likewise. (maybe_wrap_malloc): Likewise. (maybe_wrap_free): Likewise. From-SVN: r178762
2011-09-11trans.c (build_return_expr): Use void_type_node for MODIFY_EXPR.Eric Botcazou1-1/+1
* gcc-interface/trans.c (build_return_expr): Use void_type_node for MODIFY_EXPR. * gcc-interface/utils2.c (build_binary_op) <MODIFY_EXPR>: Assert that the result type is null if ENABLE_CHECKING. Set operation_type at the end unconditionally if not set in the previous cases. Use build2 and void_type_node for MODIFY_EXPR. (build_allocator): Use NULL_TREE for MODIFY_EXPR. From-SVN: r178761
2011-09-06[multiple changes]Arnaud Charlet1-0/+14
2011-09-06 Robert Dewar <dewar@adacore.com> * s-tpopsp-vxworks.adb, prj-nmsc.adb: Minor reformatting. 2011-09-06 Hristian Kirtchev <kirtchev@adacore.com> * gcc-interface/trans.c (Attribute_to_gnu): New case for attribute Descriptor_Size. * exp_attr.adb (Expand_N_Attribute_Reference): Add processing for attribute Descriptor_Size. * exp_ch7.adb (Double_Size_Of): Removed. (Make_Finalize_Address_Stmts): Remove the code which generates an expression to calculate the dope vector of an unconstrained array. Instead use attribute Descriptor_Size and leave the calculation to the back end. (Nearest_Multiple_Rounded_Up): Removed. (Size_Of): Removed. * sem_attr.adb (Analyze_Attribute): Add processing for attribute Descriptor_Size. Currently the attribute is applicable only to unconstrained arrays. (Eval_Attribute): Add processing for attribute Descriptor_Size. * snames.ads-tmpl: Add a predefined name and an Attribute_Id for Descriptor_Size. 2011-09-06 Ed Schonberg <schonberg@adacore.com> * exp_aggr.adb: Remove useless formal. From-SVN: r178585
2011-08-29[multiple changes]Arnaud Charlet1-3/+35
2011-08-29 Gary Dismukes <dismukes@adacore.com> * exp_ch3.adb (Build_Record_Init_Proc.Build_Init_Procedure): Set Exception_Handlers to No_List instead of Empty_List in the case where there are no handlers. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gcc-interface/gigi.h (enum standard_datatypes): Add ADT_reraise_zcx_decl (reraise_zcx_decl): New macro. * gcc-interface/trans.c (gnu_incoming_exc_ptr): New variable. (gigi): Set reraise_zcx_decl. (Exception_Handler_to_gnu_zcx): Save and restore gnu_incoming_exc_ptr. (gnat_to_gnu): Handle N_Raise_Statement. From-SVN: r178212
2011-08-07gigi.h (enumerate_modes): Fix formatting.Eric Botcazou1-6/+0
* gcc-interface/gigi.h (enumerate_modes): Fix formatting. * gcc-interface/trans.c (Subprogram_Body_to_gnu): Revert latest change. From-SVN: r177548
2011-08-02[multiple changes]Arnaud Charlet1-0/+6
2011-08-02 Geert Bosch <bosch@adacore.com> * gcc-interface/gigi.h, gcc-interface/misc.c (enumerate_modes): New function. * gcc-interface/Make-lang.in: Update dependencies. 2011-08-02 Olivier Hainque <hainque@adacore.com> * gcc-interface/trans.c (Subprogram_Body_to_gnu): Set the function end_locus. From-SVN: r177141
2011-07-24gigi.h (build_function_stub): Remove.Eric Botcazou1-31/+133
* gcc-interface/gigi.h (build_function_stub): Remove. (build_return_expr): Likewise. (convert_vms_descriptor): Declare. * gcc-interface/utils.c (convert_vms_descriptor): Make global. (build_function_stub): Move to... * gcc-interface/utils2.c (build_return_expr): Move to... * gcc-interface/trans.c (build_function_stub): ...here. (build_return_expr): ...here. (Subprogram_Body_to_gnu): Add local variable for language_function. Disconnect the parameter attributes cache, if any, once done with it. Call end_subprog_body only after setting the end_locus. Build the stub associated with the function, if any, at the very end. (gnat_to_gnu) <N_Return_Statement>: Remove couple of useless local variables and streamline control flow. From-SVN: r176712
2011-06-18trans.c (Identifier_to_gnu): Don't set TREE_THIS_NOTRAP on a dereference ↵Eric Botcazou1-1/+2
built for a by-ref object if... * gcc-interface/trans.c (Identifier_to_gnu): Don't set TREE_THIS_NOTRAP on a dereference built for a by-ref object if it has an address clause. From-SVN: r175172
2011-06-18einfo.ads (Address_Taken): Document use for the second argument of Asm_Input ↵Eric Botcazou1-6/+20
and Asm_Output attributes. * einfo.ads (Address_Taken): Document use for the second argument of Asm_Input and Asm_Output attributes. * sem_attr.adb (Analyze_Attribute) <Attribute_Asm_Input>: If the second argument is an entity name, then set Address_Taken on it. <Attribute_Asm_Output>: Likewise. * gcc-interface/trans.c (lvalue_required_for_attribute_p): Handle the Attr_Asm_Input and Attr_Asm_Output attributes explicitly. (gnat_to_gnu) <N_Code_Statement>: If an operand is going to end up in memory and is a CONST_DECL, retrieve its corresponding VAR_DECL. From-SVN: r175171
2011-06-06trans.c (Identifier_to_gnu): Also handle deferred constants whose full view ↵Eric Botcazou1-3/+5
has discriminants specially. * gcc-interface/trans.c (Identifier_to_gnu): Also handle deferred constants whose full view has discriminants specially. From-SVN: r174689
2011-05-18trans.c (Exception_Handler_to_gnu_sjlj): Use boolean_false_node instead of ↵Kai Tietz1-3/+3
integer_zero_node. 2011-05-18 Kai Tietz <ktietz@redhat.com> * gcc-interface/trans.c (Exception_Handler_to_gnu_sjlj): Use boolean_false_node instead of integer_zero_node. (convert_with_check): Likewise. * gcc-interface/decl.c (choices_to_gnu): Likewise. From-SVN: r173846
2011-05-12trans.c (call_to_gnu): In the by-reference case...Eric Botcazou1-4/+10
* gcc-interface/trans.c (call_to_gnu): In the by-reference case, if the type of the parameter is an unconstrained array, convert the actual to the type of the formal in the In Out and Out cases as well. From-SVN: r173706
2011-05-06generalize build_case_label to the rest of the compilerNathan Froyd1-3/+2
generalize build_case_label to the rest of the compiler gcc/ada/ * gcc-interface/trans.c (Case_Statement_to_gnu): Call build_case_label. gcc/ * except.c (sjlj_emit_dispatch_table): Call build_case_label. * gimplify.c (gimplify_switch_expr): Likewise. * omp-low.c (expand_omp_sections): Likewise. * tree-eh.c (lower_try_finally_switch): Likewise. (lower_eh_dispatch): Likewise. * tree.h (build_case_label): Declare. * tree.c (build_case_label): Define. gcc/c-family/ * c-common.c (c_add_case_label): Omit the loc argument to build_case_label. * c-common.h (build_case_label): Remove. * c-semantics.c (build_case_label): Remove. gcc/cp/ * decl.c (finish_case_label): Omit the loc argument to build_case_label. gcc/fortran/ * trans-decl.c (gfc_trans_entry_master_switch): Call build_case_label. * trans-io.c (add_case): Likewise. * trans-stmt.c (gfc_trans_integer_select): Likewise. (gfc_trans_character_select): Likewise. gcc/go/ * go-gcc.cc (Gcc_backend::switch_statement): Call build_case_label. gcc/java/ * expr.c (expand_java_switch): Call build_case_label. (expand_java_add_case): Likewise. From-SVN: r173467
2011-05-04tree.h (int_const_binop): Remove notrunc argument.Richard Guenther1-3/+2
2011-05-04 Richard Guenther <rguenther@suse.de> * tree.h (int_const_binop): Remove notrunc argument. * fold-const.c (int_const_binop): Remove notrunc argument. Always create integer constants that are properly truncated. (extract_muldiv_1): Expand one notrunc int_const_binop caller. (const_binop): Remove zero notrunc argument to int_const_binop. (size_binop_loc): Likewise. (fold_div_compare): Likewise. (maybe_canonicalize_comparison_1): Likewise. (fold_comparison): Likewise. (fold_binary_loc): Likewise. (multiple_of_p): Likewise. * expr.c (store_constructor): Likewise. * gimple-fold.c (maybe_fold_offset_to_array_ref): Likewise. (maybe_fold_stmt_addition): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * stor-layout.c (layout_type): Likewise. * tree-data-ref.c (tree_fold_divides_p): Likewise. * tree-sra.c (build_ref_for_offset): Likewise. (build_user_friendly_ref_for_offset): Likewise. * tree-ssa-address.c (maybe_fold_tmr): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise. * tree-ssa-loop-niter.c (inverse): Likewise. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise. * tree-ssa.c (maybe_rewrite_mem_ref_base): Likewise. * tree-switch-conversion.c (check_range): Likewise. (build_constructors): Likewise. * tree-vect-generic.c (expand_vector_piecewise): Likewise. * tree-vrp.c (set_and_canonicalize_value_range): Likewise. (extract_range_from_assert): Likewise. (vrp_int_const_binop): Likewise. (extract_range_from_binary_expr): Likewise. (extract_range_from_unary_expr): Likewise. (check_array_ref): Likewise. (find_case_label_range): Likewise. (simplify_div_or_mod_using_ranges): Likewise. * tree-cfg.c (group_case_labels_stmt): Use double-ints for comparing case labels for merging. ada/ * gcc-interface/trans.c (gnat_to_gnu): Remove zero notrunc argument to int_const_binop. (pos_to_constructor): Likewise. fortran/ * trans-types.c (gfc_get_array_type_bounds): Remove zero notrunc argument to int_const_binop. From-SVN: r173356
2011-05-03trans.c (gigi): Call build_function_type_list instead of build_function_type.Nathan Froyd1-87/+64
* gcc-interface/trans.c (gigi): Call build_function_type_list instead of build_function_type. Adjust calls to... (build_raise_check): ...this. Do not take a void_tree parameter. Call build_function_type_list instead of build_function_type. Fix head comment and swap couple of conditional blocks. Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com> From-SVN: r173325
2011-04-22gigi.h (create_subprog_decl): Add ARTIFICIAL_FLAG parameter.Eric Botcazou1-22/+20
* gcc-interface/gigi.h (create_subprog_decl): Add ARTIFICIAL_FLAG parameter. * gcc-interface/utils.c (create_subprog_decl): Likewise. Set DECL_ARTIFICIAL and DECL_NO_INLINE_WARNING_P on the DECL accordingly. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>: Add ARTIFICIAL_FLAG local variable and pass it to create_subprog_decl. <all>: Do not set flags on the reused DECL node coming from an alias. Set DECL_IGNORED_P on the DECL node built for subprograms if they don't need debug info here... * gcc-interface/trans.c (Subprogram_Body_to_gnu): ...and not here. (gigi): Adjust calls to create_subprog_decl. (build_raise_check): Likewise. (establish_gnat_vms_condition_handler): Likewise. (Compilation_Unit_to_gnu): Likewise. (gnat_to_gnu): Likewise. From-SVN: r172862
2011-04-08trans.c (Identifier_to_gnu): Do not return initializers of aggregate types ↵Eric Botcazou1-2/+6
that contain a placeholder. * gcc-interface/trans.c (Identifier_to_gnu): Do not return initializers of aggregate types that contain a placeholder. From-SVN: r172209
2011-04-02ada-tree.h (DECL_TAFT_TYPE_P): New flag.Eric Botcazou1-9/+25
* gcc-interface/ada-tree.h (DECL_TAFT_TYPE_P): New flag. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Incomplete_Type>: Set it if this is a Taft amendment type and the full declaration is available. * gcc-interface/trans.c (process_type): Likewise. If there is an old type, mark the new one as used if DECL_TAFT_TYPE_P. (process_freeze_entity): Likewise. * gcc-interface/utils.c (dummy_global): New static variable. (gnat_write_global_declarations): If there are types declared as used at the global level, insert them in the global hash table. From-SVN: r171881
2011-04-02gigi.h (record_builtin_type): Add ARTIFICIAL_P param.Eric Botcazou1-7/+8
* gcc-interface/gigi.h (record_builtin_type): Add ARTIFICIAL_P param. * gcc-interface/utils.c (gnat_pushdecl): If this is a non-artificial declaration of an array type, then set DECL_ORIGINAL_TYPE to a distinct copy. (record_builtin_type): Add ARTIFICIAL_P parameter. Set DECL_ARTIFICIAL flag of the type accordingly. * gcc-interface/trans.c (gigi): Adjust calls to record_builtin_type. From-SVN: r171880
2011-03-26gigi.h (finalize_from_with_types): Adjust comment.Eric Botcazou1-11/+7
* gcc-interface/gigi.h (finalize_from_with_types): Adjust comment. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Type>: Defer unconditionally to the end of the unit when the designated type is limited_with'ed. <all>: Rename local variable. Attempt to un-defer types only and do it for limited_with'ed types as well. (finalize_from_with_types): Adjust comment. Rename variable and tidy. * gcc-interface/trans.c (Compilation_Unit_to_gnu): Use GNAT_UNIT consistently and remove redundant call to finalize_from_with_types. From-SVN: r171552
2011-03-26inline.adb (Back_End_Cannot_Inline): Lift restriction on calls to ↵Eric Botcazou1-14/+14
subprograms without a previous spec declared in... * inline.adb (Back_End_Cannot_Inline): Lift restriction on calls to subprograms without a previous spec declared in the same unit. * gcc-interface/trans.c (Compilation_Unit_to_gnu): Process inlined subprograms at the end of the unit instead of at the beginning. * gcc-interface/utils.c (create_subprog_decl): Check that the entity isn't public for the special handling of non-inline functions nested inside inline external functions. From-SVN: r171551
2011-03-24trans.c (gnat_to_gnu): Remove obsolete case of non-conversion to the nominal ↵Eric Botcazou1-15/+7
result type at the end. * gcc-interface/trans.c (gnat_to_gnu): Remove obsolete case of non-conversion to the nominal result type at the end. From-SVN: r171398
2011-03-23trans.c (create_temporary): New function taken from...Eric Botcazou1-71/+110
* gcc-interface/trans.c (create_temporary): New function taken from... (create_init_temporary): ...here. Call it. (call_to_gnu): Create the temporary for the return value early, if any. Create it for a function with copy-in/copy-out parameters if there is no target; in other cases of copy-in/copy-out, use another temporary. Push the new binding level lazily. Add and rename local variables. From-SVN: r171345
2011-03-17gigi.h (smaller_form_type_p): Declare.Eric Botcazou1-25/+0
* gcc-interface/gigi.h (smaller_form_type_p): Declare. * gcc-interface/trans.c (smaller_form_type_p): Make global and move... * gcc-interface/utils.c (smaller_form_type_p): ...to here. (convert): Deal with conversions from a smaller form type specially. From-SVN: r171091
2011-02-03gigi.h (fill_vms_descriptor): Take GNU_TYPE instead of GNAT_FORMAL.Eric Botcazou1-3/+3
* gcc-interface/gigi.h (fill_vms_descriptor): Take GNU_TYPE instead of GNAT_FORMAL. * gcc-interface/utils2.c (fill_vms_descriptor): Move from here to... * gcc-interface/utils.c (fill_vms_descriptor): ...here. Take GNU_TYPE instead of GNAT_FORMAL. Protect the expression against multiple uses. Do not generate the check directly, instead instantiate the template check present in the descriptor. (make_descriptor_field): Move around. (build_vms_descriptor32): Build a template check in the POINTER field. (build_vms_descriptor): Remove useless suffixes. * gcc-interface/trans.c (call_to_gnu): Adjust fill_vms_descriptor call. From-SVN: r169788
2011-01-04trans.c (Case_Statement_to_gnu): Put the SLOC of the end-of-case on the end ↵Eric Botcazou1-2/+8
label and its associated gotos, if any. * gcc-interface/trans.c (Case_Statement_to_gnu): Put the SLOC of the end-of-case on the end label and its associated gotos, if any. From-SVN: r168458
2011-01-04trans.c (Subprogram_Body_to_gnu): Evaluate the expressions of the parameter ↵Eric Botcazou1-25/+25
cache within the statement group of... * gcc-interface/trans.c (Subprogram_Body_to_gnu): Evaluate the expressions of the parameter cache within the statement group of the CICO mechanism. From-SVN: r168456
2011-01-04trans.c (BLOCK_SOURCE_END_LOCATION): Provide default.Olivier Hainque1-11/+74
* gcc-interface/trans.c (BLOCK_SOURCE_END_LOCATION): Provide default. (set_end_locus_from_node): New function. (Subprogram_Body_to_gnu): Use it to mark both the inner BIND_EXPR we make and the function end_locus. (Compilation_Unit_to_gnu): Call it instead of a straight Sloc_to_locus for the elaboration subprogram. (set_gnu_expr_location_from_node) <default case>: Use it to attempt to set the end_locus of the expression as well. Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com> From-SVN: r168455
2011-01-04re PR ada/47131 (internal error for ACATS C34011B on SJLJ targets)Eric Botcazou1-22/+1
PR ada/47131 * gcc-interface/trans.c (Identifier_to_gnu): In SJLJ mode, do not make variables that are referenced in exception handlers volatile. From-SVN: r168454
2010-12-20Fix typos in gcc/ada.Ralf Wildenhues1-2/+2
gcc/ada/: * projects.texi: Fix typos. * gnat_rm.texi: Likewise. * gnat_ugn.texi: Likewise. * sem_util.adb: Fix typo in variable, typos in comments. * a-btgbso.adb: Fix typos in comments. * a-cbdlli.adb, a-cbhase.ads, a-cdlili.adb, a-cobove.adb, a-coinve.adb, a-convec.adb, a-direct.ads, a-strunb-shared.adb, a-strunb-shared.ads, a-stuten.ads, a-stwiun-shared.adb, a-stwiun-shared.ads, a-stzunb-shared.adb, a-stzunb-shared.ads, a-suenco.adb, a-suenst.adb, a-suewst.adb, a-suezst.adb, ali.ads, aspects.ads, atree.ads, binde.adb, bindgen.adb, checks.adb, checks.ads, einfo.ads, err_vars.ads, errout.adb, errout.ads, exp_aggr.adb, exp_attr.adb, exp_cg.adb, exp_ch3.adb, exp_ch4.adb, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_dbug.ads, exp_disp.adb, exp_fixd.ads, freeze.adb, g-altive.ads, g-comlin.ads, g-excact.ads, g-mbdira.adb, g-sechas.ads, g-sehash.ads, g-sha1.ads, g-sha224.ads, g-sha256.ads, g-sha384.ads, g-sha512.ads, g-shsh32.ads, g-shsh64.ads, g-socket.adb, g-socket.ads, g-sothco.ads, gcc-interface/decl.c, gcc-interface/trans.c, gcc-interface/utils2.c, gnat1drv.adb, init.c, inline.adb, link.c, locales.c, make.adb, mingw32.h, namet.ads, osint.adb, par-ch12.adb, par-ch13.adb, par-ch3.adb, par-ch4.adb, par-prag.adb, par.adb, par_sco.adb, prepcomp.adb, prj-conf.ads, prj-dect.adb, prj-env.adb, prj-env.ads, prj-nmsc.adb, prj-tree.ads, prj-util.ads, prj.adb, prj.ads, s-auxdec-vms-alpha.adb, s-auxdec-vms_64.ads, s-oscons-tmplt.c, s-osinte-vxworks.ads, s-osprim-mingw.adb, s-regexp.adb, s-stusta.adb, s-taprop-mingw.adb, s-taprop-solaris.adb, scn.adb, scos.ads, sem.adb, sem_aggr.adb, sem_attr.adb, sem_aux.adb, sem_aux.ads, sem_ch12.adb, sem_ch12.ads, sem_ch13.adb, sem_ch13.ads, sem_ch3.adb, sem_ch4.adb, sem_ch6.adb, sem_ch7.adb, sem_ch8.adb, sem_disp.adb, sem_disp.ads, sem_eval.adb, sem_intr.adb, sem_prag.adb, sem_res.adb, sem_scil.adb, sem_util.ads, sem_warn.adb, sem_warn.ads, sinfo.ads, socket.c, styleg.adb, switch.ads, sysdep.c, tb-alvxw.c, xoscons.adb: Likewise. From-SVN: r168082
2010-12-13trans.c (can_be_lower_p): New predicate.Eric Botcazou1-7/+30
* gcc-interface/trans.c (can_be_lower_p): New predicate. (Loop_Statement_to_gnu): Do not generate the entry condition if we know that it will be true. From-SVN: r167757