summaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
AgeCommit message (Collapse)Author
2017-12-14 * gcc-interface/decl.c (gnat_to_gnu_field): Do not set the alignmentebotcazou
of the enclosing record type if it is not already set. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@255646 138bc75d-0d04-0410-961f-82ee72b054a4
2017-12-13 * gcc-interface/decl.c (gnat_to_gnu_entity): Robustify test for typesebotcazou
descendant of System.Address. (gnat_to_gnu_subprog_type): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@255600 138bc75d-0d04-0410-961f-82ee72b054a4
2017-09-09 * gcc-interface/decl.c (promote_object_alignment): New function takenebotcazou
from... (gnat_to_gnu_entity) <E_Variable>: ...here. Invoke it. (gnat_to_gnu_field): If the field is Atomic or VFA, invoke it and create a padding type on success before doing the atomic check. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@251932 138bc75d-0d04-0410-961f-82ee72b054a4
2017-09-09 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Apply theebotcazou
promotion to static memory earlier in the processing. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@251930 138bc75d-0d04-0410-961f-82ee72b054a4
2017-09-09 * sem_util.ads (Set_Rep_Info): New inline procedure.ebotcazou
* sem_util.adb (Set_Rep_Info): Implement it. * sem_ch3.adb (Process_Subtype): If the case of a constraint present, always copy the representation aspects onto the subtype. * gcc-interface/decl.c (gnat_to_gnu_entity): Only set the TYPE_ALIGN_OK and TYPE_BY_REFERENCE_P flags on types after various promotions. * gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>: Consider all kinds of entities. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@251928 138bc75d-0d04-0410-961f-82ee72b054a4
2017-09-05 PR ada/62235ebotcazou
* gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing for Itypes that are E_Record_Subtype with a cloned subtype. <E_Record_Subtype>: Use the DECL of the cloned type directly, if any. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@251707 138bc75d-0d04-0410-961f-82ee72b054a4
2017-05-22 * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processingebotcazou
for Itypes that are E_Access_Subtype. <E_Access_Subtype>: Use the DECL of the base type directly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@248324 138bc75d-0d04-0410-961f-82ee72b054a4
2017-02-24 * gcc-interface/decl.c (gnat_to_gnu_field): Do not remove the wrapperebotcazou
around a justified modular type if it doesn't have the same scalar storage order as the enclosing record type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245710 138bc75d-0d04-0410-961f-82ee72b054a4
2017-02-24c-family/ebotcazou
* c-ada-spec.c (dump_ada_function_declaration): Add comment about the treatment of parameters with pointer-to-tagged type and tidy up. (print_ada_methods): Remove the special treatment of C++ static member functions. ada/ * gcc-interface/decl.c: Include demangle.h. (is_cplusplus_method): Return again true for a primitive operation only if it is dispatching. For a subprogram with an interface name, call the demangler to get the number of C++ parameters and compare it with the number of Ada parameters. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245700 138bc75d-0d04-0410-961f-82ee72b054a4
2016-12-07 * gcc-interface/decl.c (gnat_to_gnu_entity): When they are global,ebotcazou
consider ___XR GNAT encodings variables for renamings as static so they have a location in the debug info. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243341 138bc75d-0d04-0410-961f-82ee72b054a4
2016-12-07 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Translateebotcazou
System.Address into ptr_type_node for every foreign convention. (gnat_to_gnu_subprog_type): Likewise for result and parameter types. (gnat_to_gnu_param): Do not do it here for GCC builtins. (intrin_return_compatible_p): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243340 138bc75d-0d04-0410-961f-82ee72b054a4
2016-12-07 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Enumeration_Subtype>:ebotcazou
Also call finish_character_type on Character subtypes. * gcc-interface/utils.c (finish_character_type): Deal with subtypes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243336 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-13 * gcc-interface/decl.c (gnat_to_gnu_entity): In assertion about knownebotcazou
Esize, protect with !is_type and change !Unknown_Esize to Known_Esize. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242363 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-13 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>:ebotcazou
Look at the underlying type for the signedness of the type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242361 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-13 * gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Deal speciallyebotcazou
with negative constants. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242360 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-11 * gcc-interface/utils2.c (build_binary_op): Add a NO_FOLDebotcazou
argument. Disable folding when true. * gcc-interface/gigi.h (choices_to_gnu): Remove declaration. (build_binary_op): Update signature and comment. * gcc-interface/decl.c (choices_to_gnu): Make static. Disable folding for all calls to build_binary_op. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240978 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-11 * fe.h (Constant_Value): Declare.ebotcazou
* gcc-interface/decl.c (compile_time_known_address_p): Also consider references to constants. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240977 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-10 * gcc-interface/decl.c (gnat_to_gnu_entity): Put volatile qualifierebotcazou
on types at the very end of the processing. (gnat_to_gnu_param): Remove redundant test. (change_qualified_type): Do nothing for unconstrained array types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240915 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-08 * gcc-interface/utils.c (convert) <VECTOR_CST>: Add missing break.ebotcazou
Revert 2016-09-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * gcc-interface/decl.c: Fix fall through comment formatting. * gcc-interface/misc.c: Likewise. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240890 138bc75d-0d04-0410-961f-82ee72b054a4
2016-09-26Fix fallthrough comments for Ada, Solaris/x86, SPARCro
gcc: * config/i386/i386.c (ix86_print_operand) [HAVE_AS_IX86_CMOV_SUN_SYNTAX]: Add gcc_fallthrough. * config/sparc/sparc.c (check_pic): Add fallthrough comment. (epilogue_renumber): Likewise. gcc/ada: * gcc-interface/decl.c: Fix fall through comment formatting. * gcc-interface/misc.c: Likewise. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240509 138bc75d-0d04-0410-961f-82ee72b054a4
2016-09-23 * hsa-gen.c (hsa_op_immed::hsa_op_immed Use CONSTRUCTOR_NELTS (...)jakub
instead of vec_safe_length (CONSTRUCTOR_ELTS (...)). (gen_hsa_ctor_assignment): Likewise. * print-tree.c (print_node): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-sra.c (sra_modify_constructor_assign): Likewise. * expr.c (store_constructor): Likewise. * fold-const.c (operand_equal_p): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * hsa-brig.c (hsa_op_immed::emit_to_buffer): Likewise. * ipa-icf-gimple.c (func_checker::compare_operand): Likewise. cp/ * typeck2.c (process_init_constructor_record): Use CONSTRUCTOR_NELTS (...) instead of vec_safe_length (CONSTRUCTOR_ELTS (...)). * decl.c (reshape_init_r): Likewise. (check_initializer): Likewise. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Use CONSTRUCTOR_NELTS (...) instead of vec_safe_length (CONSTRUCTOR_ELTS (...)). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240390 138bc75d-0d04-0410-961f-82ee72b054a4
2016-07-14 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Type>: Also useebotcazou
the void pointer type if the designated type is incomplete and has no full view in LTO mode. <E_Access_Protected_Subprogram_Type>: Adjust comment. <E_Incomplete_Type>: Likewise. * gcc-interface/trans.c (Call_to_gnu): Do not convert to the type of the actual if it is a dummy type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238333 138bc75d-0d04-0410-961f-82ee72b054a4
2016-07-05 * gcc-interface/decl.c (gnat_to_gnu_entity): Invoke global_bindings_pebotcazou
last when possible. Do not call elaborate_expression_2 on offsets in local record types and avoid useless processing for constant offsets. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238001 138bc75d-0d04-0410-961f-82ee72b054a4
2016-06-29 PR ada/48835ebotcazou
PR ada/61954 * gcc-interface/gigi.h (enum standard_datatypes): Add ADT_realloc_decl (realloc_decl): New macro. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Use local variable for the entity type and translate it as void pointer if the entity has convention C. (gnat_to_gnu_entity) <E_Function>: If this is not a definition and the external name matches that of malloc_decl or realloc_decl, return the correspoding node directly. (gnat_to_gnu_subprog_type): Likewise for parameter and return types. * gcc-interface/trans.c (gigi): Initialize void_list_node here, not... Initialize realloc_decl. * gcc-interface/utils.c (install_builtin_elementary_types): ...here. (build_void_list_node): Delete. * gcc-interface/utils2.c (known_alignment) <CALL_EXPR>: Return the alignment of the system allocator for malloc_decl and realloc_decl. Do not take alignment from void pointer types either. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237850 138bc75d-0d04-0410-961f-82ee72b054a4
2016-06-21 * tree.c (verify_type_variant): Skip TYPE_SIZE and TYPE_SIZE_UNIT ifebotcazou
they are both PLACEHOLDER_EXPRs. ada/ * gcc-interface/decl.c (set_nonaliased_component_on_array_type): New function. (set_reverse_storage_order_on_array_type): Likewise. (gnat_to_gnu_entity) <E_Array_Type>: Call them to set the flags. <E_Array_Subtype>: Likewise. <E_String_Literal_Subtype>: Likewise. (substitute_in_type) <ARRAY_TYPE>: Likewise. * gcc-interface/utils.c (gnat_pushdecl): Always create a variant for the DECL_ORIGINAL_TYPE of a type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237658 138bc75d-0d04-0410-961f-82ee72b054a4
2016-06-13 * gcc-interface/decl.c (gnat_to_gnu_subprog_type): Build only a minimalebotcazou
PARM_DECL when the parameter type is dummy. * gcc-interface/trans.c (Call_to_gnu): Translate formal types before formal objects. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237362 138bc75d-0d04-0410-961f-82ee72b054a4
2016-06-13 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal withebotcazou
PLUS_EXPR in the expression of a renaming. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237360 138bc75d-0d04-0410-961f-82ee72b054a4
2016-06-11 * gcc-interface/decl.c (gnat_to_gnu_entity): Do not clobberebotcazou
gnat_entity_name with temporary names for XUP and XUT types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237324 138bc75d-0d04-0410-961f-82ee72b054a4
2016-06-06 * gcc-interface/decl.c (Gigi_Equivalent_Type): Make sure equivalentebotcazou
types are present before returning them. Remove final assertion. (gnat_to_gnu_entity) <E_Access_Protected_Subprogram_Type>: Adjust to above change. <E_Protected_Type>: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237130 138bc75d-0d04-0410-961f-82ee72b054a4
2016-06-06 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Component>: Removeebotcazou
useless 'else' statements and tidy up. <E_Array_Subtype>: Fully deal with the declaration here. <E_Incomplete_Type>: Use properly-typed constant. Assert that we don't apply the special type treatment to dummy types. Separate this treatment from the final back-annotation and simplify the condition for the RM size. (gnat_to_gnu_param): Add GNU_PARAM_TYPE parameter and adjust. (gnat_to_gnu_subprog_type): Ajust call to gnat_to_gnu_param. * gcc-interface/trans.c (gnat_to_gnu) <N_Subprogram_Declaration>: Add comment. (process_freeze_entity): Remove obsolete code. (process_type): Minor tweaks. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237122 138bc75d-0d04-0410-961f-82ee72b054a4
2016-06-06 * gcc-interface/gigi.h (finish_subprog_decl): Add ASM_NAME parameter.ebotcazou
* gcc-interface/decl.c (gnu_ext_name_for_subprog): New function. (gnat_to_gnu_entity) <E_Subprogram_Type>: Do not check compatibility of profiles for builtins here... Call gnu_ext_name_for_subprog. Also update profiles if pointers to limited_with'ed types are updated. (gnat_to_gnu_param): Restore the correct source location information for vector ABI warnings. (associate_subprog_with_dummy_type): Add comment about AI05-019. Set TYPE_DUMMY_IN_PROFILE_P flag unconditionally. (update_profile): Deal with builtin declarations. Call gnu_ext_name_for_subprog. Adjust call to finish_subprog_decl. (update_profiles_with): Add comment. (gnat_to_gnu_subprog_type): Reuse the return type if it is complete. Likewise for parameter declarations in most cases. Do not change the return type for the CICO mechanism if the profile is incomplete. ...but here instead. Always reset the slot for the parameters. * gcc-interface/utils.c (create_subprog_decl): Call gnu_ext_name_for_subprog. Do not set the assembler name here but... (finish_subprog_decl): ...but here instead. Add ASM_NAME parameter. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237119 138bc75d-0d04-0410-961f-82ee72b054a4
2016-05-20 * tree-vrp.c (compare_values_warnv): Simplify handling of symbolicebotcazou
ranges by calling get_single_symbol and tidy up. Look more closely into NAME + CST1 vs CST2 comparisons if type overflow is undefined. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>: Make same-sized subtypes of signed base types signed. * gcc-interface/utils.c (make_type_from_size): Adjust to above change. (unchecked_convert): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236548 138bc75d-0d04-0410-961f-82ee72b054a4
2016-05-16 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Do not buildebotcazou
a specific type for the object if it is deemed a constant. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236283 138bc75d-0d04-0410-961f-82ee72b054a4
2016-05-16 * doc/gnat_rm/implementation_defined_attributes.rstebotcazou
(Scalar_Storage_Order): Adjust restriction for packed array types. * einfo.ads (Is_Bit_Packed_Array): Adjust description. (Is_Packed): Likewise. (Is_Packed_Array_Impl_Type): Likewise. (Packed_Array_Impl_Type): Likewise. * exp_ch4.adb (Expand_N_Indexed_Component): Do not do anything special if the prefix is not a packed array implemented specially. * exp_ch6.adb (Expand_Actuals): Expand indexed components only for bit-packed array types. * exp_pakd.adb (Install_PAT): Set Is_Packed_Array_Impl_Type flag on the PAT before analyzing its declaration. (Create_Packed_Array_Impl_Type): Remove redundant statements. * freeze.adb (Check_Component_Storage_Order): Reject packed array components only if they are bit packed. (Freeze_Array_Type): Fix logic detecting bit packing and do not bit pack for composite types whose size is multiple of a byte. Create the implementation type for packed array types only when it is needed, i.e. bit packing or packing because of holes in index types. Make sure the Has_Non_Standard_Rep and Is_Packed flags agree. * gcc-interface/gigi.h (make_packable_type): Add MAX_ALIGN parameter. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>: Call maybe_pad_type instead of building the padding type manually. (gnat_to_gnu_entity) <E_Array_Subtype>: Do not assert that Packed_Array_Impl_Type is present for packed arrays. (gnat_to_gnu_component_type): Also handle known alignment for packed types by passing it to make_packable_type. * gcc-interface/utils.c (make_packable_type): Add MAX_ALIGN parameter and deal with it in the array case. Adjust recursive call. Simplify computation of new size and cap the alignment to BIGGEST_ALIGNMENT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236279 138bc75d-0d04-0410-961f-82ee72b054a4
2016-05-02 * gcc-interface/decl.c (elaborate_reference_1): Do not bother aboutebotcazou
operand #2 for COMPONENT_REF. * gcc-interface/utils2.c (gnat_save_expr): Likewise. (gnat_protect_expr): Likewise. (gnat_stabilize_reference_1): Likewise. (gnat_rewrite_reference): Do not bother about operand #3 for ARRAY_REF. (get_inner_constant_reference): Likewise. (gnat_invariant_expr): Likewise. * gcc-interface/trans.c (fold_constant_decl_in_expr): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235701 138bc75d-0d04-0410-961f-82ee72b054a4
2016-04-27 * sem_aux.adb (Is_By_Reference_Type): Also return true for a taggedebotcazou
incomplete type without full view. * sem_ch6.adb (Exchange_Limited_Views): Change into a function and return the list of changes. (Restore_Limited_Views): New procedure to undo the transformation made by Exchange_Limited_Views. (Analyze_Subprogram_Body_Helper): Adjust call to Exchange_Limited_Views and call Restore_Limited_Views at the end, if need be. (Possible_Freeze): Do not delay freezing because of incomplete types. (Process_Formals): Remove kludges for class-wide types. * types.h (By_Copy_Return): Delete. * gcc-interface/ada-tree.h (TYPE_MAX_ALIGN): Move around. (TYPE_DUMMY_IN_PROFILE_P): New macro. * gcc-interface/gigi.h (update_profiles_with): Declare. (finish_subprog_decl): Likewise. (get_minimal_subprog_decl): Delete. (create_subprog_type): Likewise. (create_param_decl): Adjust prototype. (create_subprog_decl): Likewise. * gcc-interface/decl.c (defer_limited_with): Rename into... (defer_limited_with_list): ...this. (gnat_to_gnu_entity): Adjust to above renaming. (finalize_from_limited_with): Likewise. (tree_entity_vec_map): New structure. (gt_pch_nx): New helpers. (dummy_to_subprog_map): New hash table. (gnat_to_gnu_param): Set the SLOC here. Remove MECH parameter and add FIRST parameter. Deal with the mechanism here instead of... Do not make read-only variant of types. Simplify expressions. In the by-ref case, test the mechanism before must_pass_by_ref and also TYPE_IS_BY_REFERENCE_P before building the reference type. (gnat_to_gnu_subprog_type): New static function extracted from... Do not special-case the type_annotate_only mode. Call gnat_to_gnu_profile_type instead of gnat_to_gnu_type on return type. Deal with dummy return types. Likewise for parameter types. Deal with by-reference types explicitly and add a kludge for null procedures with untagged incomplete types. Remove assertion on the types and be prepared for multiple elaboration of the declarations. Skip the whole CICO processing if the profile is incomplete. Handle the completion of a previously incomplete profile. (gnat_to_gnu_entity) <E_Variable>: Rename local variable. Adjust couple of calls to create_param_decl. <E_Access_Subprogram_Type, E_Anonymous_Access_Subprogram_Type>: Remove specific deferring code. <E_Access_Type>: Also deal with E_Subprogram_Type designated type. Simplify handling of dummy types and remove obsolete comment. Constify a couple of variables. Do not set TYPE_UNIVERSAL_ALIASING_P on dummy types. <E_Access_Subtype>: Tweak comment and simplify condition. <E_Subprogram_Type>: ...here. Call it and clean up handling. Remove obsolete comment and adjust call to gnat_to_gnu_param. Adjust call to create_subprog_decl. <E_Incomplete_Type>: Add a couple of 'const' qualifiers and get rid of inner break statements. Tidy up condition guarding direct use of the full view. (get_minimal_subprog_decl): Delete. (finalize_from_limited_with): Call update_profiles_with on dummy types with TYPE_DUMMY_IN_PROFILE_P set. (is_from_limited_with_of_main): Delete. (associate_subprog_with_dummy_type): New function. (update_profile): Likewise. (update_profiles_with): Likewise. (gnat_to_gnu_profile_type): Likewise. (init_gnat_decl): Initialize dummy_to_subprog_map. (destroy_gnat_decl): Destroy dummy_to_subprog_map. * gcc-interface/misc.c (gnat_get_alias_set): Add guard for accessing TYPE_UNIVERSAL_ALIASING_P. (gnat_get_array_descr_info): Minor tweak. * gcc-interface/trans.c (gigi): Adjust calls to create_subprog_decl. (build_raise_check): Likewise. (Compilation_Unit_to_gnu): Likewise. (Identifier_to_gnu): Accept mismatches coming from a limited context. (Attribute_to_gnu): Remove kludge for dispatch table entities. (process_freeze_entity): Do not retrieve old definition if there is an address clause on the entity. Call update_profiles_with on dummy types with TYPE_DUMMY_IN_PROFILE_P set. * gcc-interface/utils.c (build_dummy_unc_pointer_types): Also set TYPE_REFERENCE_TO to the fat pointer type. (create_subprog_type): Delete. (create_param_decl): Remove READONLY parameter. (finish_subprog_decl): New function extracted from... (create_subprog_decl): ...here. Call it. Remove CONST_FLAG and VOLATILE_FLAG parameters and adjust. (update_pointer_to): Also clear TYPE_REFERENCE_TO in the unconstrained case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235521 138bc75d-0d04-0410-961f-82ee72b054a4
2016-04-27 * gcc-interface/gigi.h (gnat_to_gnu_entity): Adjust prototype.ebotcazou
(maybe_pad_type): Adjust comment. (finish_record_type): Likewise. (rest_of_record_type_compilation): Likewise. * gcc-interface/decl.c (gnat_to_gnu_entity): Change DEFINITION type parameter from integer to boolean. Adjust recursive calls. <E_Subprogram_Type>: Use copy_type and remove redundant assignments. <E_Signed_Integer_Subtype>: Adjust comment. Remove call to rest_of_record_type_compilation. Set TYPE_PADDING_P flag earlier. Pass false to finish_record_type. Set the debug type later. <E_Record_Subtype>: Remove call to rest_of_record_type_compilation. (gnat_to_gnu_component_type): Fix formatting. (gnat_to_gnu_field_decl): Adjust call to gnat_to_gnu_entity. (gnat_to_gnu_type): Likewise. * gcc-interface/trans.c (Identifier_to_gnu): Likewise. (Loop_Statement_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Exception_Handler_to_gnu_fe_sjlj): Likewise. (Exception_Handler_to_gnu_gcc): Likewise. (Compilation_Unit_to_gnu): Likewise. (gnat_to_gnu): Likewise. (push_exception_label_stack): Likewise. (elaborate_all_entities_for_package): Likewise. (process_freeze_entity): Likewise. (process_decls): Likewise. (process_type): Likewise. * gcc-interface/utils.c (struct deferred_decl_context_node): Tweak. (maybe_pad_type): Adjust comments. Set the debug type later. Remove call to rest_of_record_type_compilation. (rest_of_record_type_compilation): Use copy_type. (copy_type): Use correctly typed constants. (gnat_signed_or_unsigned_type_for): Use copy_type. * gcc-interface/utils2.c (nonbinary_modular_operation): Likewise. (build_goto_raise): Adjust call tognat_to_gnu_entity. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235479 138bc75d-0d04-0410-961f-82ee72b054a4
2016-04-18 * tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount.matz
(SET_TYPE_ALIGN, SET_DECL_ALIGN): New. * tree-core.h (tree_type_common.align): Use bit-field. (tree_type_common.spare): New. (tree_decl_common.off_align): Make smaller. (tree_decl_common.align): Use bit-field. * expr.c (expand_expr_addr_expr_1): Use SET_TYPE_ALIGN. * omp-low.c (install_var_field): Use SET_DECL_ALIGN. (scan_sharing_clauses): Ditto. (finish_taskreg_scan): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (omp_finish_file): Ditto. * stor-layout.c (do_type_align): Use SET_DECL_ALIGN. (layout_decl): Ditto. (relayout_decl): Ditto. (finalize_record_size): Use SET_TYPE_ALIGN. (finalize_type_size): Ditto. (finish_builtin_struct): Ditto. (layout_type): Ditto. (initialize_sizetypes): Ditto. * targhooks.c (std_gimplify_va_arg_expr): Use SET_TYPE_ALIGN. * tree-nested.c (insert_field_into_struct): Use SET_TYPE_ALIGN. (lookup_field_for_decl): Use SET_DECL_ALIGN. (get_chain_field): Ditto. (get_trampoline_type): Ditto. (get_nl_goto_field): Ditto. * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Use SET_DECL_ALIGN. (unpack_ts_type_common_value_fields): Use SET_TYPE_ALIGN. * gimple-expr.c (copy_var_decl): Use SET_DECL_ALIGN. * tree.c (make_node_stat): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (build_qualified_type): Use SET_TYPE_ALIGN. (build_aligned_type, build_range_type_1): Ditto. (build_atomic_base): Ditto. (build_common_tree_nodes): Ditto. * cfgexpand.c (align_local_variable): Use SET_DECL_ALIGN. (expand_one_stack_var_at): Ditto. * coverage.c (build_var): Use SET_DECL_ALIGN. * except.c (init_eh): Ditto. * function.c (assign_parm_setup_block): Ditto. * symtab.c (increase_alignment_1): Ditto. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Ditto. * tree-vect-stmts.c (ensure_base_align): Ditto. * varasm.c (align_variable): Ditto. (assemble_variable): Ditto. (build_constant_desc): Ditto. (output_constant_def_contents): Ditto. * config/arm/arm.c (arm_relayout_function): Use SET_DECL_ALIGN. * config/avr/avr.c (avr_adjust_type_node): Use SET_TYPE_ALIGN. * config/mips/mips.c (mips_std_gimplify_va_arg_expr): Ditto. * config/msp430/msp430.c (msp430_gimplify_va_arg_expr): Ditto. * config/spu/spu.c (spu_build_builtin_va_list): Use SET_DECL_ALIGN. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Use SET_TYPE_ALIGN. (gnat_to_gnu_field): Ditto. (components_to_record): Ditto. (create_variant_part_from): Ditto. (copy_and_substitute_in_size): Ditto. (substitute_in_type): Ditto. * gcc-interface/utils.c (make_aligning_type): Use SET_TYPE_ALIGN. (make_packable_type): Ditto. (maybe_pad_type): Ditto. (finish_fat_pointer_type): Ditto. (finish_record_type): Ditto and use SET_DECL_ALIGN. (rest_of_record_type_compilation): Use SET_TYPE_ALIGN. (create_field_decl): Use SET_DECL_ALIGN. c-family/ * c-common.c (handle_aligned_attribute): Use SET_TYPE_ALIGN and SET_DECL_ALIGN. c/ * c-decl.c (merge_decls): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (grokdeclarator, parser_xref_tag, finish_enum): Use SET_TYPE_ALIGN. cp/ * class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (layout_class_type): Ditto. (build_base_field): Use SET_DECL_ALIGN. (fixup_attribute_variants): Use SET_TYPE_ALIGN. * decl.c (duplicate_decls): Use SET_DECL_ALIGN. (record_unknown_type): Use SET_TYPE_ALIGN. (cxx_init_decl_processing): Ditto. (copy_type_enum): Ditto. (grokfndecl): Use SET_DECL_ALIGN. (copy_type_enum): Use SET_TYPE_ALIGN. * pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN. (tsubst): Ditto. * tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN. * lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN. * method.c (implicitly_declare_fn): Use SET_DECL_ALIGN. * rtti.c (emit_tinfo_decl): Ditto. fortran/ * trans-io.c (gfc_build_io_library_fndecls): Use SET_TYPE_ALIGN. * trans-common.c (build_common_decl): Use SET_DECL_ALIGN. * trans-types.c (gfc_add_field_to_struct): Use SET_DECL_ALIGN. go/ * go-gcc.cc (Gcc_backend::implicit_variable): Use SET_DECL_ALIGN. java/ * class.c (add_method_1): Use SET_DECL_ALIGN. (make_class_data): Ditto. (emit_register_classes_in_jcr_section): Ditto. * typeck.c (build_java_array_type): Ditto. objc/ * objc-act.c (objc_build_struct): Use SET_DECL_ALIGN. libcc1/ * plugin.cc (plugin_finish_record_or_union): Use SET_TYPE_ALIGN. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235172 138bc75d-0d04-0410-961f-82ee72b054a4
2016-04-18 * gcc-interface/decl.c: Rename Descendent -> Descendantcharlet
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235104 138bc75d-0d04-0410-961f-82ee72b054a4
2016-04-02 * gcc-interface/decl.c (components_to_record): Restrict the previousebotcazou
change to fields with variable size. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234696 138bc75d-0d04-0410-961f-82ee72b054a4
2016-03-27 * gcc-interface/decl.c (components_to_record): Add special case for ebotcazou
single field with representation clause at offset 0. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234494 138bc75d-0d04-0410-961f-82ee72b054a4
2016-03-07 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Always markebotcazou
the expression of a renaming manually in case #3. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234018 138bc75d-0d04-0410-961f-82ee72b054a4
2016-02-29 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Type>: Retrofitebotcazou
handling of unconstrained array types as designated types into common processing. Also handle array types as incomplete designated types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233807 138bc75d-0d04-0410-961f-82ee72b054a4
2016-02-29 * gcc-interface/decl.c (gnat_to_gnu_entity) <Concurrent types>: Inebotcazou
ASIS mode, fully lay out the minimal record type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233806 138bc75d-0d04-0410-961f-82ee72b054a4
2016-02-29 * gcc-interface/ada-tree.h (DECL_RETURN_VALUE_P): New macro.ebotcazou
* gcc-interface/gigi.h (gigi): Remove useless attribute. (gnat_gimplify_expr): Likewise. (gnat_to_gnu_external): Declare. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Factor out code dealing with the expression of external constants into... Invoke gnat_to_gnu_external instead. <E_Variable>: Invoke gnat_to_gnu_external to translate renamed objects when not for a definition. Deal with COMPOUND_EXPR and variables with DECL_RETURN_VALUE_P set for renamings and with the case of a dangling 'reference to a function call in a renaming. Remove obsolete test and adjust associated comment. * gcc-interface/trans.c (Call_to_gnu): Set DECL_RETURN_VALUE_P on the temporaries created to hold the return value, if any. (gnat_to_gnu_external): ...this. New function. * gcc-interface/utils.c (create_var_decl): Detect a constant created to hold 'reference to function call. * gcc-interface/utils2.c (build_unary_op) <ADDR_EXPR>: Add folding for COMPOUND_EXPR in the DECL_RETURN_VALUE_P case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233804 138bc75d-0d04-0410-961f-82ee72b054a4
2016-01-28 * gcc-interface/gigi.h (enum attr_type): Rename into...ebotcazou
(enum attrib_type): ...this. (struct attrib): Adjust. * gcc-interface/decl.c (prepend_one_attribute): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232923 138bc75d-0d04-0410-961f-82ee72b054a4
2016-01-20 * exp_ch2.adb (Expand_Current_Value): Make an appropriate characterebotcazou
literal if the entity is of a character type. * gcc-interface/lang.opt (fsigned-char): New option. * gcc-interface/misc.c (gnat_handle_option): Accept it. (gnat_init): Adjust comment. * gcc-interface/gigi.h (finish_character_type): New prototype. (maybe_character_type): New inline function. (maybe_character_value): Likewise. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Enumeration_Type>: For a character of CHAR_TYPE_SIZE, make a signed type if flag_signed_char. Set TYPE_ARTIFICIAL early and call finish_character_type on the type. <E_Enumeration_Subtype>: For a subtype of character with RM_Size and Esize equal to CHAR_TYPE_SIZE, make a signed type if flag_signed_char. Copy TYPE_STRING_FLAG from type to subtype. <E_Array_Type>: Deal with character index types. <E_Array_Subtype>: Likewise. * gcc-interface/trans.c (gigi): Replace unsigned_char_type_node with char_type_node throughout. (build_raise_check): Likewise. (get_type_length): Deal with character types. (Attribute_to_gnu) <Attr_Pos>: Likewise. Remove obsolete range check code. Minor tweak. <Attr_Pred>: Likewise. (Loop_Statement_to_gnu): Likewise. (Raise_Error_to_gnu): Likewise. <N_Indexed_Component>: Deal with character index types. Remove obsolete code. <N_Slice>: Likewise. <N_Type_Conversion>: Deal with character types. Minor tweak. <N_Unchecked_Type_Conversion>: Likewise. <N_In>: Likewise. <N_Op_Eq>: Likewise. (emit_index_check): Delete. * gcc-interface/utils.c (finish_character_type): New function. (gnat_signed_or_unsigned_type_for): Deal with built-in character types. * gcc-interface/utils2.c (expand_sloc): Replace unsigned_char_type_node with char_type_node. (build_call_raise): Likewise. (build_call_raise_column): Likewise. (build_call_raise_range): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232604 138bc75d-0d04-0410-961f-82ee72b054a4
2016-01-18 * gcc-interface/gigi.h (build_call_raise_column): Adjust prototype.ebotcazou
(build_call_raise_range): Likewise. (gnat_unsigned_type): Delete. (gnat_signed_type): Likewise. (gnat_signed_or_unsigned_type_for): New prototype. (gnat_unsigned_type_for): New inline function. (gnat_signed_type_for): Likewise. * gcc-interface/cuintp.c (build_cst_from_int): Call build_int_cst. * gcc-interface/decl.c (gnat_to_gnu_entity): Likewise. (gnat_to_gnu_entity) <E_Array_Type>: Always translate the index types and compute their base type from that. <E_Array_Subtype>: Remove duplicate declaration. * gcc-interface/misc.c (get_array_bit_stride): Call build_int_cst. * gcc-interface/trans.c (get_type_length): Likewise. (Attribute_to_gnu): Likewise. (Loop_Statement_to_gnu): Likewise. (Call_to_gnu): Likewise. (gnat_to_gnu): Call build_real, build_int_cst, gnat_unsigned_type_for and gnat_signed_type_for. Minor tweaks. (build_binary_op_trapv): Likewise. (emit_check): Likewise. (convert_with_check): Likewise. (Raise_Error_to_gnu): Adjust calls to the build_call_raise family of functions. Minor tweaks. (Case_Statement_to_gnu): Remove dead code. (gnat_to_gnu): Call gnat_unsigned_type_for and gnat_signed_type_for. (init_code_table): Minor reordering. * gcc-interface/utils.c (gnat_unsigned_type): Delete. (gnat_signed_type): Likewise. (gnat_signed_or_unsigned_type_for): New function. (unchecked_convert): Use directly the size in the test for precision vs size adjustments. (install_builtin_elementary_types): Call gnat_signed_type_for. * gcc-interface/utils2.c (nonbinary_modular_operation): Call build_int_cst. (build_goto_raise): New function taken from... (build_call_raise): ...here. Call it. (build_call_raise_column): Add KIND parameter and call it. (build_call_raise_range): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232503 138bc75d-0d04-0410-961f-82ee72b054a4
2016-01-18 * gcc-interface/ada-tree.h (TYPE_IMPLEMENTS_PACKED_ARRAY_P): Rename toebotcazou
(TYPE_IMPL_PACKED_ARRAY_P): ...this. (TYPE_CAN_HAVE_DEBUG_TYPE_P): Do not test TYPE_DEBUG_TYPE. * gcc-interface/decl.c (gnat_to_gnu_entity): Simplify NULL_TREE tests and tweak gnat_encodings tests throughout. (initial_value_needs_conversion): Likewise. (intrin_arglists_compatible_p): Likewise. * gcc-interface/misc.c (gnat_print_type): Likewise. (gnat_get_debug_type): Likewise. (gnat_get_fixed_point_type_info): Likewise. (gnat_get_array_descr_info): Likewise. (get_array_bit_stride): Likewise. (gnat_get_type_bias): Fix formatting. (enumerate_modes): Likewise. * gcc-interface/trans.c (gnat_to_gnu): Likewise. (add_decl_expr): Simplify NULL_TREE test. (end_stmt_group): Likewise. (build_binary_op_trapv): Fix formatting. (get_exception_label): Use switch statement. (init_code_table): Move around. * gcc-interface/utils.c (global_bindings_p): Simplify NULL_TREE test. (gnat_poplevel): Likewise. (gnat_set_type_context): Likewise. (defer_or_set_type_context): Fix formatting. (gnat_pushdecl): Simplify NULL_TREE test. (maybe_pad_type): Likewise. (add_parallel_type): Likewise. (create_range_type): Likewise. (process_deferred_decl_context): Likewise. (convert): Likewise. (def_builtin_1): Likewise. * gcc-interface/utils2.c (find_common_type): Likewise. (build_binary_op): Likewise. (gnat_rewrite_reference): Likewise. (get_inner_constant_reference): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232501 138bc75d-0d04-0410-961f-82ee72b054a4
2015-12-20 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Duringebotcazou
layout in type_annotate_only mode, skip discriminants of derived tagged types renaming those of the parent type. In type_annotate_only mode, if the type is tagged, do not override a size clause but take into account the alignment of the tag. (annotate_rep): In type_annotate_only mode, deal with discriminants of derived tagged types renaming those of the parent type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231860 138bc75d-0d04-0410-961f-82ee72b054a4