aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/utils.c
AgeCommit message (Collapse)AuthorFilesLines
2007-06-06gigi.h, trans.c (Identifier_to_gnu): Change test for deferred constant by ↵Gary Dismukes1-177/+397
adding guard that the entity is an... 2007-04-20 Gary Dismukes <dismukes@adacore.com> Eric Botcazou <ebotcazou@adacore.com> Tristan Gingold <gingold@adacore.com> Olivier Hainque <hainque@adacore.com> * gigi.h, trans.c (Identifier_to_gnu): Change test for deferred constant by adding guard that the entity is an E_Constant before testing presence of Full_view (and remove now-unnecessary test that entity is not a type). For a CONST_DECL used by reference, manually retrieve the DECL_INITIAL. Do not invoke fold in the other DECL_P cases either. (struct language_function): Move from utils.c to here. (struct parm_attr): New structure. (parm_attr, parm_attr vector, parm_attr GC vector): New types. (f_parm_attr_cache): New macro. (Attribute_to_gnu) <Attr_Length>: When not optimizing, cache the expressions for the 'First, 'Last and 'Length attributes of the unconstrained array IN parameters. (Subprogram_Body_to_gnu): Use gnu_subprog_decl throughout. Allocate the information structure for the function earlier, as well as the language-specific part. If the parameter attributes cache has been populated, evaluate the cached expressions on entry. (takes_address): Add OPERAND_TYPE parameter. Handle N_Function_Call, N_Procedure_Call_Statement and N_Indexed_Component. (Pragma_to_gnu): Translate inspection_point to an asm statement containaing a comment and a reference to the object (either its address for BLKmode or its value). (Identifier_to_gnu): Use TREE_CONSTANT instead of CONST_DECL to decide to go to DECL_INITIAL. Together with the size constraint relaxation in create_var_decl, enlarges the set of situations in which an identifier may be used as an initializer without implying elaboration code. (Subprogram_Body_to_gnu): Do not fiddle with the debug interface but set DECL_IGNORED_P on the function if Needs_Debug_Info is not set on the node. (maybe_stabilize_reference): Remove lvalues_only parameter. (gnat_stabilize_reference): Adjust for above change. (gnat_to_gnu): Do not set location information on the result if it is a reference. (add_cleanup): Add gnat_node parameter and set the location of the cleanup to it. (Handled_Sequence_Of_Statements_to_gnu): Adjust calls to add_cleanup. (Exception_Handler_to_gnu_zcx): Likewise. (gigi): Remove the cgraph node if the elaboration procedure is empty. (Subprogram_Body_to_gnu): If a stub is attached to the subprogram, emit the former right after the latter. (start_stmt_group): Make global. (end_stmt_group): Likewise. (gnu_constraint_error_label_stack, gnu_storage_error_label_stack): New vars. (gnu_program_error_label_stack): Likewise. (gigi): Initialize them. (call_to_gnu, gnat_to_gnu, emit_check): Add new arg to build_call_raise. (gnat_to_gnu, N_{Push,Pop}_{Constraint,Storage,Program}_Error_Label): New cases. (push_exception_label_stack): New function. (takes_address): New function. * utils.c (struct language_function): Move to trans.c from here. (unchecked_convert): Do not wrap up integer constants in VIEW_CONVERT_EXPRs. (create_var_decl_1): Decouple TREE_CONSTANT from CONST_DECL. Prevent the latter for aggregate types, unexpected by later passes, and relax an arbitrary size constraint on the former. (create_field_decl): Use tree_int_cst_equal instead of operand_equal_p to compare the sizes. (convert_vms_descriptor): When converting to a fat pointer type, be prepared for a S descriptor at runtime in spite of a SB specification. (shift_unc_components_for_thin_pointers): New function. (write_record_type_debug_info): For variable-sized fields, cap the alignment of the pointer to the computed alignment. (finish_record_type): Change HAS_REP parameter into REP_LEVEL. If REP_LEVEL is 2, do not compute the sizes. (build_vms_descriptor): Adjust for new prototype of finish_record_type. (build_unc_object_type): Likewise. (declare_debug_type): New function. * ada-tree.def: USE_STMT: removed (not emitted anymore). * misc.c (gnat_expand_expr): Call to gnat_expand_stmt removed because no statement is expandable anymore. (gnat_init_gcc_eh): Do not initialize the DWARF-2 CFI machinery twice. (gnat_handle_option): Only allow flag_eliminate_debug_types to be set when the user requested it explicitely. (gnat_post_options): By default, set flag_eliminate_unused_debug_types to 0 for Ada. (get_alias_set): Return alias set 0 for a type if TYPE_UNIVERSAL_ALIASING_P is set on its main variant. * ada-tree.h: (TYPE_UNIVERSAL_ALIASING_P): New macro. (DECL_FUNCTION_STUB): New accessor macro. (SET_DECL_FUNCTION_STUB): New setter macro. * lang.opt (feliminate-unused-debug-types): Intercept this flag for Ada. * fe.h (Get_Local_Raise_Call_Entity, Get_RT_Exception_Entity): New declarations. From-SVN: r125371
2007-04-06utils.c (update_pointer_to): Make a copy of the couple of FIELD_DECLs when...Eric Botcazou1-66/+144
2007-04-06 Eric Botcazou <botcazou@adacore.com> Olivier Hainque <hainque@adacore.com> * utils.c (update_pointer_to): Make a copy of the couple of FIELD_DECLs when updating the contents of the old pointer to an unconstrained array. (end_subprog_body): Set error_gnat_node to Empty. (write_record_type_debug_info): Do not be unduly sparing with our bytes. (unchecked_convert): For subtype to base type conversions, require that the source be a subtype if it is an integer type. (builtin_decls): New global, vector of available builtin functions. (gnat_pushdecl): Add global builtin function declaration nodes to the builtin_decls list. (gnat_install_builtins): Adjust comments. (builtin_function): Set DECL_BUILTIN_CLASS and DECL_FUNCTION_CODE before calling gnat_pushdecl, so that it knows when it handed a builtin function declaration node. (builtin_decl_for): Search the builtin_decls list. From-SVN: r123609
2007-03-30typeck.c (java_signed_or_unsigned_type): Remove.Rafael Avila de Espindola1-11/+0
gcc/java/ChangeLog: * typeck.c (java_signed_or_unsigned_type): Remove. (java_signed_type): use get_signed_or_unsigned_type instead of java_signed_or_unsigned_type. (java_unsigned_type): Ditto. * lang.c (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove. * java-tree.h (java_signed_or_unsigned_type): Remove gcc/Changelog: * tree.h(get_signed_or_unsigned_type): New * fold-const.c (operand_equal_for_comparison_p): Use get_signed_or_unsigned_type instead of lang_hooks.types.signed_or_unsigned_type. * expr.c (store_expr): Ditto. * langhooks.c (get_signed_or_unsigned_type): New. (lhd_signed_or_unsigned_type): New * langhooks.h (lhd_signed_or_unsigned_type): New. * langhooks-def.h (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Define. gcc/treelang/ChangeLog: * treetree.c (tree_lang_signed_or_unsigned_type): Remove. (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE) Remove. gcc/ada/ChangeLog: * trans.c (Attribute_to_gnu): Use get_signed_or_unsigned_type instead of gnat_signed_or_unsigned_type. * utils.c (gnat_signed_or_unsigned_type): Remove. * misc.c (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove * gigi.h (gnat_signed_or_unsigned_type): Remove gcc/forrtan/trans-types.c: * trans-types.c (gfc_signed_or_unsigned_type): Remove. (gfc_unsigned_type): Use get_signed_or_unsigned_type instead of gfc_signed_or_unsigned_type. (gfc_signed_type): Ditto. * trans-types.h (gfc_signed_or_unsigned_type): Remove. * f95-lang.c (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove. From-SVN: r123373
2007-03-09cuintp.c (UI_To_gnu): Use fold_buildN calls instead of calling fold with the ↵Roger Sayle1-25/+25
result of buildN. * cuintp.c (UI_To_gnu): Use fold_buildN calls instead of calling fold with the result of buildN. * decl.c (gnat_to_gnu_entity): Likewise. * trans.c (Attribute_to_gnu, gnat_to_gnu, emit_check): Likewise. * utils.c (finish_record_type, merge_sizes, max_size, convert): Likewise. * utils2.c (gnat_truthvalue_conversion, compare_arrays, nonbinary_modular_operation, build_binary_op, build_unary_op, build_cond_expr): Likewise. * utils.c (convert): Use fold_build1 when casting values to void. * utils2.c (gnat_truthvalue_conversion): Use build_int_cst and fold_convert instead of convert when appropriate. From-SVN: r122752
2007-02-16trans.c (call_to_gnu): Use build_call_list instead of build3 to build the ↵Eric Botcazou1-11/+13
call expression. * trans.c (call_to_gnu): Use build_call_list instead of build3 to build the call expression. (gnat_stabilize_reference_1): Handle tcc_vl_exp. * utils.c (max_size) <tcc_exceptional>: Delete. <tcc_vl_exp>: New case. <tcc_expression>: Delete CALL_EXPR subcase. (build_global_cdtor): Use build_call_nary instead of build3. * utils2.c (build_call_1_expr): Likewise. (build_call_2_expr): Likewise. (build_call_0_expr): Likewise. (build_call_alloc_dealloc): Likewise. Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com> From-SVN: r122058
2007-01-25decl.c (gnat_to_gnu_entity): Use TREE_OVERFLOW instead of ↵Roger Sayle1-2/+2
TREE_CONSTANT_OVERFLOW. * decl.c (gnat_to_gnu_entity): Use TREE_OVERFLOW instead of TREE_CONSTANT_OVERFLOW. (allocatable_size_p, annotate_value): Likewise. * trans.c (gnat_to_gnu): Likewise. * utils.c (unchecked_convert): Likewise. * utils2.c (build_simple_component_ref): Likewise. From-SVN: r121177
2006-10-31gigi.h: (tree_code_for_record_type): Declare.Eric Botcazou1-41/+437
2006-10-31 Eric Botcazou <ebotcazou@adacore.com> Nicolas Setton <setton@adacore.com> Olivier Hainque <hainque@adacore.com> Gary Dismukes <dismukes@adacore.com> * gigi.h: (tree_code_for_record_type): Declare. (add_global_renaming_pointer): Rename to record_global_renaming_pointer. (get_global_renaming_pointers): Rename to invalidate_global_renaming_pointers. (static_ctors): Delete. (static_dtors): Likewise. (gnat_write_global_declarations): Declare. (create_var_decl): Adjust descriptive comment to indicate that the subprogram may return a CONST_DECL node. (create_true_var_decl): Declare new function, similar to create_var_decl but forcing the creation of a VAR_DECL node. (get_global_renaming_pointers): Declare. (add_global_renaming_pointer): Likewise. * ada-tree.h (DECL_READONLY_ONCE_ELAB): New macro. * decl.c (gnat_to_gnu_entity) <case E_Function>: Don't copy the type tree before setting TREE_ADDRESSABLE for by-reference return mechanism processing. (gnat_to_gnu_entity): Remove From_With_Type from computation for imported_p. <E_Access_Type>: Use the Non_Limited_View as the full view of the designated type if the pointer comes from a limited_with clause. Make incomplete designated type if it is in the main unit and has a freeze node. <E_Incomplete_Type>: Rework to treat Non_Limited_View, Full_View, and Underlying_Full_View similarly. Return earlier if the full view already has an associated tree. (gnat_to_gnu_entity) <E_Record_Type>: Restore comment. (gnat_to_gnu_entity) <E_Record_Type>: Do not use a dummy type. (gnat_to_gnu_entity) <E_Variable>: Set TYPE_REF_CAN_ALIAS_ALL on the reference type built for objects with an address clause. Use create_true_var_decl with const_flag set for DECL_CONST_CORRESPONDING_VARs, ensuring a VAR_DECL is created with TREE_READONLY set. (gnat_to_gnu_entity, case E_Enumeration_Type): Set TYPE_NAME for Character and Wide_Character types. This info is read by the dwarf-2 writer, and is needed to be able to use the command "ptype character" in the debugger. (gnat_to_gnu_entity): When generating a type representing a Character or Wide_Character type, set the flag TYPE_STRING_FLAG, so that debug writers can distinguish it from ordinary integers. (elaborate_expression_1): Test the DECL_READONLY_ONCE_ELAB flag in addition to TREE_READONLY to assert the constantness of variables for elaboration purposes. (gnat_to_gnu_entity, subprogram cases): Change loops on formal parameters to call new Einfo function First_Formal_With_Extras. (gnat_to_gnu_entity): In type_annotate mode, replace a discriminant of a protected type with its corresponding discriminant, to obtain a usable declaration (gnat_to_gnu_entity) <E_Access_Protected_Subprogram_Type>: Be prepared for a multiple elaboration of the "equivalent" type. (gnat_to_gnu_entity): Adjust for renaming of add_global_renaming_pointer into record_global_renaming_pointer. (gnat_to_gnu_entity) <E_Array_Type>: Do not force TYPE_NONALIASED_COMPONENT to 0 if the element type is an aggregate. <E_Array_Subtype>: Likewise. (gnat_to_gnu_entity) <E_Incomplete_Subtype>: Add support for regular incomplete subtypes and incomplete subtypes of incomplete types visible through a limited with clause. (gnat_to_gnu_entity) <E_Array_Subtype>: Take into account the bounds of the base index type for the maximum size of the array only if they are constant. (gnat_to_gnu_entity, renaming object case): Do not wrap up the expression into a SAVE_EXPR if stabilization failed. * utils.c (create_subprog_decl): Turn TREE_ADDRESSABLE on the type of a result decl into DECL_BY_REFERENCE on this decl, now what is expected by lower level compilation passes. (gnat_genericize): New function, lowering a function body to GENERIC. Turn the type of RESULT_DECL into a real reference type if the decl has been marked DECL_BY_REFERENCE, and adjust references to the latter accordingly. (gnat_genericize_r): New function. Tree walking callback for gnat_genericize. (convert_from_reference, is_byref_result): New functions. Helpers for gnat_genericize_r. (create_type_decl): Call gnat_pushdecl before calling rest_of_decl_compilation, to make sure that field TYPE_NAME of type_decl is properly set before calling the debug information writers. (write_record_type_debug_info): The heuristics which compute the alignment of a field in a variant record might not be accurate. Add a safety test to make sure no alignment is set to a smaller value than the alignment of the field type. (make_dummy_type): Use the Non_Limited_View as the underlying type if the type comes from a limited_with clause. Do not loop on the full view. (GET_GNU_TREE, SET_GNU_TREE, PRESENT_GNU_TREE): New macros. (dummy_node_table): New global variable, moved from decl.c. (GET_DUMMY_NODE, SET_DUMMY_NODE, PRESENT_DUMMY_NODE): New macros. (save_gnu_tree): Use above macros. (get_gnu_tree): Likewise. (present_gnu_tree): Likewise. (init_dummy_type): New function, moved from decl.c. Use above macros. (make_dummy_type): Likewise. (tree_code_for_record_type): New function extracted from make_dummy_type (init_gigi_decls): Set DECL_IS_MALLOC on gnat_malloc. (static_ctors): Change it to a vector, make static. (static_dtors): Likewise. (end_subprog_body): Adjust for above change. (build_global_cdtor): Moved from trans.c. (gnat_write_global_declarations): Emit global constructor and destructor, and call cgraph_optimize before emitting debug info for global declarations. (global_decls): New global variable. (gnat_pushdecl): Store the global declarations in global_decls, for later use. (gnat_write_global_declarations): Emit debug information for global declarations. (create_var_decl_1): Former create_var_decl, with an extra argument to state whether the creation of a CONST_DECL is allowed. (create_var_decl): Behavior unchanged. Now a wrapper around create_var_decl_1 allowing CONST_DECL creation. (create_true_var_decl): New function, similar to create_var_decl but forcing the creation of a VAR_DECL node (CONST_DECL not allowed). (create_field_decl): Do not always mark the field as addressable if its type is an aggregate. (global_renaming_pointers): New static variable. (add_global_renaming_pointer): New function. (get_global_renaming_pointers): Likewise. * misc.c (gnat_dwarf_name): New function. (LANG_HOOKS_DWARF_NAME): Define to gnat_dwarf_name. (gnat_post_options): Add comment about structural alias analysis. (gnat_parse_file): Do not call cgraph_optimize here. (LANG_HOOKS_WRITE_GLOBALS): Define to gnat_write_global_declarations. * trans.c (process_freeze_entity): Don't abort if we already have a non dummy GCC tree for a Concurrent_Record_Type, as it might legitimately have been elaborated while processing the associated Concurrent_Type prior to this explicit freeze node. (Identifier_to_gnu): Do not make a variable referenced in a SJLJ exception handler volatile if it is of variable size. (process_type): Remove bypass for types coming from a limited_with clause. (call_to_gnu): When processing the copy-out of a N_Type_Conversion GNAT actual, convert the corresponding gnu_actual to the real destination type when necessary. (add_decl_expr): Set the DECL_READONLY_ONCE_ELAB flag on variables originally TREE_READONLY but whose elaboration cannot be performed statically. Part of fix for F504-021. (tree_transform, subprogram cases): Change loops on formal parameters to call new Einfo function First_Formal_With_Extras. (gnat_to_gnu) <N_Op_Shift_Right_Arithmetic>: Ignore constant overflow stemming from type conversion for the lhs. (Attribute_to_gnu) <Attr_Alignment>: Also divide the alignment by the number of bits per unit for components of records. (gnat_to_gnu) <N_Code_Statement>: Mark operands addressable if needed. (Handled_Sequence_Of_Statements_to_gnu): Register the cleanup associated with At_End_Proc after the SJLJ EH cleanup. (Compilation_Unit_to_gnu): Call elaborate_all_entities only on the main compilation unit. (elaborate_all_entities): Do not retest type_annotate_only. (tree_transform) <N_Abstract_Subprogram_Declaration>: Process the result type of an abstract subprogram, which may be an itype associated with an anonymous access result (related to AI-318-02). (build_global_cdtor): Move to utils.c. (Case_Statement_to_gnu): Avoid adding the choice of a when statement if this choice is not a null tree nor an integer constant. (gigi): Run unshare_save_expr via walk_tree_without_duplicates on the body of elaboration routines instead of mark_unvisited. (add_stmt): Do not mark the tree. (add_decl_expr): Tweak comment. (mark_unvisited): Delete. (unshare_save_expr): New static function. (call_to_gnu): Issue an error when making a temporary around a procedure call because of non-addressable actual parameter if the type of the formal is by_reference. (Compilation_Unit_to_gnu): Invalidate the global renaming pointers after building the elaboration routine. From-SVN: r118331
2006-10-23decl.c: Include langhooks.h.Rafael Ávila de Espíndola1-27/+1
* gcc/java/decl.c: Include langhooks.h. (builtin_function): Remove. (java_init_decl_processing): Replace calls to builtin_function with add_builtin_function. * gcc/java/Make-lang.in (jc1$(exeext)): Depend on and link with attribs.o. (java/decl.o): Depend on langhooks.h. * gcc/java/java-tree.h (builtin_function): Remove. * gcc/tree.c (local_define_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/objc/objc-act.c (synth_module_prologue): Replace calls to builtin_function with add_builtin_function. (build_next_objc_exception_stuff): Replace calls to builtin_function with add_builtin_function. (build_objc_exception_stuff): Replace calls to builtin_function with add_builtin_function. * gcc/objcp/objcp-decl.h (objcp_builtin_function): Remove. * gcc/cp/decl.c (builtin_function_1): Move common code to add_builtin_function. (builtin_function): Rename to cxx_builtin_function. Change the signature. * gcc/cp/call.c: Include langhooks.h. (build_java_interface_fn_ref): Replace calls to builtin_function with add_builtin_function. * gcc/cp/Make-lang.in (cp/call.o): Depend on langhooks.h. * gcc/cp/cp-objcp-common.h (LANG_HOOKS_BUILTIN_FUNCTION): Define as cxx_builtin_function. * gcc/cp/cp-tree.h (builtin_function): Rename to cxx_builtin_function. Change the signature. * gcc/c-objc-common.h (LANG_HOOKS_BUILTIN_FUNCTION): Define as c_builtin_function. * gcc/c-tree.h (builtin_function): Rename to c_builtin_function. Change the signature. * gcc/ada/utils.c (builtin_function): Rename to gnat_builtin_function. Move common code to add_builtin_function. * gcc/ada/misc.c (LANG_HOOKS_BUILTIN_FUNCTION): Define as gnat_builtin_function. * gcc/ada/gigi.h (builtin_function): Rename to gnat_builtin_function. Change the signature. * gcc/c-decl.c (builtin_function): Rename to c_builtin_function. Move common code to add_builtin_function. * gcc/fortran/Make-lang.in (f951$(exeext)): Depend on and link with attribs.o. * gcc/fortran/trans.h (builtin_function): Rename to gfc_builtin_function. Change the signature. * gcc/fortran/f95-lang.c (LANG_HOOKS_BUILTIN_FUNCTION): Define as gfc_builtin_function. (builtin_function): Rename to gfc_builtin_function. Move common code to builtin_function. (gfc_define_builtin): Replace calls to builtin_function with gfc_define_builtin. * gcc/langhooks.c (add_builtin_function): New function. (lhd_builtin_function): New function. * gcc/langhooks.h (struct lang_hooks): Change the signature of builtin_function. (add_builtin_function): New function. * gcc/treelang/treetree.c (builtin_function): Remove. * gcc/tree-ssa-loop-prefetch.c (tree_ssa_prefetch_arrays): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/c-common.c (decl_builtin_1): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/alpha/alpha.c (alpha_init_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/frv/frv.c (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/s390/s390.c (s390_init_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/sparc/sparc.c (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/i386/i386.c (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/sh/sh.c (sh_media_init_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/c4x/c4x.c (c4x_init_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/stormy16/stormy16.c (xstormy16_init_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/iq2000/iq2000.c (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/ia64/ia64.c (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/rs6000/rs6000.c (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. (altivec_init_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/arm/arm.c (def_mbuiltin): Replace calls to lang_hooks.builtin_function with add_builtin_function. (arm_init_tls_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/mips/mips.c (mips_init_builtins): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/config/bfin/bfin.c (def_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * gcc/langhooks-def.h (lhd_builtin_function): New function. (LANG_HOOKS_BUILTIN_FUNCTION): Define as lhd_builtin_function. From-SVN: r117981
2006-10-03* utils.c: Fix a typo.Kazu Hirata1-1/+1
From-SVN: r117407
2006-10-03* decl.c, utils.c: Fix comment typos.Kazu Hirata1-1/+1
From-SVN: r117405
2006-09-29decl.c (gnat_to_gnu_entity): Do not set "const" flag on "pure" Ada ↵Eric Botcazou1-0/+4
subprograms if SJLJ exceptions are used. * decl.c (gnat_to_gnu_entity) <E_Procedure>: Do not set "const" flag on "pure" Ada subprograms if SJLJ exceptions are used. * trans.c (Handled_Sequence_Of_Statements_to_gnu): Set TREE_NO_WARNING on the declaration node of JMPBUF_SAVE. * utils.c (init_gigi_decls): Set DECL_IS_PURE on the declaration nodes of Get_Jmpbuf_Address_Soft and Get_GNAT_Exception. * utils2.c (build_call_0_expr): Do not set TREE_SIDE_EFFECTS. From-SVN: r117299
2006-09-15re PR ada/18817 (ACATS c380004 fails at run time)Roger Sayle1-0/+16
PR ada/18817 * utils.c (max_size): Perform constant folding of (A ? B : C) - D into A ? B - D : C - D when calculating the size of a MINUS_EXPR. From-SVN: r116964
2006-09-13re PR ada/21952 (Annoying "attribute directive ignored" warnings)Eric Botcazou1-1/+53
PR ada/21952 * gigi.h (gnat_internal_attribute_table): Declare. * misc.c (LANG_HOOKS_ATTRIBUTE_TABLE): Define to above. * utils.c (gnat_internal_attribute_table): New global variable. (builtin_function): Always call decl_attributes on the builtin. (handle_const_attribute): New static function. (handle_nothrow_attribute): Likewise. From-SVN: r116926
2006-05-28decl.c, [...]: Fix comment typos.Kazu Hirata1-3/+3
* decl.c, env.c, gigi.h, init.c, initialize.c, raise-gcc.c, sem_ch13.adb, sysdep.c, targtyps.c, tb-alvxw.c, tracebak.c, trans.c, utils.c: Fix comment typos. Follow spelling conventions. * gnat_rm.texi, gnat_ugn.texi, : Fix typos. Follow spelling conventions. From-SVN: r114171
2006-03-02tm.texi (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Document.Richard Sandiford1-4/+4
* doc/tm.texi (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Document. (ASM_OUTPUT_BSS): Describe the two ways of handling global BSS, and say that only one is needed. * doc/rtl.texi (SYMBOL_REF_BLOCK): Say that the block can be null. * target.h (have_switchable_bss_sections): New hook. * explow.c (use_anchored_address): Check that the symbol is in a block. * varasm.c (tls_comm_section, comm_section, lcomm_section) (bss_noswitch_section): New variables. (get_unnamed_section): Add SECTION_UNNAMED to the flags. (get_noswitch_section): New function. (get_block_for_section): Allow SECT to be null. (unlikely_text_section_p): Use SECTION_STYLE. (bss_initializer_p): New function. (get_variable_section): Move earlier in file. Take a new argument, prefer_noswitch_p. Move bss checks from assemble_variable to here. Return one of the new *_sections in such cases. (get_block_for_decl): New function, extracting some logic from use_blocks_for_decl_p. (change_symbol_section): Remove in favor of... (change_symbol_block): ...this new function. (use_blocks_for_decl_p): Remove checks now performed by get_block_for_decl. (make_decl_rtl): Use change_symbol_block and get_block_for_decl. (ASM_EMIT_LOCAL, ASM_EMIT_BSS, ASM_EMIT_COMMON): Delete in favor of... (emit_local, emit_bss, emit_common): ...these new functions. Return true if the alignment was honored. (emit_tls_common): New function. (asm_emit_uninitialised): Delete. (assemble_variable_noswitch): New function, split out from... (assemble_variable): ...here. Don't make decisions about common variables here. Globalize all public decls that go into non-common sections. Check whether SYMBOL_REF_BLOCK is null. (output_constant_def_contents): Check whether SYMBOL_REF_BLOCK is null. (output_constant_pool): Likewise. (init_varasm_once): Initialize the new section variables. (have_global_bss_p): New function. (categorize_decl_for_section): Use bss_initializer_p. (switch_to_section): Use SECTION_STYLE. Abort for SECTION_NOSWITCH. (place_block_symbol): Assert that the symbol must be in a block. * target-def.h (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): New macro. (TARGET_INITIALIZER): Include it. * rtl.h (SYMBOL_REF_BLOCK): Document the null alternative. * output.h (SECTION_STYLE_MASK, SECTION_COMMON): New macros. (SECTION_MACH_DEP): Bump by two. (SECTION_UNNAMED, SECTION_NOSWITCH): New macros. (unnamed_section): Mention SECTION_UNNAMED in comment. (named_section): Likewise SECTION_NAMED. (noswitch_section_callback): New type. (noswitch_section): New structure. (section): Add a noswitch_section alternative. (SECTION_STYLE): New macro. (tls_comm_section, comm_section, lcomm_section): Declare. (bss_noswitch_section, have_global_bss_p): Declare. * config/elfos.h (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/iq2000/iq2000.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/v850/v850.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/stormy16/stormy16.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. cp/ * decl.c (start_decl): Use have_global_bss_p when deciding whether to make the decl common. ada/ * utils.c (create_var_decl): Use have_global_bss_p when deciding whether to make the decl common. From-SVN: r111644
2006-02-15re PR ada/26096 (Ada bootstrap fails in g-alleve.adb)Richard Kenner1-37/+22
2006-02-13 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Olivier Hainque <hainque@adacore.com> Eric Botcazou <ebotcazou@adacore.com> * ada-tree.h: (TYPE_UNCHECKED_UNION_P): Deleted. * gigi.h (value_factor_p): Add prototype and description, now public. * decl.c (gnat_to_gnu_field): Don't attempt BLKmode to integral type promotion for field with rep clause if the associated size was proven to be in error. Expand comments describing attempts to use a packable type. (gnat_to_gnu_entity) <E_Signed_Integer_Subtype, E_Floating_Point_Subtype>: Inherit alias set of what we are making a subtype of to ensure conflicts amongst all subtypes in a hierarchy, necessary since these are not different types and pointers may actually designate any subtype in this hierarchy. (gnat_to_gnu_entity, case E_Record_Type): Always make fields for discriminants but put them into record only if not Unchecked_Union; pass flag to components_to_record showing Unchecked_Union. (make_dummy_type): Use UNION_TYPE only if Unchecked_Union and no components before variants; don't set TYPE_UNCHECKED_UNION_P. (components_to_record): New argument UNCHECKED_UNION. Remove special case code for Unchecked_Union and instead use main code with small changes. PR ada/26096 (gnat_to_gnu_entity) <E_Variable>: Do not initialize the aligning variable with the expression being built, only its inner field. * trans.c (Handled_Sequence_Of_Statements_to_gnu): Remove call to emit_sequence_entry_statements. (emit_sequence_entry_statements, body_with_handlers_p): Delete. (establish_gnat_vms_condition_handler): Move before Subprogram_Body_to_gnu. (Subprogram_Body_to_gnu): On VMS, establish_gnat_vms_condition_handler for a subprogram if it has a foreign convention or is exported. (Identifier_to_gnu): Manually unshare the DECL_INITIAL tree when it is substituted for a CONST_DECL. (tree_transform, case N_Aggregate): Remove code for UNION_TYPE and pass Etype to assoc_to_constructor. (assoc_to_constructor): New argument, GNAT_ENTITY; use it to ignore discriminants of Unchecked_Union. (TARGET_ABI_OPEN_VMS): Define to 0 if not defined, so that later uses don't need cluttering preprocessor directives. (establish_gnat_vms_condition_handler): New function. Establish the GNAT condition handler as current in the compiled function. (body_with_handlers_p): New function. Tell whether a given sequence of statements node is attached to a package or subprogram body and involves exception handlers possibly nested within inner block statements. (emit_sequence_entry_statements): New function, to emit special statements on entry of sequences when necessary. Establish GNAT condition handler in the proper cases for VMS. (Handled_Sequence_Of_Statements_to_gnu): Start block code with emit_sequence_entry_statements. * utils2.c (find_common_type): If both input types are BLKmode and have a constant size, use the smaller one. (build_simple_component_ref): Also match if FIELD and NEW_FIELD are the same. * utils.c (value_factor_p): Make public, to allow uses from other gigi units. (create_type_decl): Do not set the flag DECL_IGNORED_P for dummy types. (convert, case UNION_TYPE): Remove special treatment for unchecked unions. PR ada/18659 (update_pointer_to): Update variants of pointer types to unconstrained arrays by attaching the list of fields of the main variant. From-SVN: r111030
2005-12-09[multiple changes]Arnaud Charlet1-3/+4
2005-12-05 Robert Dewar <dewar@adacore.com> * i-c.adb, i-cexten.ads, i-cobol.adb, i-cobol.ads, i-cpoint.ads, i-cpp.adb, i-cpp.ads, i-cstrea.ads, i-cstrin.adb, i-cstrin.ads, inline.adb, interfac.ads, i-os2err.ads, i-os2lib.ads, i-os2syn.ads, i-os2thr.ads, itypes.adb, itypes.adb, itypes.ads, krunch.ads, krunch.adb, lib.adb, lib.ads, lib-list.adb, lib-load.adb, lib-load.ads, lib-sort.adb, live.adb, make.ads, i-cstrea-vms.adb, interfac-vms.ads, makegpr.adb, indepsw-gnu.adb, indepsw.ads, s-wchcon.ads, sdefault.ads, sem_ch10.adb, sem_eval.ads: Minor reformatting. 2005-12-05 Robert Dewar <dewar@adacore.com> * s-vaflop-vms-alpha.adb: (Ne_F): New function (Ne_G): New function * exp_ch4.adb (Expand_Allocator_Expression): Factor duplicated code for tag assignment. (Rewrite_Comparison): Handle case where operation is not a comparison and ignore, and also handle type conversion case. 2005-12-05 Thomas Quinot <quinot@adacore.com> * exp_aggr.ads: Fix typo in comment. ???-mark Convert_Aggr_In_Assignment as needing documentation. 2005-12-05 Gary Dismukes <dismukes@adacore.com> * layout.adb: Replace various uses of byte by storage unit throughout. (Get_Max_SU_Size): Name changed from Get_Max_Size. In the case of a static size, convert to storage units before returning, to conform to spec. 2005-12-05 Matthew Gingell <gingell@adacore.com> * g-exctra.ads: Fix typo in comment. 2005-12-05 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * utils.c: Minor reformatting. 2005-12-05 Robert Dewar <dewar@adacore.com> * g-soccon.ads: Further comment fixes to make the status of the default file clear * s-bitops.adb: Clarify comment for Bits_Array From-SVN: r108308
2005-12-05utils.c (convert): Use fold_convert where appropriate.Richard Guenther1-9/+8
2005-12-05 Richard Guenther <rguenther@suse.de> * utils.c (convert): Use fold_convert where appropriate. From-SVN: r108061
2005-12-02tree.h (TREE_OVERFLOW): Make this flag/predicate specific to constant nodes, ↵Roger Sayle1-3/+10
i.e. * tree.h (TREE_OVERFLOW): Make this flag/predicate specific to constant nodes, i.e. INTEGER_CST, REAL_CST, etc... * tree-vrp.c (compare_values): Only check TREE_OVERFLOW for integer constant comparisons. ada/ * utils.c (max_size): Only test for TREE_OVERFLOW on INTEGER_CST nodes. From-SVN: r107870
2005-11-15decl.c: Factor common code to build a storage type for an unconstrained ↵Thomas Quinot1-19/+81
object from a... 2005-11-14 Thomas Quinot <quinot@adacore.com> Olivier Hainque <hainque@adacore.com> Eric Botcazou <ebotcazou@adacore.com> * decl.c: Factor common code to build a storage type for an unconstrained object from a fat or thin pointer type and a constrained object type. (annotate_value): Handle BIT_AND_EXPR. (annotate_rep): Don't restrict the back annotation of inherited components to the type_annotate_only case. (gnat_to_gnu_entity) <E_Array_Type>: Do not invoke create_type_decl if we are not defining the type. <E_Record_Type>: Likewise. (gnat_to_gnu_entity) <object, renaming>: Adjust comments and structure to get advantage of the new maybe_stabilize_reference interface, to ensure that what we reference is indeed stabilized instead of relying on assumptions on what the stabilizer does. (gnat_to_gnu_entity) <E_Incomplete_Type>: If the entity is an incomplete type imported through a limited_with clause, use its non-limited view. (Has_Stdcall_Convention): New macro, to centralize the Windows vs others differentiation. (gnat_to_gnu_entity): Use Has_Stdcall_Convention instead of a spread mix of #if sections + explicit comparisons of convention identifiers. (gnat_to_gnu_entity) <E_Variable>: Decrement force_global if necessary before early-returning for certain types when code generation is disabled. (gnat_to_gnu_entity) <object>: Adjust comment attached to the nullification of gnu_expr we do for objects with address clause and that we are not defining. (elaborate_expression_1): Do not create constants when creating variables needed by the debug info: the dwarf2 writer considers that CONST_DECLs is used only to represent enumeration constants, and emits nothing for them. (gnat_to_gnu_entity) <object>: When turning a non-definition of an object with an address clause into an indirect reference, drop the initializing expression. Include "expr.h". (STACK_CHECK_BUILTIN): Delete. (STACK_CHECK_PROBE_INTERVAL): Likewise. (STACK_CHECK_MAX_FRAME_SIZE): Likewise. (STACK_CHECK_MAX_VAR_SIZE): Likewise. (gnat_to_gnu_entity): If gnat_entity is a renaming, do not mark the tree corresponding to the renamed object as ignored for debugging purposes. * trans.c (tree_transform, case N_Attribute_Reference, case Attr_Size & related): For a prefix that is a dereference of a fat or thin pointer, if there is an actual subtype provided by the front-end, use that subtype to build an actual type with bounds template. (tree_transform, case N_Free_Statement): If an Actual_Designated_Subtype is provided by the front-end, use that subtype to compute the size of the deallocated object. (gnat_to_gnu): When adding a statement into an elaboration procedure, check for a potential violation of a No_Elaboration_Code restriction. (maybe_stabilize_reference): New function, like gnat_stabilize_reference with extra arguments to control whether to recurse through non-values and to let the caller know if the stabilization has succeeded. (gnat_stabilize_reference): Now a simple wrapper around maybe_stabilize, for common uses without restriction on lvalues and without need to check for the success indication. (gnat_to_gnu, call_to_gnu): Adjust calls to gnat_stabilize_reference, to pass false instead of 0 as the FORCE argument which is a bool. (Identifier_to_gnu): Remove checks ensuring that an renamed object attached to a renaming pointer has been properly stabilized, as no such object is attached otherwise. (call_to_gnu): Invoke create_var_decl to create the temporary when the function uses the "target pointer" return mechanism. Reinstate conversion of the actual to the type of the formal parameter before any other specific treatment based on the passing mechanism. This turns out to be necessary in order for PLACEHOLDER substitution to work properly when the latter type is unconstrained. * gigi.h (build_unc_object_type_from_ptr): New subprogram, factoring a common pattern. (maybe_stabilize_reference): New function, like gnat_stabilize_reference with extra arguments to control whether to recurse through non-values and to let the caller know if the stabilization has succeeded. * utils2.c (gnat_build_constructor): Only sort the fields for possible static output of record constructor if all the components are constant. (gnat_build_constructor): For a record type, sort the list of field initializers in increasing bit position order. Factor common code to build a storage type for an unconstrained object from a fat or thin pointer type and a constrained object type. (build_unary_op) <ADDR_EXPR>: Always recurse down conversions between types variants, and process special cases of VIEW_CONVERT expressions as their NOP_EXPR counterpart to ensure we get to the CORRESPONDING_VARs associated with CONST_DECls. (build_binary_op) <MODIFY_EXPR>: Do not strip VIEW_CONVERT_EXPRs on the right-hand side. * utils.c (build_unc_object_type_from_ptr): New subprogram, factoring a common pattern. (convert) <VIEW_CONVERT_EXPR>: Return the inner operand directly if we are converting back to its original type. (convert) <JM input>: Fallthrough regular conversion code instead of extracting the object if converting to a type variant. (create_var_decl): When a variable has an initializer requiring code generation and we are at the top level, check for a potential violation of a No_Elaboration_Code restriction. (create_var_decl): call expand_decl for CONST_DECLs, to set MODE, ALIGN SIZE and SIZE_UNIT which we need for later back-annotations. * utils.c: (convert) <STRING_CST>: Remove obsolete code. <VIEW_CONVERT_EXPR>: Do not lift the conversion if the target type is an unchecked union. (pushdecl): Set DECL_NO_STATIC_CHAIN on imported nested functions. (convert) <VIEW_CONVERT_EXPR>: When the types have the same main variant, just replace the VIEW_CONVERT_EXPR. <UNION_TYPE>: Revert 2005-03-02 change. * repinfo.h, repinfo.ads: Add tcode for BIT_AND_EXPR. * repinfo.adb (Print_Expr, Rep_Value): Handle Bit_And_Expressions. From-SVN: r106961
2005-08-01* decl.c, utils.c: Fix comment typos.Kazu Hirata1-2/+2
From-SVN: r102630
2005-07-20Make CONSTRUCTOR use VEC to store initializers.Giovanni Bajo1-4/+7
* c-common.c (complete_array_type): Update to cope with VEC in CONSTRUCTOR_ELTS. * c-pretty-print.c (pp_c_initializer_list): Use pp_c_constructor_elts. (pp_c_constructor_elts): New function. * c-pretty-print.h (pp_c_constructor_elts): Declare. * c-typeck.c (build_function_call, build_c_cast, digest_init, struct constructor_stack, struct initializer_stack, constructor_elements, push_init_level, pop_init_level, add_pending_init, find_init_member, output_init_element): Update to cope with VEC in CONSTRUCTOR_ELTS. * coverage.c (build_fn_info_value, build_ctr_info_value, build_gcov_info): Likewise. * expr.c (categorize_ctor_elements_1, store_constructor, expand_expr_real_1): Likewise. * fold-const.c (fold_ternary): Likewise. * gimplify.c (gimplify_init_ctor_preeval, zero_sized_field_decl, gimplify_init_constructor, gimplify_expr): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-inline.c (copy_tree_r): Add code to duplicate a CONSTRUCTOR node. * tree-pretty-print.c (dump_generic_node): Update to cope with VEC in CONSTRUCTOR_ELTS. * tree-sra.c (generate_element_init_1): Likewise. * tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-vect-generic.c (expand_vector_piecewise): Likewise. * tree-vect-transform.c (vect_get_vec_def_for_operand): (get_initial_def_for_reduction): Likewise. * tree-vn.c (set_value_handle, get_value_handle): CONSTURCTOR uses value handle in annotations. * tree.c (tree_node_kind, tree_code_size, make_node_stat, tree_node_structure): Add support for constr_kind. (build_vector_from_ctor, build_constructor_single, build_constructor_from_list): New functions. (build_constructor): Update to take a VEC instead of a TREE_LIST. (simple_cst_equal, iterative_hash_expr, initializer_zerop, walk_tree): Update to cope with VEC in CONSTRUCTOR_ELTS. * tree.def (CONSTRUCTOR): Make it a tcc_exceptional node. * tree.h (FOR_EACH_CONSTRUCTOR_VALUE, FOR_EACH_CONSTRUCTOR_ELT, CONSTRUCTOR_APPEND_ELT): New macros. (struct constructor_elt, struct tree_constructor): New data types. (union tree_node): Add tree_constructor field. * treestruct.def: Define TS_CONSTRUCTOR. * varasm.c (const_hash_1, compare_constant, copy_constant, compute_reloc_for_constant, output_addressed_constants, initializer_constant_valid_p, output_constant, array_size_for_constructor, output_constructor): Update to cope with VEC in CONSTRUCTOR_ELTS. * vec.h (VEC_empty, VEC_copy): New macros. ada/ Make CONSTRUCTOR use VEC to store initializers. * decl.c (gnat_to_gnu_entity): Update to cope with VEC in CONSTRUCTOR_ELTS. * trans.c (extract_values): Likewise. * utils.c (convert, remove_conversions): Likewise. * utils2.c (contains_save_expr_p, build_binary_op, build_unary_op, gnat_build_constructor): Likewise. cp/ Make CONSTRUCTOR use VEC to store initializers. * call.c (convert_default_arg): Update call to digest_init. * class.c (dump_class_hierarchy, dump_array): Update to cope with VEC in CONSTRUCTOR_ELTS. * cp-tree.h (EMPTY_CONSTRUCTOR_P): Likewise. (finish_compound_literal, digest_init): Update declaration. * decl.c (struct reshape_iter): New data type. (reshape_init_array): Rename to... (reshape_init_array_1): Update to cope with VEC in CONSTRUCTOR_ELTS. (reshape_init): Rewrite from scratch. Split parts into... (reshape_init_array, reshape_init_vector, reshape_init_class, reshape_init_r): New functions. (check_initializer): Update call to reshape_init. Remove obsolete code. (initialize_artificial_var, cp_complete_array_type): Update to cope with VEC in CONSTRUCTOR_ELTS. * decl2.c (grokfield): Update calls to digest_init. (mark_vtable_entries): Update to cope with VEC in CONSTRUCTOR_ELTS. * error.c (dump_expr_init_vec): New function. (dump_expr): Use dump_expr_init_vec. * init.c (build_zero_init, build_vec_init): Update to cope with VEC in CONSTRUCTOR_ELTS. (expand_default_init): Update call to digest_init. * parser.c (cp_parser_postfix_expression): Use a VEC for the initializers. (cp_parser_initializer_list): Build a VEC of initializers. * pt.c (tsubst_copy, tsubst_copy_and_build): Update to cope with VEC in CONSTRUCTOR_ELTS. * rtti.c (tinfo_base_init, generic_initializer, ptr_initializer, ptm_initializer, class_initializer, get_pseudo_ti_init): Use build_constructor_from_list instead of build_constructor. * semantics.c (finish_compound_literal): Update call to digest_init. * tree.c (stabilize_init): Update to cope with VEC in CONSTRUCTOR_ELTS. * typeck.c (build_ptrmemfunc1): Likewise. * typeck2.c: (cxx_incomplete_type_error, split_nonconstant_init_1): Likewise. (store_init_value): Use build_constructor_from_list and update call to digest_init. (digest_init): Rewrite. (process_init_constructor): Rewrite from scratch. Split into... (process_init_constructor_array, picflag_from_initializer, process_init_constructor_record, process_init_constructor_union): New functions. (PICFLAG_ERRONEOUS, PICFLAG_NOT_ALL_CONSTANT, PICFLAG_NOT_ALL_SIMPLE): New macros. (build_functional_cast): Use build_constructor_from_list instead of build_constructor. fortran/ Make CONSTRUCTOR use VEC to store initializers. * trans-array.c (gfc_build_null_descriptor, gfc_trans_array_constructor_value, gfc_conv_array_initializer): Update to cope with VEC in CONSTRUCTOR_ELTS. * trans-common.c (create_common): Likewise. * trans-expr.c (gfc_conv_structure): Likewise. * trans-stmt.c (gfc_trans_character_select): Use build_constructor_from_list instead of build_constructor. java/ Make CONSTRUCTOR use VEC to store initializers. * check-init.c (check_init): Update to cope with VEC in CONSTRUCTOR_ELTS. * class.c (make_field_value, make_method_value, get_dispatch_table, make_class_data, emit_symbol_table, emit_catch_table, emit_assertion_table): Use build_constructor_from_list instead of build_constructor. * constants.c (build_constants_constructor): Likewise. * java-gimplify.c (java_gimplify_new_array_init): Update to cope with VEC in CONSTRUCTOR_ELTS. * java-tree.h (START_RECORD_CONSTRUCTOR, PUSH_SUPER_VALUE, PUSH_FIELD_VALUE, FINISH_RECORD_CONSTRUCTOR): Create a VEC instead of a TREE_LIST. * jcf-write.c (generate_bytecode_insns): Update to cope with VEC in CONSTRUCTOR_ELTS. * parse.y (build_new_array_init): Use build_constructor_from_list instead of build_constructor. (patch_new_array_init): Update to cope with VEC in CONSTRUCTOR_ELTS. (array_constructor_check_entry): Likewise. objc/ Make CONSTRUCTOR use VEC to store initializers. * objc-act.c (objc_build_constructor): Use build_constructor_from_list instead of build_constructor. testsuite/ Make CONSTRUCTOR use VEC to store initializers. * g++.dg/ext/complit3.C: Check for specific error messages. * g++.dg/init/brace2.C: Update error message. * g++.dg/warn/Wbraces2.C: Likewise. From-SVN: r102182
2005-07-09utils.c (create_var_decl): Only set DECL_COMMON on VAR_DECLs.Andrew Pinski1-2/+3
2005-07-09 Andrew Pinski <pinskia@physics.uc.edu> * utils.c (create_var_decl): Only set DECL_COMMON on VAR_DECLs. Only set SET_DECL_ASSEMBLER_NAME on VAR_OR_FUNCTION_DECL_P. From-SVN: r101831
2005-07-08Makefile.in (TREE_H): Add treestruct.def.Daniel Berlin1-1/+0
2005-07-08 Daniel Berlin <dberlin@dberlin.org> * Makefile.in (TREE_H): Add treestruct.def. (c-decl.o): Add pointer-set.h * c-decl.c (diagnose_mismatched_decls): Don't attempt to look at visibility on regular DECL's. (merge_decls): Fix the copying of decl nodes of various types for the new structures. Don't update RTL, section name, weak status, etc, on DECL's without RTL. (grokdeclarator): DECL_ARG_TYPE_AS_WRITTEN is gone. Don't check volatile on non-variable types. (store_parm_decls_oldstyle): Use pointer_set instead of DECL_WEAK to check whether we have seen arguments. * c-objc-common.c (c_tree_printer): Reverse order of tests so that flag is checked before field (flag is common, field is not). * dwarf2out.c (decl_ultimate_origin): Only DECL's with TS_DECL_COMMON could have an origin. (add_location_or_const_value_attribute): Don't check section name on non-var/function decls. (dwarf2out_var_location): Reverse order of tests. * emit-rtl.c (set_reg_attrs_for_parm): DECL_CHECK is dead, replace with DECL_WRTL_CHECK. * expmed.c (make_tree): rtl is now in decl_with_rtl. * fold-const.c (fold_binary): Don't check weakness on non-var/function decls. (tree_expr_nonzero_p): Ditto. (fold_checksum_tree): Use tree_decl_extra as sizeof buffer. * ggc-page.c (extra_order_size_table): Add sizes for tree_decl_non_common, tree_parm_decl, tree_var_decl, and tree_field_decl. * gimplify.c (gimplify_bind_expr): Only set DECL_SEEN_IN_BIND_EXPR_P on VAR_DECL. * integrate.c (copy_decl_for_inlining): Don't set RTL on decl's without RTL. * langhooks-def.h (LANG_HOOK_INIT_TS): New. * langhooks.h (init_ts). New langhook. * passes.c (rest_of_decl_compilation): Reverse order of tests. * print-tree.c (print_node): Update to only print fields that exist in the structures the passed decl has. * toplev.c (wrapup_global_declarations): Don't reset DECL_DEFER_OUTPUT on DECL's that don't contain it. * tree-browser.c (browse_tree): DECL_ARG_TYPE_AS_WRITTEN removed. * tree-inline.c (remap_decl): Ditto. * tree-outof-ssa.c (create_temp): Reverse order of tests. * tree-pretty-print.c (print_declaration): Don't print DECL_REGISTER on things that don't contain it. * tree-vrp.c (expr_computes_nonzero): Don't check weakness on non-var/function decls. * tree.c (tree_contains_struct): New structure. (init_priority_for_decl): New hashtable. (tree_int_map): New structure. (tree_int_map_eq): New function. (tree_int_map_marked_p): Ditto. (tree_int_map_hash): Ditto. (tree_map): Move to tree.h. (tree_map_eq): Externalize. (tree_map_hash): Ditto. (tree_map_marked_p): Ditto. (init_ttree): Set up tree_contains_struct and call langhook. (decl_assembler_name): Use DECL_NON_COMMON_CHECK.. (tree_code_size): Update for new structures. (tree_node_structure): Update for new structures. (make_node_stat): Don't try to set DECL_IN_SYSTEM_HEADER on decls without the field. (copy_node_stat): Copy init priority. (build_decl_stat): Ditto for visibility. (ts_enum_names): New. (tree_contains_struct_check_failed): New function. (decl_init_priority_lookup): Ditto. (decl_init_priority_insert): Ditto. * treestruct.def: New file. * tree.h (CODE_CONTAINS_STRUCT): New macro. (CONTAINS_STRUCT_CHECK): Ditto. (tree_contains_struct_check_failed): New prototype. (DECL_CHECK): Removed. (DECL_MINIMAL_CHECK): New. (DECL_COMMON_CHECK): Ditto. (DECL_WRTL_CHECK): Ditto. (DECL_NON_COMMON_CHECK): Ditto. (DECL_WITH_VIS_CHECK): Ditto. (VAR_OR_FUNCTION_DECL_P): Ditto (struct tree_decl_minimal): New structure. (struct tree_decl_common): Ditto. (struct tree_decl_with_rtl): Ditto. (struct tree_decl_with_vis): Ditto. (struct tree_decl_non_common): Ditto. (struct tree_field_decl): Ditto. (struct tree_parm_decl): Ditto. (struct tree_var_decl): Ditto. (struct tree_function_decl): Ditto. (struct tree_const_decl): Ditto. (struct tree_result_decl): Ditto. (union tree_node): Add new structures. * var-tracking.c (track_expr_p): Reverse order of tests. * doc/c-tree.texi: Add documentation on DECL node internal structure. 2005-07-08 Daniel Berlin <dberlin@dberlin.org> * utils.c (create_param_decl): DECL_ARG_TYPE_AS_WRITTEN is removed. 2005-07-08 Daniel Berlin <dberlin@dberlin.org> * Make-lang.in: Add gt-cp-lang.h. (cp-lang.o): Ditto. * class.c (create_vtable_ptr): Stop setting DECL_ASSEMBLER_NAME on the field. * config-lang.in: Add cp-lang.c to gtfiles. * cp-lang.c: Include hashtab.h. (cp_init_ts): New function. (LANG_HOOK_INIT_TS): Use macro. (decl_shadowed_for_var_lookup): New function. (decl_shadowed_for_var_insert): Ditto. * cp-tree.h (THUNK_FUNCTION_CHECK): Use decl_common. (NON_THUNK_FUNCTION_CHECK): Ditto. (DECL_NAMESPACE_ASSOCIATIONS): Use decl_non_common. (DECL_INIT_PRIORITY): Ditto. (DECL_HAS_SHADOWED_FOR_VAR_P): Ditto. (DECL_SHADOWED_FOR_VAR): Use hashtable. (SET_DECL_SHADOWED_FOR_VAR): Ditto. * decl.c (duplicate_decls): Update for new/updated structures. (poplevel): Use SET_DECL_SHADOWED_FOR_VAR. * decl2.c (start_static_initialization_or_destruction): Deal with priority. * pt.c (tsubst_decl): Check TS_DECL_WRTL before doing SET_DECL_RTL. * tree.c (handle_init_priority_attribute): Handle priority. 2005-07-08 Daniel Berlin <dberlin@dberlin.org> * objc-act.c (objc_push_parm): DECL_ARG_TYPE_AS_WRITTEN is removed. * objc-act.h (KEYWORD_ARG_NAME): Use decl_non_common. (KEYWORD_KEY_NAME): Use decl_minimal. (METHOD_SEL_NAME): Ditto.. (METHOD_SEL_ARGS): Use decl_non_common. (METHOD_ADD_ARGS): Ditto. (METHOD_ADD_ARGS_ELLIPSIS_P): Use decl_common. (METHOD_DEFINITION): Ditto. (METHOD_ENCODING): Ditto. * objc-lang.c: (objc_init_ts): New function. 2005-07-08 Daniel Berlin <dberlin@dberlin.org> * trans-decl.c (create_function_arglist): DECL_ARG_TYPE_AS_WRITTEN is removed. From-SVN: r101799
2005-07-04decl.c (prepend_attributes): New case.Eric Botcazou1-2/+28
2005-07-04 Eric Botcazou <ebotcazou@adacore.com> * decl.c (prepend_attributes) <Pragma_Linker_Constructor>: New case. <Pragma_Linker_Destructor>: Likewise. * einfo.ads (Has_Gigi_Rep_Item): Document Pragma_Linker_Constructor and Pragma_Linker_Destructor. * gigi.h (attr_type): Add ATTR_LINK_CONSTRUCTOR and ATTR_LINK_DESTRUCTOR. (static_ctors, static_dtors): New variables. * misc.c (gnat_expand_body): Output current function as constructor and destructor if requested. * par-prag.adb: Add processing for pragma Linker_Constructor and Linker_Destructor. * sem_prag.adb (Find_Unique_Parameterless_Procedure): New function extracted from Check_Interrupt_Or_Attach_Handler. (Check_Interrupt_Or_Attach_Handler): Invoke it. Implement pragma Linker_Constructor and Linker_Destructor with the help of Find_Unique_Parameterless_Procedure. Replace Name_Alias with Name_Target for pragma Linker_Alias. * snames.h, snames.ads, snames.adb: Add Name_Linker_Constructor and Name_Linker_Destructor. Add Pragma_Linker_Constructor and Pragma_Linker_Destructor. * snames.adb: Remove Name_Alias. * trans.c: Include cgraph.h. (build_global_cdtor): New function. (Compilation_Unit_to_gnu): Build global constructor and destructor if needed. (tree_transform) <N_Identifier>: Substitute renaming of view-conversions of objects too. (addressable_p) <COMPONENT_REF>: Unconditionally test DECL_NONADDRESSABLE_P on STRICT_ALIGNMENT platforms. * utils.c (process_attributes) <ATTR_LINK_ALIAS>: Do not assemble the variable if it is external. (static_ctors, static_dtors): New global variables. (process_attributes) <ATTR_LINK_CONSTRUCTOR>: New case. <ATTR_LINK_DESTRUCTOR>: Likewise. (end_subprog_body): Chain function as constructor and destructor if requested. * exp_util.adb (Force_Evaluation): Unconditionally invoke Remove_Side_Effects with Variable_Ref set to true. (Remove_Side_Effects): Handle scalar types first. Use a renaming for non-scalar types even if Variable_Ref is true and for class-wide expressions. From-SVN: r101576
2005-07-01Update FSF addressR. Kelley Cook1-2/+2
From-SVN: r101492
2005-04-01adaint.c, [...]: Fix comment typos.Kazu Hirata1-4/+4
* adaint.c, cal.c, decl.c, gigi.h, gmem.c, init.c, link.c, raise.c, tracebak.c, trans.c, utils2.c, utils.c: Fix comment typos. From-SVN: r97369
2005-03-29re PR ada/19956 (ICE copy_tree_r, at tree-inline.c:2320 on simple Ada code)Richard Kenner1-4/+6
2005-03-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> PR ada/19956 * utils.c (finish_record_type): Use variable_size when setting sizes. From-SVN: r97186
2005-03-15re PR ada/19900 (ACATS c391002 c432002 ICE categorize_ctor_elements_1)Eric Botcazou1-166/+178
2005-03-08 Eric Botcazou <ebotcazou@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Nicolas Setton <setton@adacore.com> Ed Schonberg <schonberg@adacore.com> PR ada/19900 PR ada/19408 PR ada/19140 PR ada/20255 * decl.c (gnat_to_gnu_field): Reject aliased components with a representation clause that prescribes a size not equal to the rounded size of their types. (gnat_to_gnu_entity, case E_Component): Always look at Original_Record_Component if Present and not the entity. (gnat_to_gnu_entity, case E_Record_Subtype): Rework handling of subtypes of tagged extension types by not making field for components that are inside the parent. (gnat_to_gnu_entity) <E_Record_Type>: Fix typo in the alignment formula (gnat_to_gnu_entity) <E_Variable>: Do not convert again the expression to the type of the object when the object is constant. Reverse defer_debug_incomplete_list before traversing it, so that trees are processed in the order at which they were added to the list. This order is important when using the stabs debug format. If we are deferring the output of debug information, also defer this output for a function return type. When adding fields to a record, prevent emitting debug information for incomplete records, emit the information only when the record is complete. (components_to_record): New parameter defer_debug. (gnat_to_gnu_entity, case E_Array_Subtype): Call copy_alias_set. (gnat_to_gnu_field_decl): New function. (substitution_list, annotate_rep): Call it. (gnat_to_gnu_entity, case E_Record_Subtype): Likewise. (gnat_to_gnu_entity, case E_Record_Type): Likewise. No longer update discriminants to not be a COMPONENT_REF. (copy_alias_set): Strip padding from input type; also handle unconstrained arrays properly. * gigi.h (write_record_type_debug_info): New function. Convert to use ANSI-style prototypes. Remove unused declarations for emit_stack_check, elab_all_gnat and set_second_error_entity. (gnat_to_gnu_field_decl): New decl. * utils.c (write_record_type_debug_info): New function. (finish_record_type): Delegate generation of debug information to write_record_type_debug_info. (update_pointer_to): Remove unneeded calls to rest_of_decl_compilation. (update_pointer_to): Fix pasto. (convert) <UNION_TYPE>: Accept slight type variations when converting to an unchecked union type. * exp_ch13.adb (Expand_N_Freeze_Entity): If Freeze_Type returns True, replace the N_Freeze_Entity with a null statement. * freeze.adb (Freeze_Expression): If the freeze nodes are generated within a constrained subcomponent of an enclosing record, place the freeze nodes in the scope stack entry for the enclosing record. (Undelay_Type): New Subprogram. (Set_Small_Size): Pass T, the type to modify; all callers changed. (Freeze_Entity, Freeze_Record_Type): Change the way we handle types within records; allow them to have freeze nodes if their base types aren't frozen yet. * sem_ch3.adb (Derived_Type_Declaration): New predicate Comes_From_Generic, to recognize accurately that the parent type in a derived type declaration can be traced back to a formal type, because it is one or is derived from one, or because its completion is derived from one. (Constrain_Component_Type): If component comes from source and has no explicit constraint, no need to constrain in in a subtype of the enclosing record. (Constrain_Access, Constrain_Array): Allow itypes to be delayed. Minor change to propagate Is_Ada_2005 flag * trans.c (gnat_to_gnu, case N_Aggregate): Verify that Expansion_Delayed is False. (assoc_to_constructor): Ignore fields that have a Corresponding_Discriminant. (gnat_to_gnu) <N_Return_Statement>: Restructure. If the function returns "by target", dereference the target pointer using the type of the actual return value. <all>: Be prepared for a null gnu_result. (processed_inline_subprograms): Check flag_really_no_inline instead of flag_no_inline. (set_second_error_entity): Remove unused function. (gnat_to_gnu, case N_Selected_Component): Call gnat_to_gnu_field_decl. (assoc_to_constructor): Likewise. From-SVN: r96492
2005-02-13re PR ada/19942 (Stage 2 compilation of ali.adb causes GNAT bug box)Andrew Pinski1-1/+1
2005-02-13 Andrew Pinski <pinskia@physics.uc.edu> PR ada/19942 * utils.c (gnat_type_for_mode): Return null instead of ICE because we asked for an unknown mode. From-SVN: r94989
2005-02-12utils.c (gnat_type_for_mode): Return NULL for COMPLEX modes...Richard Henderson1-2/+6
* utils.c (gnat_type_for_mode): Return NULL for COMPLEX modes; validate SCALAR_INT_MODE_P before calling gnat_type_for_size. From-SVN: r94946
2005-02-10Fix for c330001 - PR ada/19386Eric Botcazou1-17/+28
2005-02-09 Eric Botcazou <ebotcazou@adacore.com> Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Fix for c330001 - PR ada/19386 * decl.c: (gnat_to_gnu_field): Do not necessarily invoke make_packable_type on the field if Pragma Component_Alignment (Storage_Unit). (gnat_to_gnu_entity, case object): Do not treat a renaming that has side-effects as if it were a constant; also make SAVE_EXPR to protect side-effects. (gnat_to_gnu_entity, case E_Record_Subtype): If have _Parent, make a UNION_TYPE. (make_dummy_type): Set TYPE_UNCHECKED_UNION_P. (components_to_record): Test it. Fix improper usage of REFERENCE_CLASS_P. * utils2.c (build_binary_op, case MODIFY_EXPRP): Treat UNION_TYPE as RECORD_TYPE. * utils2.c: Minor reformatting. * utils.c (convert, case UNION_TYPE): Check TYPE_UNCHECKED_UNION; handle other cases like RECORD_TYPE. * utils.c (gnat_pushdecl): Set TREE_NO_WARNING. From-SVN: r94812
2005-02-09builtins.c (DEF_BUILTIN): Add COND argument.Richard Henderson1-100/+2
* builtins.c (DEF_BUILTIN): Add COND argument. * tree.h (DEF_BUILTIN): Likewise. * builtins.def (DEF_GCC_BUILTIN, DEF_LIB_BUILTIN, DEF_EXT_LIB_BUILTIN, DEF_C94_BUILTIN, DEF_C99_BUILTIN, DEF_C99_C90RES_BUILTIN): Update to match. (DEF_BUILTIN_STUB): New. (BUILT_IN_STACK_SAVE, BUILT_IN_STACK_RESTORE, BUILT_IN_INIT_TRAMPOLINE, BUILT_IN_ADJUST_TRAMPOLINE, BUILT_IN_NONLOCAL_GOTO, BUILT_IN_PROFILE_FUNC_ENTER, BUILT_IN_PROFILE_FUNC_EXIT): Use it. * c-common.c (DEF_BUILTIN): Add COND argument. * tree.c (local_define_builtin): New. (build_common_builtin_nodes): New. ada/ * utils.c (gnat_define_builtin): Remove. (gnat_install_builtins): Use build_common_builtin_nodes. fortran/ * f95-lang.c (gfc_init_builtin_functions): Call build_common_builtin_nodes; do not define any functions handled by it. java/ * builtins.c (initialize_builtins): Call build_common_builtin_nodes. * decl.c (java_init_decl_processing): Initialize const_ptr_type_node. treelang/ * treetree.c (treelang_init_decl_processing): Call build_common_builtin_nodes. From-SVN: r94785
2005-01-03decl.c (compatible_signatures_p): New function.Arnaud Charlet1-0/+14
* decl.c (compatible_signatures_p): New function. The intended purpose is to check if two function signatures for a call-site and a callee are compatible enough for the call to be valid. The underlying purpose is to check if a call to a mapped builtin is using the right interface. The current code actually does not check antyhing - this a placeholder for future refinements. (gnat_to_gnu_entity) <E_Subprogram_Call>: Add preliminary bits to handle builtin calls for convention Intrinsic. * gigi.h (builtin_decl_for): Declare (new function). * utils.c (gnat_install_builtins): Install the target specific builtins. (builtin_decl_for): New function, provide a dummy body for now. From-SVN: r92833
2004-12-08decl.c (maybe_pad_type): Use TYPE_SIZE_UNIT of the input type for ↵Arnaud Charlet1-29/+35
TYPE_SIZE_UNIT of result type if... * decl.c (maybe_pad_type): Use TYPE_SIZE_UNIT of the input type for TYPE_SIZE_UNIT of result type if SIZE is not specified. (make_aligning_type): Pass -1 as ADDRESSABLE to prevent the creation of a bitfield, which we know is useless and causes trouble because of alignment implications. * utils.c (create_var_decl): Set DECL_COMMON again on targets without BSS sections. (process_attributes): Clear DECL_COMMON again when a section attribute is present. (finish_record_type): Independently track if RECORD_TYPE has SIZE and/or SIZE_UNIT already set and use to compute final SIZE and SIZE_UNIT. (create_field_decl): Special case ADDRESSABLE negative to mean "no bitfield creation", to be used by make_aligning_type. Don't restrict bitfield creation to !ADDRESSABLE any more, as some BLKmode fields claimed addressable still have to be bitfields. Use value_factor_p instead of a raw binop construction to check for the position's alignment. From-SVN: r91879
2004-11-19a-exexpr.adb (Others_Value, [...]): New variables...Arnaud Charlet1-1/+15
* a-exexpr.adb (Others_Value, All_Others_Value): New variables, the address of which may be used to represent "others" and "all others" choices in exception tables, instead of the current harcoded (void *)0 and (void *)1. (Setup_Exception): Do nothing in the GNAT SJLJ case. * gigi.h (others_decl, all_others_decl): New decls representing the new Others_Value and All_Others_Value objects. (struct attrib): Rename "arg" component as "args", since GCC expects a list of arguments in there. * raise.c (GNAT_OTHERS, GNAT_ALL_OTHERS): Are now the address of the corresponding objects exported by a-exexpr, instead of hardcoded dummy addresses. * trans.c (Exception_Handler_to_gnu_zcx): Use the address of others_decl and all_others_decl instead of hardcoded dummy addresses to represent "others" and "all others" choices, which is cleaner and more flexible with respect to the possible eh pointer encoding policies. * utils.c (init_gigi_decls): Initialize others_decl and all_others_decl. (process_attributes): Account for the naming change of the "args" attribute list entry component. * decl.c (build_attr_list): Rename into prepend_attributes to allow cumulating attributes for different entities into a single list. (gnat_to_gnu_entity): Use prepend_attributes to build the list of attributes for the current entity and propagate first subtype attributes to other subtypes. <E_Procedure>: Attribute arguments are attr->args and not attr->arg any more. (build_attr_list): Ditto. Make attr->args a TREE_LIST when there is an argument provided, as this is what GCC expects. Use NULL_TREE instead of 0 for trees. From-SVN: r90900
2004-10-04cuintp.c, [...]: Use gcc_assert and gcc_unreachable.Richard Kenner1-31/+16
2004-10-04 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * cuintp.c, decl.c, utils2.c: Use gcc_assert and gcc_unreachable. * trans.c (assoc_to_constructor): Fix unused var warning if no checking. (gnat_gimplify_expr, case ADDR_EXPR): Fix error in last change. Use gcc_assert and gcc_unreachable. * decl.c (gnat_to_gnu_entity, case object): Check and process a specified alignment before validating size. (gnat_to_gnu_entity) <E_Modular_Integer_Subtype>: Create a stripped-down declaration for the type of the inner field when making a JM type. * utils.c (finish_record_type): Do not compute the size in units incrementally. Instead compute it once for the rep clause case. Use gcc_assert and gcc_unreachable. From-SVN: r88493
2004-09-21decl.c (gnat_to_gnu_type, [...]): Wrap modular packed array types in both ↵Robert Dewar1-11/+11
little- and big-endian cases. 2004-09-21 Robert Dewar <dewar@gnat.com> * decl.c (gnat_to_gnu_type, case E_Modular_Integer_Type): Wrap modular packed array types in both little- and big-endian cases. This change ensures that we no longer count on the unused bits being initialized for such types (and in particular ensures that equality testing will only read the relevant bits). Change name TYPE_LEFT_JUSTIFIED_MODULAR_P to TYPE_JUSTIFIED_MODULAR_P These changes mean that we no longer need to initialize small packed arrays. (gnat_to_gnu_entity) <E_Record_Subtype>: Apply the same optimization to an LJM field as to its parent field. * ada-tree.h:, trans.c, utils.c, utils2.c: Change name TYPE_LEFT_JUSTIFIED_MODULAR_P to TYPE_JUSTIFIED_MODULAR_P From-SVN: r87806
2004-09-20re PR middle-end/16460 (ICE when compiling glibc (ld-ctype.c))Jan Hubicka1-18/+1
PR middle-end/16460 * cgraph.c (cgraph_unnest_node): New function. (c_finalize): Rename to .... (c_warn_unused_result_recursivly): ... this one; do only the warning (finish_function): Finalize the toplevel function; do not lower nested tree. * cgraph.h (cgraph_unnest_node): Declare. * cgraphunit.c (decide_is_function_needed): Do not use cgraph nestedness datastructure. * cse.c (cse_insn): Do not cprop nonlocal LABEL_REFs. * reload1.c (set_label_offsets): Fix call of set_label_offsets. * tree-nested.c (finlize_nesting_tree_1): Use un-nesting code. * utils.c (gnat_finalize): Remove. (end_subprog_body): Directly call cgraph_finalize_function; do not lower the nested functions. * trans-decl.c (build_entry_thunks): Finalize the function; do not lower tree. (gfc_generate_function_code): Likewise. From-SVN: r87770
2004-09-17alias.c (find_base_decl): Remove unreachable case '3' block.Jeffrey D. Oldham1-8/+12
2004-09-17 Jeffrey D. Oldham <oldham@codesourcery.com> Zack Weinberg <zack@codesourcery.com> * alias.c (find_base_decl): Remove unreachable case '3' block. * expr.c (safe_from_p): Abort if passed a type. * tree-gimple.c (recalculate_side_effects): Abort if passed anything other than an expression. * tree-ssa-pre.c (phi_translate): Return expr immediately if is_gimple_min_invariant is true for it. Reorder cases for clarity. Abort on un-handled tree classes. (valid_in_set): Likewise. * tree.c (tree_code_class_strings): New static data. * tree.h (enum tree_code_class): New. (tree_code_class_strings): Declare. (TREE_CODE_CLASS_STRING, EXCEPTIONAL_CLASS_P, CONSTANT_CLASS_P) (REFERENCE_CLASS_P, COMPARISON_CLASS_P, UNARY_CLASS_P, BINARY_CLASS_P) (STATEMENT_CLASS_P, EXPRESSION_CLASS_P, IS_TYPE_OR_DECL_P): New macros. (TYPE_P, DECL_P, IS_NON_TYPE_CODE_CLASS, IS_EXPR_CODE_CLASS) (checking macros, EXPR_LOCATION, SET_EXPR_LOCATION, EXPR_LOCUS): Update. * tree.def, c-common.def, objc/objc-tree.def: Use tree_code_class enumeration constants instead of code letters. * alias.c, builtins.c, c-common.c, c-format.c, c-lang.c, c-pragma.c * c-typeck.c, cgraphunit.c, convert.c, dbxout.c, dwarf2out.c * emit-rtl.c expr.c, fold-const.c, gimplify.c, lambda-code.c * langhooks.c, langhooks.h, predict.c, print-tree.c, reload1.c, stmt.c * tree-browser.c, tree-cfg.c, tree-chrec.c, tree-complex.c, tree-dfa.c * tree-dump.c, tree-eh.c, tree-gimple.c, tree-inline.c, tree-nested.c * tree-outof-ssa.c, tree-pretty-print.c, tree-sra.c, tree-ssa-ccp.c * tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-forwprop.c, tree-ssa-live.c * tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-operands.c * tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-propagate.c * tree-ssa.c, tree-ssanames.c, tree-tailcall.c, tree.c, varasm.c * config/sol2-c.c, config/arm/arm.c, config/i386/winnt.c * config/pa/pa.c, config/pa/pa.h, config/sh/sh.c, objc/objc-lang.c Update to match. * LANGUAGES: Add note about change. ada: * ada-tree.def: Use tree_code_class enumeration constants instead of code letters. * ada-tree.h, decl.c, misc.c, trans.c, utils.c, utils2.c: Update for new tree-class enumeration constants. cp: * cp-tree.def: Use tree_code_class enumeration constants instead of code letters. * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c * mangle.c, pt.c, semantics.c, tree.c, typeck.c: Update for new tree-class enumeration constants. fortran: * f95-lang.c, trans-expr.c, trans.c: Update for new tree-class enumeration constants. java: * java-tree.def: Use tree_code_class enumeration constants instead of code letters. * java-gimplify.c, jcf-write.c, lang.c, parse.y: Update for new tree-class enumeration constants. treelang: * treetree.c: Update for new tree-class enumeration constants. From-SVN: r87675
2004-09-13[multiple changes]Arnaud Charlet1-42/+50
2004-09-09 Vincent Celier <celier@gnat.com> * a-direct.ads: Add pragma Ada_05 (Directory_Entry_Type): Give default value to component Kind to avoid not initialized warnings. * a-direct.adb (Current_Directory): Remove directory separator at the end. (Delete_Directory, Delete_Tree): Raise Name_Error if Directory is not an existing directory. (Fetch_Next_Entry): Give default value to variable Kind to avoid warning (Size (String)): Function C_Size returns Long_Integer, not File_Size. Convert the result to File_Size. * prj.ads: (Project_Error): New exception * prj-attr.adb: Except in procedure Initialize, Fail comes from Prj.Com, not from Osint. (Attrs, Package_Attributes): Tables moved to private part of spec (Add_Attribute, Add_Unknown_Package): Moved to new child package Prj.Attr.PM. (Register_New_Package (Name, Attributes), Register_New_Attribute): Raise Prj.Project_Error after call to Fail. (Register_New_Package (Name, Id)): Set Id to Empty_Package after calling Fail. Check that package name is not already in use. * prj-attr.ads: Comment updates to indicate that all subprograms may be used by tools, not only by the project manager, and to indicate that exception Prj.Prj_Error may be raised in case of problem. (Add_Unknown_Package, Add_Attribute): Moved to new child package Prj.Attr.PM. (Attrs, Package_Attributes): Table instantiations moved from the body to the private part to be accessible from Prj.Attr.PM body. * prj-dect.adb (Parse_Package_Declaration): Call Add_Unknown_Package from new package Prj.Attr.PM. (Parse_Attribute_Declaration): Call Add_Attribute from new package Prj.Attr.PM. * Makefile.in: Add prj-attr-pm.o to gnatmake object list * gnatbind.adb (Gnatbind): Correct warning message (Elaboration_Check instead of Elaboration_Checks). * a-calend.adb: Minor reformatting 2004-09-09 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * gigi.h (maybe_pad_type): New declaration. (create_subprog_type): New arg RETURNS_BY_TARGET_PTR. * ada-tree.h: (TYPE_RETURNS_BY_TARGET_PTR_P): New macro. * cuintp.c: Convert to use buildN. * decl.c (maybe_pad_type): No longer static. (gnat_to_gnu_entity, case E_Function): Handle case of returning by target pointer. Convert to use buildN. * trans.c (call_to_gnu): Add arg GNU_TARGET; support TYPE_RETURNS_BY_TARGET_PTR_P. All callers changed. (gnat_to_gnu, case N_Assignment_Statement): Call call_to_gnu if call on RHS. (gnat_to_gnu, case N_Return): Handle TYPE_RETURN_BY_TARGET_PTR_P. (gnat_gimplify_expr, case ADDR_EXPR): New case. Convert to use buildN. * utils2.c (gnat_build_constructor): Also set TREE_INVARIANT and TREE_READONLY for const. Convert to use buildN. * utils.c (create_subprog_type): New operand RETURNS_BY_TARGET_PTR. (create_var_decl): Refine when TREE_STATIC is set. Convert to use buildN. 2004-09-09 Gary Dismukes <dismukes@gnat.com> * gnat_ugn.texi: Delete text relating to checking of ali and object consistency. * a-except.adb (Rcheck_*): Add pragmas No_Return for each of these routines. 2004-09-09 Jose Ruiz <ruiz@act-europe.fr> * gnat_ugn.texi: Add Detect_Blocking to the list of configuration pragmas recognized by GNAT. * gnat_rm.texi: Document pragma Detect_Blocking. * s-solita.adb (Timed_Delay_T): When pragma Detect_Blocking is active, raise Program_Error if called from a protected operation. * s-taprob.adb (Lock): When pragma Detect_Blocking is active increase the protected action nesting level. (Lock_Read_Only): When pragma Detect_Blocking is active increase the protected action nesting level. (Unlock): When pragma Detect_Blocking is active decrease the protected action nesting level. * s-taskin.adb (Initialize_ATCB): Initialize to 0 the Protected_Action_Nesting. * s-taskin.ads: Adding the field Protected_Action_Nesting to the Common_ATCB record. It contains the dynamic level of protected action nesting for each task. It is needed for checking whether potentially blocking operations are called from protected operations. (Detect_Blocking): Adding a Boolean constant reflecting whether pragma Detect_Blocking is active or not in the partition. * s-tasren.adb (Call_Simple): When pragma Detect_Blocking is active, raise Program_Error if called from a protected operation. (Task_Entry_Call): When pragma Detect_Blocking is active, raise Program_Error if called from a protected operation. (Timed_Task_Entry_Call): When pragma Detect_Blocking is active, raise Program_Error if called from a protected operation. * s-tassta.adb (Abort_Tasks): When pragma Detect_Blocking is active, raise Program_Error if called from a protected operation. * s-tpoben.adb (Lock_Entries): When pragma Detect_Blocking is active, raise Program_Error if called from a protected operation, and increase the protected action nesting level. (Lock_Read_Only_Entries): When pragma Detect_Blocking is active, raise Program_Error if called from a protected operation, and increase the protected action nesting level. (Unlock_Entries): When pragma Detect_Blocking is active decrease the protected action nesting level. * s-tposen.adb (Lock_Entry): When pragma Detect_Blocking is active, raise Program_Error if called from a protected operation, and increase the protected action nesting level. (Lock_Read_Only_Entry): When pragma Detect_Blocking is active, raise Program_Error if called from a protected operation, and increase the protected action nesting level. (Protected_Single_Entry_Call): When pragma Detect_Blocking is active, raise Program_Error if called from a protected operation. (Timed_Protected_Single_Entry_Call): When pragma Detect_Blocking is active, raise Program_Error if called from a protected operation. (Unlock_Entry): When pragma Detect_Blocking is active decrease the protected action nesting level. * sem_util.adb (Check_Potentially_Blocking_Operation): Remove the insertion of the statement raising Program_Error. The run time contains the required machinery for handling that. * sem_util.ads: Change comment associated to procedure Check_Potentially_Blocking_Operation. This procedure does not insert a call for raising the exception because that is currently done by the run time. * raise.h (__gnat_set_globals): Pass the detect_blocking parameter. * init.c: Add the global variable __gl_detect_blocking that indicates whether pragma Detect_Blocking is active (1) or not (0). Needed for making the pragma available at run time. (__gnat_set_globals): Pass and update the detect_blocking parameter. * lib-writ.adb (Write_ALI): Set the DB flag in the ali file if pragma Detect_Blocking is active. * lib-writ.ads: Document the Detect_Blocking flag (DB) in ali files. * ali.adb (Scan_ALI): Set the Detect_Blocking value to true if the flag DB is found in the ali file. Any unit compiled with pragma Detect_Blocking active forces its effect in the whole partition. * a-retide.adb (Delay_Until): Raise Program_Error if pragma Detect_Blocking is active and delay is called from a protected operation. * bindgen.adb (Gen_Adainit_Ada): When generating the call to __gnat_set_globals, pass 1 as Detect_Blocking parameter if pragma Detect_Blocking is active (0 otherwise). (Gen_Adainit_C): When generating the call to __gnat_set_globals, pass 1 as Detect_Blocking parameter if pragma Detect_Blocking is active (0 otherwise). 2004-09-09 Thomas Quinot <quinot@act-europe.fr> * gnat_rm.texi: Rename GNAT.Perfect_Hash.Generators to GNAT.Perfect_Hash_Generators, and remove the empty GNAT.Perfect_Hash package. * s-parint.ads, s-parint.adb (Get_RAS_Info): New subprogram. (Register_Receiving_Stub): Add Subp_Info formal parameter. Update API in placeholder implemetation of s-parint to reflect changes in distribution runtime library. * sem_ch3.adb (Expand_Derived_Record): Rename to Expand_Record_Extension. * sem_disp.adb (Check_Controlling_Formals): Improve error message for primitive operations of potentially distributed object types that have non-controlling anonymous access formals. * sem_dist.ads, sem_dist.adb (Build_RAS_Primitive_Specification): New subprogram. New implementation of expansion for remote access-to-subprogram types, based on the RACW infrastructure. This version of sem_dist is compatible with PolyORB/DSA as well as GLADE. * sem_prag.adb (Analyze_Pragma, case Pragma_Asynchronous): For a pragma Asynchrronous that applies to a remote access-to-subprogram type, mark the underlying RACW type as asynchronous. * link.c: FreeBSD uses GNU ld: set __gnat_objlist_file_supported and __gnat_using_gnu_linker to 1. * Makefile.rtl, impunit.adb, g-perhas.ads, g-pehage.ads, g-pehage.adb: Rename GNAT.Perfect_Hash.Generators to GNAT.Perfect_Hash_Generators, and remove the empty GNAT.Perfect_Hash package. * atree.adb: Minor reformatting * exp_ch3.adb (Expand_Derived_Record): Rename to Expand_Record_Extension. (Build_Record_Init_Proc.Build_Assignment): The default expression in a component declaration must remain attached at that point in the tree so New_Copy_Tree copies it if the enclosing record type is derived. It is therefore necessary to take a copy of the expression when building the corresponding assignment statement in the init proc. As a side effect, in the case of a derived record type, we now see the original expression, without any rewriting that could have occurred during expansion of the ancestor type's init proc, and we do not need to go back to Original_Node. * exp_ch3.ads (Expand_Derived_Record): Rename to Expand_Record_Extension. * exp_dist.ads, exp_dist.adb (Underlying_RACW_Type): New subprogram. Returns the RACW type used to implement a remote access-to-subprogram type. (Add_RAS_Proxy_And_Analyze, Build_Remote_Subprogram_Proxy_Type): New subprograms. Used to create a proxy tagged object for a remote subprogram. The proxy object is used as the designated object for RAS values on the same partition (unless All_Calls_Remote applies). (Build_Get_Unique_RP_Call): New subprogram. Build a call to System.Partition_Interface.Get_Unique_Remote_Pointer. (Add_RAS_Access_TSS, Add_RAS_Dereference_TSS): Renamed from Add_RAS_*_Attribute. (Add_Receiving_Stubs_To_Declarations): Generate a table of local subprograms. New implementation of expansion for remote access-to-subprogram types, based on the RACW infrastructure. * exp_dist.ads (Copy_Specification): Update comment to note that this function can copy the specification from either a subprogram specification or an access-to-subprogram type definition. 2004-09-09 Ed Schonberg <schonberg@gnat.com> * sem_type.adb (Disambiguate): Handle properly an accidental ambiguity in an instance, between an explicit subprogram an one inherited from a type derived from an actual. * exp_ch6.adb (Expand_N_Subprogram_Body): If polling is enabled, do not add a polling call if the subprogram is to be inlined by the back-end, to avoid repeated calls with multiple inlinings. * checks.adb (Apply_Alignment_Check): If the expression in the address clause is a call whose name is not a static entity (e.g. a dispatching call), treat as dynamic. 2004-09-09 Robert Dewar <dewar@gnat.com> * g-trasym.ads: Minor reformatting * exp_ch3.adb (Component_Needs_Simple_Initialization): Don't except packed arrays, since unused bits are expected to be zero for a comparison. 2004-09-09 Eric Botcazou <ebotcazou@act-europe.fr> * exp_pakd.ads: Fix an inacurracy and a couple of typos in the head comment. 2004-09-09 Pascal Obry <obry@gnat.com> * mdll.ads, mdll.adb (Build_Dynamic_Library): New parameter Map_File to enable map file generation. Add the right option to generate the map file if Map_File is set to True. * gnatdll.adb (Gen_Map_File): New variable. (Syntax): Add info about new -m (Map_File) option. (Parse_Command_Line): Add support for -m option. (gnatdll): Pass Gen_Map_File to Build_Dynamic_Library calls. Minor reformatting. 2004-09-09 Laurent Pautet <pautet@act-europe.fr> * gnatls.adb: Add a very verbose mode -V. Such mode is required by the new gnatdist implementation. Define a subpackage isolating the output routines specific to this verbose mode. 2004-09-09 Joel Brobecker <brobecker@gnat.com> * Makefile.rtl: (GNATRTL_NONTASKING_OBJS): Add g-dynhta. * gnat_ugn.texi (Main Subprograms): Fix typo. Deduced, not deducted. 2004-09-09 Cyrille Comar <comar@act-europe.fr> * opt.adb (Set_Opt_Config_Switches): Use Ada_Version_Runtime to compile internal unit. * opt.ads: Add Ada_Version_Runtime constant used to decide which version of the language is used to compile the run time. 2004-09-09 Arnaud Charlet <charlet@act-europe.fr> * sem_util.adb (Requires_Transient_Scope): Re-enable handling of variable length temporaries for function return now that the back-end and gigi support it. From-SVN: r87435
2004-09-01[multiple changes]Arnaud Charlet1-4/+4
2004-08-31 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * misc.c (gnat_print_type): Use TYPE_RM_SIZE_NUM. * trans.c (struct stmt_group): Delete field GLOBAL. (gnat_init_stmt_group): Do not initialize it. (call_to_gnu): Use save_expr, not protect_multiple_eval. (Exception_Handler_to_gnu_sjlj): Call build_int_cst, not build_int_2 (gnat_to_gnu, case N_Character_Literal, N_String_Literal): Likewise. (gnat_to_gnu, case N_Compilation_Unit): Do not set GLOBAL in stmt group. (start_stmt_group): Likewise. (add_stmt, add_decl_expr): Rework handling of global DECL_EXPRs. * utils2.c (ggc.h): Include. (build_call_raise): Call build_int_cst, not build_int_2. * utils.c (gnat_init_decl_processing): Fix arg to build_common_tree_nodes. (create_subprog_type): Do not use SET_TYPE_CI_CO_LIST. (gnat_define_builtin): Set built_in_decls. (init_gigi_decls): Call build_int_cst, not build_int_2. * ada-tree.h (struct lang_decl, struct lang_type): Field is type tree. (GET_TYPE_LANG_SPECIFIC, SET_TYPE_LANG_SPECIFIC): New macros. (GET_DECL_LANG_SPECIFIC, SET_DECL_LANG_SPECIFIC): Likewise. (TYPE_CI_CO_LIST, SET_TYPE_CI_CO_LIST, TYPE_MODULE, SET_TYPE_MODULE): Use them. (TYPE_INDEX_TYPE, SET_TYPE_INDEX_TYPE, TYPE_DIGITS_VALUE): Likewise. (SET_TYPE_DIGITS_VALUE, TYPE_UNCONSTRAINED_ARRAY): Likewise. (SET_TYPE_UNCONSTRAINED_ARRAY, TYPE_ADA_SIZE, SET_TYPE_ADA_SIZE): Likewise. (TYPE_ACTUAL_BOUNDS, SET_TYPE_ACTUAL_BOUNDS): Likewise. (DECL_CONST_CORRESPONDING_VAR, SET_DECL_CONST_CORRESPONDING_VAR): Likewise. (DECL_ORIGINAL_FIELD, SET_DECL_ORIGINAL_FIELD): Likewise. (TYPE_RM_SIZE_INT, TYPE_RM_SIZE_ENUM, SET_TYPE_RM_SIZE_ENUM): Deleted. (TYPE_RM_SIZE_NUM): New macro. (TYPE_RM_SIZE): Modified to use above. * cuintp.c: (build_cst_from_int): New function. (UI_To_gnu): Use it. * decl.c (gnat_to_gnu_entity): Use TYPE_RM_SIZE_NUM. (make_type_from_size): Avoid changing TYPE_UNSIGNED of a type. (gnat_substitute_in_type, case ARRAY_TYPE): If old had a MIN_EXPR for the size, copy it into new. 2004-08-31 Robert Dewar <dewar@gnat.com> * exp_ch6.adb (Expand_Call): Properly handle validity checks for packed indexed component where array is an IN OUT formal. This generated garbage code previously. * gnat_ugn.texi: Document -fverbose-asm * gnat-style.texi: Minor updates (note that boolean constants and variables are joined with AND/OR rather than short circuit forms). 2004-08-31 Ed Schonberg <schonberg@gnat.com> * exp_util.adb (Safe_Unchecked_Type_Conversion): Conversion is safe if it is an upward conversion of an untagged type with no representation change. 2004-08-31 Thomas Quinot <quinot@act-europe.fr> * rtsfind.ads: Move RCI_Subp_Info and RCI_Subp_Info_Array to System.Partition_Interface. * checks.adb (Apply_Access_Checks): Do not generate checks when expander is not active (but check for unset reference to prefix of dereference). * sem_prag.adb (Analyze_Pragma, case Pragma_Debug): Uniformly rewrite pragma Debug as an if statement with a constant condition, for consistent treatment of entity references contained within the enclosed procedure call. 2004-08-31 Vincent Celier <celier@gnat.com> * bindgen.adb: (Set_EA_Last): New procedure (Gen_Exception_Table_Ada, Gen_Exception_Table_C): Use new procedure Set_EA_Last. (Gen_Adafinal_Ada): If no finalization, adafinal does nothing (Gen_Output_File_Ada): Always call Gen_Adafinal_Ada, so that SAL can be linked without errors. (Gen_Exception_Table_Ada): Correct bugs when generating code for arrays ST and EA. (Gen_Exception_Table_C): Correct same bugs * vms_data.ads: Add new qualifier /VERBOSE_ASM to GCC_Switches * g-os_lib.adb (Normalize_Pathname.Get_Directory): When Dir is empty, on Windows, make sure that the drive letter is in upper case. * g-os_lib.ads (Normalize_Pathname): Add a comment to indicate that on Windows, when the drive letter is added and Case_Sensitive is True, the drive letter is forced to upper case. * mlib-tgt-irix.adb (Build_Dynamic_Library): Transfer all -lxxx options to Options_2 for the call to MLib.Utl.Gcc. * bld.adb (Put_Include_Project): Use '/', not '\' on Windows as directory separator when defining BASE_DIR. 2004-08-19 Pascal Obry <obry@gnat.com> * gprcmd.adb (Extend): Do not output trailing directory separator. This is not needed and it confuses Windows GNU/make which does not report directory terminated by a slash as a directory. (gprcmd): Idem for "pwd" internal command. * Makefile.generic: Use __GPRCOLON__ instead of pipe character in target names rewrite to fix regressions with recent version of GNU/make. Starting with GNU/make 3.80 the pipe character was not handled properly anymore. From-SVN: r86883
2004-08-27* utils.c (gnat_init_decl_processing): Ada has a signed sizetype.Nathan Sidwell1-1/+1
From-SVN: r86656
2004-08-25tree.h (build_int_cst): New, sign extended constant.Nathan Sidwell1-1/+1
* tree.h (build_int_cst): New, sign extended constant. (build_int_cstu): New, zero extended constant. (build_int_cst_wide): Renamed from build_int_cst. * tree.c (build_int_cst, build_int_cstu): New. (build_int_cst_wide): Renamed from build_int_cst. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Adjust build_int_cst calls. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_classify_type, fold_builtin_lround, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Likewise. * c-common.c (start_fname_decls, fix_string_type, shorten_compare, DEF_ATTR_INT): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary) <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. convert.c (convert_to_pointer): Likewise. coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_fn_info_value, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const, round_up, round_down): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_case, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv, canonicalize_loop_induction_variables): Likewise. * tree-vectorizer.c (vect_create_index_for_array_ref, vect_transform_loop_bound, vect_compute_data_ref_alignment): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Likewise. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Likewise. 2004-04-25 Paolo Bonzini <bonzini@gnu.org> * cfglayout.c (duplicate_insn_chain): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator. * cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT. * final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove. * jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop, check_dbra_loop, loop_dump_aux): Remove references to removed notes and fields. * reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs. * unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove references to removed notes and fields. (subtract_reg_term, ujump_to_loop_cont): Remove. From-SVN: r86544
2004-08-24c-decl.c (c_init_decl_processing): Adjust build_common_tree_nodes call.Nathan Sidwell1-1/+1
* c-decl.c (c_init_decl_processing): Adjust build_common_tree_nodes call. * expmed.c (const_mult_add_overflow_p): Use build_distinct_type_copy. * stor-layout.c (early_type_list): Remove. (layout_type): Don't append to early_type_list. (initialize_sizetypes): Add signed_p argument. (set_sizetype): Overwrite the stub type nodes directly. * tree.c (copy_node_stat): Clear a type's value cache here ... (build_distinct_type): ... not here. (build_common_tree_nodes): Add signed_sizetype argument. Adjust. * tree.h (initialize_sizetypes): Add signed_p argument. (build_common_tree_nodes): Likewise. * ada/utils.c (gnat_init_decl_processing): Adjust build_common_tree_nodes call. * cp/decl.c (cxx_init_decl_processing): Adjust build_common_tree_nodes call. * fortran/f95-lang.c (gfc_init_decl_processing): Adjust build_common_tree_nodes call. * java/decl.c (java_init_decl_processing): Adjust initialize_sizetypes call. * objc/objc-act.c (get_static_reference): Use build_variant_type_copy. (get_protocol_reference): Likewise. * objc/objc-act.h (TREE_STATIC_TEMPLATE): Use TREE_PRIVATE. * treelang/treetree.c (treelang_init_decl_processing): Adjust build_common_tree_nodes call. From-SVN: r86493
2004-08-15tree.h (build_int_cst): New.Nathan Sidwell1-1/+1
.: * tree.h (build_int_cst): New. (build_int_2): Remove. * tree.c (build_int_2): Remove. (build_int_cst): New. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Use build_int_cst. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_lround, fold_builtin_bitop, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Use build_int_cst. * c-common.c (start_fname_decls, fix_string_type, c_common_nodes_and_builtins, c_init_attributes, shorten_compare): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary): <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. * convert.c (convert_to_pointer): Likewise. * coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. * fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_end_case_type, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Use build_int_cst. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/i860/i860.c (i860_va_start): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Use build_int_cst. ada: * cuintp.c (UI_To_gnu): Use build_int_cst.. * trans.c (Exception_Handler_to_gnu_sjlj, gnat_to_gnu): Likewise. * utils.c (init_gigi_decls): Likewise. * utils2.c (build_call_raise): Likewise. cp: * call.c (convert_class_to_reference, build_user_type_conversion_1, convert_like_real, build_java_interface_fn_ref, build_special_member_call): Use build_int_cst. * class.c (build_vtbl_initializer): Likewise. * cp-gimplify.c (cp_gimplify_expr): Likewise. * cvt.c (cp_convert_to_pointer): Likewise. * decl.c (cxx_init_decl_processing, complete_array_type): Likewise. * decl2.c (start_static_initialization_or_destruction, generate_ctor_or_dtor_function): Likewise. * except.c (build_throw): Likewise. * lex.c (cxx_init): Likewise. * mangle.c (write_integer_cst): Likewise. * rtti.c (build_headof, get_tinfo_decl_dynamic, build_dynamic_cast_1, ptr_initializer, ptm_initializer, get_pseudo_ti_init): Likewise. * search.c (get_dynamic_cast_base_type): Likewise. * tree.c (build_shared_int_cst): Likewise. fortran: * trans-array.c (gfc_trans_array_constructor_value): Use build_int_cst. * trans-const.c (gfc_build_string_const, gfc_init_constants, gfc_conv_mpz_to_tree, gfc_conv_constant_to_tree): Likewise. * trans-decl.c (gfc_get_symbol_decl): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ibits, gfc_conv_intrinsic_len, prepare_arg_info): Likewise. * trans-io.c (add_case, set_error_locus, build_dt, transfer_expr): Likewise. * trans-stmt.c (gfc_trans_label_assign, gfc_trans_pause, gfc_trans_stop, gfc_trans_character_select): Likewise. * trans-types.c (gfc_init_types, gfc_get_dtype): Likewise. * trans.c (gfc_trans_runtime_check): Likewise. java: * boehm.c (get_boehm_type_descriptor): Use build_int_cst. * class.c (build_utf8_ref, build_static_field_ref, make_field_value, make_method_value, get_dispatch_table, make_class_data, emit_symbol_table, emit_catch_table): Likewise. * constants.c (get_tag_node, build_ref_from_constant_pool, build_constants_constructor): Likewise. * decl.c (java_init_decl_processing): Likewise. * expr.c (build_java_array_length_access, build_newarray, expand_java_multianewarray, expand_java_pushc, expand_iinc, build_java_binop, build_field_ref, expand_java_add_case, expand_java_call, build_known_method_ref, build_invokevirtual, build_invokeinterface, build_jni_stub): Likewise. * java-gimplify.c (java_gimplify_new_array_init): Likewise. * jcf-parse.c (get_constant): Likewise. * lex.c (do_java_lex): Likewise. * parse.y (patch_binop, patch_unaryop, patch_cast, build_null_of_type, patch_newarray): Likewise. * resource.c (compile_resource_data): Likewise. * typeck.c (build_prim_array_type): Likewise. From-SVN: r86022
2004-08-10builtins.def (BUILT_IN_STACK_ALLOC): Remove.Richard Henderson1-7/+13
* builtins.def (BUILT_IN_STACK_ALLOC): Remove. * builtins.c (expand_builtin) <BUILT_IN_STACK_ALLOC>: Remove. * dwarf2out.c (loc_descriptor): Handle PARALLEL here ... (add_location_or_const_value_attribute): ... not here. Use loc_descriptor_from_tree if possible. (loc_descriptor_from_tree_1): Rename from loc_descriptor_from_tree. Simplify address handling. Handle DECL_VALUE_EXPR. Handle register values specially. (loc_descriptor_from_tree): New. Update callers. * expr.c (expand_var): Ignore DECL_VALUE_EXPR variables. * gimplify.c (gimplify_decl_expr): Lower variable sized types to pointer plus dereference. Set DECL_VALUE_EXPR. Set save_stack. (gimplify_call_expr): Do not recognize BUILT_IN_STACK_ALLOC and BUILT_IN_STACK_RESTORE. (gimplify_expr): Lower DECL_VALUE_EXPR decls. * stmt.c (expand_stack_alloc): Remove. * tree-mudflap.c (mx_register_decls): Don't look for BUILT_IN_STACK_ALLOC. * tree-nested.c (convert_local_reference): Likewise. * tree.h (DECL_VALUE_EXPR): New. ada/ * utils.c (gnat_install_builtins): Remove __builtin_stack_alloc, add __builtin_alloca. fortran/ * f95-lang.c (gfc_init_builtin_functions): Remove __builtin_stack_alloc, add __builtin_alloca. * trans-array.c (gfc_trans_auto_array_allocation): Use DECL_EXPR. * trans-decl.c (gfc_trans_auto_character_variable): Likewise. From-SVN: r85794
2004-08-09[multiple changes]Arnaud Charlet1-3/+2
2004-08-09 Thomas Quinot <quinot@act-europe.fr> * g-socket.adb (Abort_Selector): Initialize Buf to prevent valgrind from complaining on potential uninitialized reference. Change calls to GNAT.Sockets.Thin.Is_Socket_In_Set to account for new specification and test explicitly for non-zero return value. * g-socthi.ads (Is_Socket_In_Set): Declare imported function as returning C.int, to avoid using a derived boolean type. * exp_ch5.adb (Make_Tag_Ctrl_Assignments): Use Duplicate_Subexpr_No_Checks in preference to direct use of Remove_Side_Effects and New_Copy_Tree. Clear Comes_From_Source on prefix of 'Size attribute reference. * g-socthi.adb, g-socthi-vms.adb, g-socthi-mingw.adb, g-socthi-vxworks.adb: Change calls to GNAT.Sockets.Thin.Is_Socket_In_Set to account for new specification and test explicitly for non-zero return value. * g-socthi-vms.ads, g-socthi-mingw.ads, g-socthi-vxworks.ads: (Is_Socket_In_Set): Declare imported function as returning C.int, to avoid using a derived boolean type. 2004-08-09 Albert Lee <lee@gnat.com> * system-irix-n32.ads: Refine tasking priority constants for IRIX. 2004-08-09 Pascal Obry <obry@gnat.com> * gnat_ugn.texi: Document new way to build DLLs on Windows using GCC's -shared option. * mlib-tgt-mingw.adb (Build_Dynamic_Library): Pass GCC's options into Options_2 parameter (options put after object files). 2004-08-09 Olivier Hainque <hainque@act-europe.fr> * decl.c (gnat_to_gnu_entity) <E_Array_Subtype>: Adjust condition to ignore overflows on low and high bounds of an index to also account for differences in signedness between sizetype and gnu_index_subtype. These are as legitimate as the ones caused by a lower TYPE_PRECISION on sizetype. 2004-08-09 Robert Dewar <dewar@gnat.com> * s-solita.ads, s-solita.adb: Minor reformatting * gnat_rm.texi: Add documentation for pragma Profile (Restricted) Move pragma Restricted_Run_Time, No_Run_Time, Ravenscar to new obsolescent section Add note that No_Implicit_Conditionals does not suppress run time constraint checks. * vms_conv.ads: Minor reformatting * s-secsta.adb: Use SS_Ptr instead of Mark_Id as stack pointer (cleanup and necessary for following change). (Mark): Return new format Mark_Id containing sec stack address (Release): Use sec stack address from Mark_Id avoiding Self call * s-secsta.ads: Define SS_Ptr to be used instead of Mark_Id as stack pointer (cleanup and necessary for following change). Define Mark_Id as record containing address of secondary stack, that way Release does not need to find the stack again, decreasing the number of calls to Self and improving efficiency. * sem_util.ads: Add a ??? comment for Is_Local_Variable_Reference * sem_ch5.adb (Analyze_Case_Statement): Add circuitry to track value of case variable into the individual case branches when possible. * sem_ch11.adb: Minor reformatting * prj.ads: Correct spelling of suffixs * prj-nmsc.adb: Minor reformatting Correct spelling suffixs throughout (also in identifiers) * freeze.adb: Minor spelling correction * exp_ch2.adb: Cleanups to handling of Current_Value (no functional effect). * bld.adb: Correct spelling of suffixs * einfo.adb (Enclosing_Dynamic_Scope): Defend against junk argument 2004-08-09 Ed Schonberg <schonberg@gnat.com> PR ada/15408 * sem_ch7.adb (Install_Private_Declarations): In the body of the package or of a child, private entities are both immediately_visible and not hidden. 2004-08-09 Ed Schonberg <schonberg@gnat.com> * sem_eval.adb (Eval_Integer_Literal): If the context is Any_Integer, there are no range checks on the value of the literal. * exp_ch7.adb (Insert_Actions_In_Scope_Around): If the node being wrapped is the triggering alternative of an asynchronous select, action statements mustbe inserted before the select itself. * sem_attr.adb (Analyze_Attribute, case 'Size): Handle properly the case where the prefix is a protected function call. (Resolve_Attribute, case 'Access): The attribute reference on a subprogram is legal in a generic body if the subprogram is declared elsewhere. 2004-08-09 Vincent Celier <celier@gnat.com> * makegpr.adb (Build_Library): Link with g++ if C++ is one of the languages, otherwise building the library may fail with unresolved symbols. (Compile_Sources): Do not build libraries if -c switch is used * gnatlink.adb (Process_Args): New switches -M and -Mmap (Write_Usage): If map file creation is supported, output new switches -M and -Mmap. (Gnatlink): When -M is specified, add the necessary switch(es) to the gcc call, when supported. * Makefile.in: Added indepsw.o to the object list for gnatlink Specified the AIX, GNU/Linux and Windows versions of indepsw.adb * indepsw-aix.adb, indepsw-linux.adb, indepsw-mingw.adb, indepsw.adb, indepsw.ads: New files. 2004-08-09 Bernard Banner <banner@gnat.com> * system-vxworks-x86.ads, s-vxwork-x86.ads: New files. * Makefile.in: add section for vxworks x86 2004-08-09 Hristian Kirtchev <kirtchev@gnat.com> * exp_ch3.adb (Build_Init_Statements): Add extra condition to deal with per-object constrained components where the discriminant is of an Access type. (Build_Record_Init_Proc): Add condition to prevent the inheritance of the parent initialization procedure for derived Unchecked_Unions. Instead, derived Unchecked_Unions build their own initialization procedure. (Build_Variant_Record_Equality): Implement Unchecked_Union equality. Check the body of the subprogram for details. (Freeze_Record_Type): Prevent the inheritance of discriminant checking functions for derived Unchecked_Union types by introducing a condition. Allow the creation of TSS equality functions for Unchecked_Unions. (Make_Eq_Case): Rename formal parameter Node to E in function signature. Add formal parameter Discr to function signature. Discr is used to control the generated case statement for Unchecked_Union types. (Make_Eq_If): Rename formal parameter Node to E in function signature. * exp_ch4.adb (Build_Equality_Call): Implement equality calls for Unchecked_Unions. Check the body of the subprogram for details. (Expand_Composite_Equality): Augment composite type equality to include correct handling of Unchecked_Union components. (Expand_N_In): Add condition to detect illegal membership tests when the subtype mark is a constrained Unchecked_Union and the expression lacks inferable discriminants, and build a Raise_Program_Error node. (Expand_N_Op_Eq): Add function Has_Unconstrained_UU_Component. Used to detect types that contain components of unconstrained Unchecked_Union subtype. Add condition to detect equality between types that have an unconstrained Unchecked_Union component, and build a Raise_Program_Error node. Add condition to detect equality between Unchecked_Union types that lack inferable discriminants, and build a Raise_Program_Error node. Otherwise build a TSS equality function call. (Expand_N_Type_Conversion): Add condition to detect illegal conversions from a derived Unchecked_Union to an unconstrained non-Unchecked_Union with the operand lacking inferable discriminants, and build a Raise_ Program_Error node. (Expand_Record_Equality): Remove guard that prevents Unchecked_Union composite equality. (Has_Inferable_Discriminants): Implement new predicate for objects and expressions of Unchecked_Union type. Check the body of subprogram for details. (Has_Unconstrained_UU_Components): Add function Component_Is_Unconstrained_UU. It is used to detect whether a single component is of an unconstrained Unchecked_Union subtype. Add function Variant_Is_Unconstrained_UU. It is used to detect whether a single component inside a variant is of an unconstrained Unchecked_Union type. * exp_ch5.adb (Expand_Assign_Record): Add condition to copy the inferred discriminant values. Add condition to generate a case statement with an inferred discriminant as the switch. (Make_Component_List_Assign): Introduce a Boolean flag that determines the behaviour of the subprogram in the presence of an Unchecked_Union. Add condition to trigger the usage of the inferred discriminant value as the generated case statement switch. (Make_Field_Assign): Introduce a Boolean flag that determines the behaviour of the subprogram in the presence of an Unchecked_Union. Add condition to trigger the usage of the inferred discriminant value as the right-hand side of the generated assignment. * exp_ch6.adb (Expand_Call): Add condition to skip extra actual parameter generation when dealing with Unchecked_Unions. * checks.adb (Apply_Discriminant_Check): Do not apply discriminant checks for Unchecked_Unions. * einfo.ads: Update comment on usage of flag Has_Per_Object_Constraint * exp_attr.adb (Expand_N_Attribute_Reference): Produce Raise_Program_Error nodes for the execution of Read and Write attributes of Unchecked_Union types and the execution of Input and Output attributes of Unchecked_Union types that lack default discriminant values. * sem_prag.adb (Analyze_Pragma): Remodel the analysis of pragma Unchecked_Union. Add procedure Check_Component. It is used to inspect per-object constrained components of Unchecked_Unions for being Unchecked_Unions themselves. Add procedure Check_Variant. It is used to check individual components withing a variant. * sem_res.adb (Resolve_Comparison_Op): Remove guard that prevents comparison of Unchecked_Unions. (Resolve_Equality_OP): Remove guard that prevents equality between Unchecked_Unions. * sem_util.adb (Build_Component_Subtype): Add guard to prevent creation of component subtypes for Unchecked_Union components. (Get_Actual_Subtype): Add condition that returs the Unchecked_Union type since it is the actual subtype. * sem_ch12.adb (Instantiate_Type): Add condition to detect the correct pass of Unchecked_Union subtypes as generic actuals to formal types that lack known_discriminant_parts or that are derived Unchecked_Union types, and do nothing. In any other case, produce an error message. * sem_ch3.adb (Analyze_Component_Declaration): Add function Contains_POC. It determines whether a constraint uses the discriminant of an enclosing record type. Add condition to detect per-object constrained component and set the appropriate flag. (Derived_Type_Declaration): Remove guard that prevents derivation from Unchecked_Union types. (Process_Subtype): Remove quard that prevents the creation of Unchecked_ Union subtypes. * sem_ch4.adb (Analyze_Selected_Component): Correct the detection of references to Unchecked_Union discriminants. * sem_ch6.adb (Create_Extra_Formals): Add condition to skip extra formal generation when dealing with Unchecked_Unions. (Set_Actual_Subtypes): Add condition to prevent generation of actual subtypes for Unchecked_Unions. * sem_ch7.adb (Analyze_Package_Specification): Add procedure Inspect_Unchecked_Union_Completion. It is used to detect incorrect completions of discriminated partial views by Unchecked_Unions and produce an error message. 2004-08-09 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * trans.c (struct stmt_group): New field, GLOBAL. (global_stmt_group, gnu_elab_proc_decl, build_unit_elab): Deleted. (struct elab_info): New struct. (elab_info_list, gnu_elab_proc_stack): New variables. (Compilation_Unit_to_gnu): New procedure. (gigi): Call it and also handle elaboration procs we've saved. (gnat_init_stmt_group): Don't set global_stmt_group; instead initialize global field from parent. (gnat_to_gnu): Get decl from gnu_elab_proc_stack. (gnat_to_gnu, case N_Compilation_Unit): Call Compilation_Unit_to_gnu. (start_stmt_group): Initialize global field from parent. (add_decl_expr): Set to global for current statement group. (gnat_gimplify_expr, case NULL_EXPR): Add operand 0 to pre list, not post. * utils.c (global_bindings_p): True when no current_function_decl; no longer check current_binding_level. 2004-08-09 Ben Brosgol <brosgol@gnat.com> * xgnatugn.adb: Added logic to deal with @ifset/@ifclear for edition choice. * gnat_rm.texi, gnat_ugn.texi: Added edition conditionalization logic. From-SVN: r85714
2004-08-06utils.c (gnat_define_builtin): Remove second parameter of make_decl_rtl.Andreas Schwab1-2/+2
* utils.c (gnat_define_builtin): Remove second parameter of make_decl_rtl. (begin_subprog_body): Likewise. From-SVN: r85640
2004-08-05re PR c/14516 (-fleading-underscore does not work correctly for file static ↵Geoffrey Keating1-5/+5
variables) 2004-08-04 Geoffrey Keating <geoffk@apple.com> PR 14516 * c-common.c (c_expand_decl): Don't special-case static VAR_DECLs. * c-common.h (make_rtl_for_local_static): Delete. * c-decl.c (shadow_tag_warned): Clean up comment. (finish_decl): Clean up spacing. Use set_user_assembler_name when appropriate. Don't pass asmspec to rest_of_decl_compilation. * c-semantics.c (make_rtl_for_local_static): Delete. * expr.c (init_block_move_fn): Use set_user_assembler_name. (init_block_clear_fn): Likewise. * passes.c (rest_of_decl_compilation): Remove asmspec parameter, expect it to be in DECL_ASSEMBLER_NAME. Update callers in many files. * toplev.h (rest_of_decl_compilation): Remove asmspec parameter. * tree.h (make_decl_rtl): Remove second parameter. (set_user_assembler_name): New. * varasm.c (set_user_assembler_name): New. (make_decl_rtl): Remove second parameter. Update callers in many files. Index: cp/ChangeLog 2004-08-04 Geoffrey Keating <geoffk@apple.com> * decl.c (make_rtl_for_nonlocal_decl): Set DECL_ASSEMBLER_NAME rather than passing it as a parameter to rest_of_decl_compilation. * decl2.c (grokfield): Use set_user_assembler_name. From-SVN: r85593