aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/utils2.c
AgeCommit message (Collapse)AuthorFilesLines
2008-07-29Moved to gcc-interface.Arnaud Charlet1-2219/+0
From-SVN: r138260
2008-06-24utils2.c (known_alignment): Derive the alignment from pointed-to types only ↵Eric Botcazou1-29/+32
if it is otherwise unknown. * utils2.c (known_alignment): Derive the alignment from pointed-to types only if it is otherwise unknown. <INTEGER_CST>: Tidy. <MULT_EXPR>: Likewise. <POINTER_PLUS_EXPR>: If the alignment of the offset is unknown, use that of the base. From-SVN: r137081
2008-05-12* utils2.c (known_alignment, contains_save_expr_p)Tomas Bily1-9/+5
(gnat_mark_addressable): Use CASE_CONVERT. * decl.c (annotate_value): Likewise. * trans.c (maybe_stabilize_reference): Likewise. * utils2.c (build_binary_op): Use CONVERT_EXPR_P. * utils.c (rest_of_record_type_compilation): Likewise. * trans.c (protect_multiple_eval, Attribute_to_gnu) (protect_multiple_eval): Likewise. From-SVN: r135215
2008-05-03decl.c (maybe_pad_type): Try to get a form of the type with integral mode ↵Eric Botcazou1-9/+12
even if... * decl.c (maybe_pad_type): Try to get a form of the type with integral mode even if the alignment is not a factor of the original size. But make sure to create the inner field with the original size. Reorder. * trans.c (addressable_p) <COMPONENT_REF>: Treat the field of a padding record as always addressable. * utils.c (convert): Deal specially with conversions between original and packable versions of a record type. * utils2.c (build_binary_op) <MODIFY_EXPR>: Be more restrictive when recognizing an assignment between padded objects. From-SVN: r134916
2008-04-23tree-cfg.c (verify_expr): Check with is_gimple_address.Paolo Bonzini1-2/+1
2008-04-23 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (verify_expr): Check with is_gimple_address. Don't check TREE_INVARIANT. * tree-gimple.c (is_gimple_address): New. (is_gimple_invariant_address): Simplify using decl_address_invariant_p. * tree-gimple.h (is_gimple_address): New. * tree.h (decl_address_invariant_p): New. * tree.c (make_node_stat): Don't set TREE_INVARIANT. (build_string): Likewise. (decl_address_invariant_p): New, from is_gimple_invariant_address. (tree_invariant_p_1): Likewise. (save_expr): Use it. (tree_invariant_p): New. (skip_simple_arithmetic): Use it. (stabilize_reference_1): Use it. (recompute_tree_invariant_for_addr_expr): Don't update TREE_INVARIANT, simplify. (build1_stat): Drop code to compute TREE_INVARIANT. (build2_stat): Drop code to compute TREE_INVARIANT. (build3_stat): Drop code to compute TREE_INVARIANT. (build4_stat): Drop code to compute TREE_INVARIANT. (build5_stat): Drop code to compute TREE_INVARIANT. (build7_stat): Drop code to compute TREE_INVARIANT. (merge_dllimport_decl_attributes): Don't mention TREE_INVARIANT. * tree.h (struct tree_base): Remove invariant_flag. (TREE_INVARIANT): Remove. * builtins.c (build_string_literal): Don't set TREE_INVARIANT. (fold_builtin_expect): Check TREE_CONSTANT. * tree-ssa-ccp.c (fold_stmt_r): Adjust comment. * c-tree.h (c_expr_to_decl): Drop third parameter. * c-typeck.c (build_external_ref): Don't set TREE_INVARIANT. (build_c_cast): Don't set TREE_INVARIANT. (pop_init_level): Don't set TREE_INVARIANT. (c_objc_common_truthvalue_conversion): Don't set TREE_INVARIANT. * gimplify.c (gimplify_init_ctor_preeval): Add assertion, test TREE_CONSTANT. (gimplify_init_constructor): Don't set TREE_INVARIANT. (gimplify_addr_expr): Adjust comment. * tree-mudflap.c (mf_build_string): * print-tree.c (print_node): Don't print TREE_INVARIANT. * tree-nested.c (convert_nonlocal_reference): Adjust comment. * c-common.c (fix_string_type): Don't set TREE_INVARIANT. * langhooks-def.h (lhd_expr_to_decl): Drop third parameter. * langhooks.c (lhd_expr_to_decl): Drop third parameter. * langhooks.h (struct lang_hooks): Drop third parameter from expr_to_decl. java: 2008-04-23 Paolo Bonzini <bonzini@gnu.org> * class.c (build_utf8_ref): Don't set TREE_INVARIANT. (build_classdollar_field): Don't set TREE_INVARIANT. (get_dispatch_table): Don't set TREE_INVARIANT. (make_class_data): Don't set TREE_INVARIANT. (build_symbol_entry): Don't set TREE_INVARIANT. (emit_symbol_table): Don't set TREE_INVARIANT. * constants.c (build_constant_data_ref): Don't set TREE_INVARIANT. (build_ref_from_constant_pool): Don't set TREE_INVARIANT. * resource.c (compile_resource_data): Don't set TREE_INVARIANT. * expr.c (cache_cpool_data_ref): Don't set TREE_INVARIANT. objc: 2008-04-23 Paolo Bonzini <bonzini@gnu.org> * objc-act.c (objc_build_string_object): Don't set TREE_INVARIANT. cp: 2008-04-23 Paolo Bonzini <bonzini@gnu.org> * typeck.c (get_member_function_from_ptrfunc): Don't set TREE_INVARIANT. (build_ptrmemfunc1): Don't set TREE_INVARIANT. * init.c (build_zero_init): Don't set TREE_INVARIANT. * class.c (build_base_path): Don't set TREE_INVARIANT. (build_vtbl_ref_1): Don't set TREE_INVARIANT. (build_vtbl_initializer): Don't set TREE_INVARIANT. * decl.c (build_enumerator): Don't set TREE_INVARIANT. * rtti.c (tinfo_base_init): Don't set TREE_INVARIANT. (generic_initializer): Don't set TREE_INVARIANT. (ptr_initializer): Don't set TREE_INVARIANT. (ptm_initializer): Don't set TREE_INVARIANT. (class_initializer): Don't set TREE_INVARIANT. * typeck2.c (process_init_constructor): Don't set TREE_INVARIANT. * pt.c (push_inline_template_parms_recursive): Don't set TREE_INVARIANT. (build_template_parm_index): Don't set TREE_INVARIANT. (reduce_template_parm_level): Don't set TREE_INVARIANT. (process_template_parm): Don't set TREE_INVARIANT. ada: 2008-04-23 Paolo Bonzini <bonzini@gnu.org> * trans.c (Attribute_to_gnu): Don't set TREE_INVARIANT. (call_to_gnu): Don't set TREE_INVARIANT. * utils2.c (gnat_build_constructor): Don't set TREE_INVARIANT. fortran: 2008-04-23 Paolo Bonzini <bonzini@gnu.org> * trans-expr.c (gfc_conv_structure): Don't set TREE_INVARIANT. * trans-array.c (gfc_build_null_descriptor): Don't set TREE_INVARIANT. (gfc_trans_array_constructor_value): Don't set TREE_INVARIANT. (gfc_build_constant_array_constructor): Don't set TREE_INVARIANT. (gfc_conv_array_initializer): Don't set TREE_INVARIANT. * trans-common.c (get_init_field): Don't set TREE_INVARIANT. (create_common): Don't set TREE_INVARIANT. * trans-stmt.c (gfc_trans_character_select): Don't set TREE_INVARIANT. * trans-decl.c (gfc_generate_function_code): Don't set TREE_INVARIANT. From-SVN: r134599
2008-04-20decl.c (gnat_to_gnu_entity): Also promote the alignment of constant objects, ↵Eric Botcazou1-6/+9
but not exceptions. * decl.c (gnat_to_gnu_entity) <object>: Also promote the alignment of constant objects, but not exceptions. * trans.c (add_decl_expr): Use gnat_types_compatible_p for type compatibility test. * utils.c (create_var_decl_1): Likewise. * utils2.c (build_binary_op) <MODIFY_EXPR>: Also use the padded view of the type when copying to padded object and the source is a constructor. From-SVN: r134483
2008-04-15ada-tree.h (DECL_BY_COMPONENT_PTR_P): Use DECL_LANG_FLAG_3.Eric Botcazou1-11/+26
* ada-tree.h (DECL_BY_COMPONENT_PTR_P): Use DECL_LANG_FLAG_3. * decl.c (gnat_to_gnu_entity) <object>: Call maybe_pad_type only if a size or alignment is specified. Do not take into account alignment promotions for the computation of the object's size. <type>: Call maybe_pad_type only if a size or alignment is specified. (maybe_pad_type): Really reuse the RM_Size of the original type if requested. * trans.c (Attribute_to_gnu): Fix a couple of nits. * utils2.c (build_binary_op) <MODIFY_EXPR>: Merge related conditional statements. Use the padded view of the type when copying between padded objects of the same underlying type. From-SVN: r134310
2008-04-13sfn_scan.adb, [...]: Fix comment typos.Ralf Wildenhues1-1/+1
gcc/ada/ * sfn_scan.adb, sfn_scan.ads, sinfo.ads, sinput-d.ads, sinput-l.adb, sinput-l.ads, sinput.ads, snames.ads, sprint.adb, stand.ads, stringt.ads, styleg.adb, styleg.ads, stylesw.adb, stylesw.ads, switch.ads, sysdep.c, table.adb, table.ads, targparm.ads, tb-gcc.c, tbuild.ads, tracebak.c, trans.c, tree_io.adb, treepr.adb, types.adb, types.ads, uintp.adb, uintp.ads, utils.c, utils2.c, validsw.ads, vms_conv.adb, vms_conv.ads, vms_data.ads, widechar.adb, widechar.ads, xeinfo.adb, xgnatugn.adb, xr_tabls.adb, xr_tabls.ads, xref_lib.adb, xref_lib.ads, xsinfo.adb: Fix comment typos. From-SVN: r134243
2008-04-09decl.c (validate_size): Set minimum size for fat pointers same as access types.Doug Rupp1-1/+8
2008-04-09 Doug Rupp <rupp@adacore.com> * decl.c (validate_size): Set minimum size for fat pointers same as access types. Code clean ups. * gmem.c (xstrdup32): New macro for 32bit dup on VMS, noop otherwise (__gnat_gmem_a2l_initialize): Dup exename into 32 bit memory on VMS * s-auxdec-vms_64.ads, s-auxdec.ads (Short_Address_Size): New constant * s-crtl.ads (malloc32) New function, alias for malloc (realloc32) New function, alias for realloc * socket.c (__gnat_new_socket_set): Malloc fd_set in 32 bits on VMS * utils2.c (build_call_alloc_dealloc): Return call to short malloc if allocator size is 32 and default pointer size is 64. (find_common_type): Document assumption on t1/t2 vs lhs/rhs. Force use of lhs type if smaller, whatever the modes. * gigi.h (malloc32_decl): New macro definition * utils.c (init_gigi_decls): New malloc32_decl Various code clean ups. * s-asthan-vms-alpha.adb (Process_AST.To_Address): Unchecked convert to Task_Address vice System.Address. * s-taspri-vms.ads: Import System.Aux_DEC (Task_Address): New subtype of System.Aux_DEC.Short_Address (Task_Address_Size): New constant size of System.Aux_DEC.Short_Address * s-asthan-vms-alpha.adb (Process_AST.To_Address): Unchecked convert to Task_Address vice System.Address. * s-inmaop-vms.adb: Import System.Task_Primitives (To_Address): Unchecked convert to Task_Address vice System.Address * s-taprop-vms.adb (Timed_Delay): Always set the timer even if delay expires now. (To_Task_ID) Unchecked convert from Task_Adddress vice System.Address (To_Address) Unchecked convert to Task_Address vice System.Address * s-tpopde-vms.adb: Remove unnecessary warning pragmas * g-socthi-vms.ads: Add 32bit size clauses on socket access types. From-SVN: r134131
2008-04-08decl.c (prepend_attributes): Fix typo.Eric Botcazou1-1/+1
* decl.c (prepend_attributes): Fix typo. * trans.c (Pragma_to_gnu): Likewise. * utils.c (gnat_genericize): Likewise. From-SVN: r134094
2008-04-08decl.c (gnat_to_gnu_entity): If -gnatd.a and not optimizing alignment for ↵Eric Botcazou1-24/+21
space... * decl.c (gnat_to_gnu_entity) <object>: If -gnatd.a and not optimizing alignment for space, promote the alignment of non-scalar variables with no size and alignment. * gigi.h (gnat_types_compatible_p): Declare. * misc.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Set to above predicate. * trans.c (gnat_to_gnu): Revert revision 129339 change. Minor cleanup. * utils.c (gnat_types_compatible_p) : New predicate. (convert): Use it throughout to test for cases where a mere view conversion is sufficient. * utils2.c (build_binary_op): Minor tweaks. (build_unary_op): Likewise. From-SVN: r134092
2008-04-07fold-const.c (fold): New case.Eric Botcazou1-2/+2
* fold-const.c (fold) <ARRAY_REF>: New case. Try to fold constant reference in constructor with non self-referential type. ada/ * utils2.c (build_binary_op): Fold ARRAY_REF and ARRAY_RANGE_REF too. From-SVN: r133977
2008-03-31utils2.c (find_common_type): Document assumption on t1/t2 vs lhs/rhs.Olivier Hainque1-20/+36
2008-03-31 Olivier Hainque <hainque@adacore.com> Eric Botcazou <botcazou@adacore.com> ada/ * utils2.c (find_common_type): Document assumption on t1/t2 vs lhs/rhs. Force use of lhs type if smaller, whatever the modes. testsuite/ * gnat.dg/assign_from_packed.adb: New testcase. Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com> From-SVN: r133757
2008-01-21Update copyright year.Eric Botcazou1-1/+1
From-SVN: r131693
2008-01-21trans.c (gnat_to_gnu): Use POINTER_PLUS_EXPR in pointer arithmetics.Eric Botcazou1-3/+2
* trans.c (gnat_to_gnu) <N_Free_Statement>: Use POINTER_PLUS_EXPR in pointer arithmetics. * utils2.c (build_allocator): Likewise. From-SVN: r131692
2007-11-16utils2.c (build_call_alloc_dealloc): Move the code retrieving an allocator ↵Olivier Hainque1-33/+1
return value from a super-aligned address... 2007-11-16 Olivier Hainque <hainque@adacore.com> ada/ * utils2.c (build_call_alloc_dealloc) <if gnu_obj>: Move the code retrieving an allocator return value from a super-aligned address from here to ... * trans.c (gnat_to_gnu) <case N_Free_Statement>: ... here, and don't expect a super-aligned address for a fat or thin pointer. testsuite/ * gnat.dg/release_unc_maxalign.adb: New test. From-SVN: r130221
2007-09-22utils2.c (build_unary_op): Propagate the TYPE_REF_CAN_ALIAS_ALL flag to the ↵Eric Botcazou1-0/+19
result. * utils2.c (build_unary_op) <ADDR_EXPR> [INDIRECT_REF]: Propagate the TYPE_REF_CAN_ALIAS_ALL flag to the result. From-SVN: r128669
2007-09-03Make-lang.in: Change copyright header to refer to version 3 of the GNU ↵Nick Clifton1-5/+4
General Public License... * Make-lang.in: Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page. * ada-tree.def, nmake.adt, nlists.h, snames.h, utils.c, Makefile.rtl, Makefile.in, config-lang.in, uintp.h, urealp.h, namet.h, decl.c, utils2.c, lang.opt, elists.h, atree.h, types.h, treeprs.adt, lang-specs.h, cuintp.c, stringt.h, gnatbl.c: Likewise. From-SVN: r128038
2007-08-14re PR ada/19037 (constant renaming creates new constant)Olivier Hainque1-20/+62
2007-08-14 Olivier Hainque <hainque@adacore.com> Eric Botcazou <ebotcazou@adacore.com> * targtyps.c (get_target_maximum_default_alignment): New function. Maximum alignment that the compiler might choose by default for a type or object. (get_target_default_allocator_alignment): New function. Alignment known to be honored by the target default allocator. (get_target_maximum_allowed_alignment): New function. Maximum alignment we might accept for any type or object on the target. (get_target_maximum_alignment): Now synonym of maximum_default_alignment * gigi.h (get_target_maximum_default_alignment): Declare new function. (get_target_default_allocator_alignment): Likewise. (get_target_maximum_allowed_alignment): Likewise. PR ada/19037 * decl.c (gnat_to_gnu_entity) <object>: Except for the renaming of the result of a function call, first try to use a stabilized reference for a constant renaming too. (validate_alignment): Use target_maximum_allowed_alignment instead of MAX_OFILE_ALIGNMENT as the upper bound to what we accept. (gnat_to_gnu_entity): Use common nodes directly. (gnat_to_gnu_entity) <object>: Pick the values of the type to annotate alignment and size for the object. (lvalue_required_p): Handle N_Parameter_Association like N_Function_Call and N_Procedure_Call_Statement. (takes_address): Rename to lvalue_required_p, add third parameter 'aliased' and adjust recursive calls. <N_Indexed_Component>: Update 'aliased' from the array type. <N_Selected_Component>: New case. <N_Object_Renaming_Declaration>: New Likewise. (Identifier_to_gnu): Adjust for above changes. (maybe_stabilize_reference) <CONST_DECL>: New case. * utils2.c (build_binary_op) <ARRAY_RANGE_REF>: Look through conversion between type variants. (build_simple_component_ref): Likewise. (build_call_alloc_dealloc): Use target_default_allocator_alignment instead of BIGGEST_ALIGNMENT as the threshold to trigger the super aligning type circuitry for allocations from the default storage pool. (build_allocator): Likewise. (build_simple_component_ref): Manually fold the reference for a constructor if the record type contains a template. * utils.c (value_zerop): Delete. (gnat_init_decl_processing): Emit debug info for common types. (rest_of_record_type_compilation): If a union contains a field with a non-constant qualifier, treat it as variable-sized. (finish_record_type): Give the stub TYPE_DECL a name. (rest_of_record_type_compilation): Likewise. (convert) <CONSTRUCTOR>: New case. Build a new constructor if types are equivalent array types. (create_field_decl): Claim fields of any ARRAY_TYPE are addressable, even if the type is not passed by reference. (static_ctors, static_dtors): Delete. (end_subprog_body): Do not record constructors and destructors. (build_global_cdtor): Delete. (gnat_write_global_declarations): Do not call build_global_cdtor. * lang-specs.h: If TARGET_VXWORKS_RTP is defined, append -mrtp when -fRTS=rtp is specified. If CONFIG_DUAL_EXCEPTIONS is 1, append -fsjlj when -fRTS=sjlj is specified. * misc.c (gnat_init_gcc_eh): Use __gnat_eh_personality_sj for the name of the personality function with SJLJ exceptions. * raise-gcc.c (PERSONALITY_FUNCTION): Use __gnat_eh_personality_sj for the name of the personality function with SJLJ exceptions. From-SVN: r127422
2007-08-11decl.c, utils2.c: Fix whitespace in last change.Kaveh R. Ghazi1-3/+4
* decl.c, utils2.c: Fix whitespace in last change. From-SVN: r127359
2007-08-11decl.c (compare_field_bitpos): Constify.Kaveh R. Ghazi1-6/+5
* decl.c (compare_field_bitpos): Constify. * utils2.c (compare_elmt_bitpos): Likewise. From-SVN: r127358
2007-06-15[multiple changes]Andrew Pinski1-2/+9
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> Zdenek Dvorak <dvorakz@suse.cz> Richard Guenther <rguenther@suse.de> Kaz Kojima <kkojima@gcc.gnu.org> * tree-vrp.c (compare_values_warnv): Convert val2 to the type of val1. (extract_range_from_assert): Create POINTER_PLUS_EXPR for pointer types. (extract_range_from_binary_expr): Handle only POINTER_PLUS_EXPR, MIN_EXPR, and MAX_EXPR for pointer types. * doc/c-tree.texi (POINTER_PLUS_EXPR): Document. * tree-ssa-loop-niter.c (split_to_var_and_offset): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (number_of_iterations_lt_to_ne): For pointer types, use sizetype when creating MINUS_EXPR/PLUS_EXPRs. (assert_loop_rolls_lt): For pointer types, use sizetype when creating MINUS_EXPR/PLUS_EXPRs. (number_of_iterations_le): Likewise. (expand_simple_operations): POINTER_PLUS_EXPR are simple also. (derive_constant_upper_bound): Handle POINTER_PLUS_EXPR just like PLUS_EXPR and MINUS_EXPR. * tree-pretty-print.c (dump_generic_node): Handle POINTER_PLUS_EXPR. (op_prio): Likewise. (op_symbol_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. * tree-ssa-loop-manip.c (create_iv): Handle pointer base specially. * tree-tailcall.c (process_assignment): Mention POINTER_PLUS_EXPR in a TODO comment. * tree.c (build2_stat): Assert when trying to use PLUS_EXPR or MINUS_EXPR with a pointer. Also assert for POINTER_PLUS_EXPR not used with a pointer and an integer type. * tree-scalar-evolution.c (add_to_evolution_1): Convert the increment using chrec_convert_rhs instead of chrec_convert. (follow_ssa_edge_in_rhs): Handle POINTER_PLUS_EXPR like PLUS_EXPR except for the right hand side's type will be sizetype. (interpret_rhs_modify_stmt): Handle POINTER_PLUS_EXPR. (fold_used_pointer_cast): Kill. (pointer_offset_p): Kill. (fold_used_pointer): Kill. (pointer_used_p): Kill. (analyze_scalar_evolution_1 <case GIMPLE_MODIFY_STMT>): Don't call fold_used_pointer. (instantiate_parameters_1): Convert the increment using chrec_convert_rhs instead of chrec_convert. Handle POINTER_PLUS_EXPR as PLUS_EXPR. * builtins.c (get_pointer_alignment): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (expand_builtin_strcat): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (std_gimplify_va_arg_expr): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_strstr): Likewise. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (expand_builtin_memory_chk): Likewise. (fold_builtin_memory_chk): Likewise. (std_expand_builtin_va_start): Use sizetype for the call to make_tree and then convert to the pointer type. (fold_builtin_memchr): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for adding to a pointer. (std_gimplify_va_arg_expr): Use fold_build2 for the creating of POINTER_PLUS_EXPR. For the BIT_AND_EXPR, cast the operands to sizetype first and then cast the BIT_AND_EXPR back to the pointer type. * fold-const.c (build_range_check): Handle pointer types specially. (extract_array_ref): Look for POINTER_PLUS_EXPR instead of PLUS_EXPR's. Make sure the offset is converted to sizetype. (try_move_mult_to_index): Strip the NOPs from the offset. Remove code argument and replace all uses with PLUS_EXPR. (fold_to_nonsharp_ineq_using_bound): Handle pointer types specially. Don't use a pointer type for MINUS_EXPR. (fold_unary): Handle for (T1)(X op Y), only p+ as that is the only as that can be handled for binary operators now. (fold_binary <case POINTER_PLUS_EXPR>): Add folding of POINTER_PLUS_EXPR. <case PLUS_EXPR>: Add folding of PTR+INT into PTR p+ INT. Don't call try_move_mult_to_index. <case MINUS_EXPR>: Fold (PTR0 p+ A) - (PTR1 p+ B) into (PTR0 - PTR1) + (A - B). Fold (PTR0 p+ A) - PTR1 into (PTR0 - PTR1) + A iff (PTR0 - PTR1) simplifies. Don't call try_move_mult_to_index. (tree_expr_nonnegative_warnv_p): Handle POINTER_PLUS_EXPR. (tree_expr_nonzero_p): Likewise. (fold_indirect_ref_1): Look at POINTER_PLUS_EXPR instead of PLUS_EXPR for the complex expression folding. * tree-chrec.c (chrec_fold_plus_poly_poly): If the first chrec is a pointer type, then the second should be sizetype and not the first's type. For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_fold_plus_1): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_fold_plus): For pointer types, use POINTER_PLUS_EXPR instead of PLUS_EXPR. When either operand is zero, convert the other operand. (chrec_apply): Use chrec_convert_rhs on the argument x instead of chrec_convert. (reset_evolution_in_loop): For pointer types, the new_evol should be sizetype. (convert_affine_scev): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_convert_rhs): New function. (chrec_convert_aggressive): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. * tree-chrec.h (chrec_convert_rhs): New prototype. (build_polynomial_chrec): For pointer types, the right hand * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Look for POINTER_PLUS_EXPR instead of PLUS_EXPR's. Remove subtraction case as it is always addition now. Make sure the offset is converted to sizetype. (fold_stmt_r): Don't handle PLUS_EXPR/MINUS_EXPR specially. Handle POINTER_PLUS_EXPR like PLUS_EXPR was handled before. * tree-ssa-loop-ivopts.c (determine_base_object): Abort for PLUS_EXPR in pointer type. Handle POINTER_PLUS_EXPR. (tree_to_aff_combination): Likewise. (force_expr_to_var_cost): Likewise. (force_expr_to_var_cost): Likewise. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * c-format.c (check_format_arg): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR of pointer types. * tree-stdarg.c (va_list_counter_bump): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (check_va_list_escapes): Likewise. (check_all_va_list_escapes): Likewise. * dwarf2out.c (loc_descriptor_from_tree_1): Handle POINT_PLUS_EXPR as a PLUS_EXPR. * expr.c (expand_expr_real_1): Handle POINTER_PLUS_EXPR. (string_constant): Likewise. * tree-ssa-address.c (tree_mem_ref_addr): When adding the offset to the base, use POINTER_PLUS_EXPR. (add_to_parts): Convert the index to sizetype. (create_mem_ref): Create A POINTER_PLUS_EXPR for the one case. * matrix-reorg.c (collect_data_for_malloc_call): Stmt will now only be either INDIRECT_REF and POINTER_PLUS_EXPR. Offset only holds something for PLUS_EXPR. (ssa_accessed_in_tree): Handle POINTER_PLUS_EXPR just as a PLUS_EXPR. (analyze_transpose): POINTER_PLUS_EXPR will only show up now and not PLUS_EXPR. (analyze_accesses_for_modify_stmt): Likewise. Remove comment about the type being integral type as it is wrong now. (can_calculate_expr_before_stmt): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (transform_access_sites): POINTER_PLUS_EXPR will only show up now and not PLUS_EXPR. Correct the type which the artimentic is done in (is now sizetype). Reindent one loop. * tree-data-ref.c (split_constant_offset): Handle POINTER_PLUS_EXPR * tree-affine.c (tree_to_aff_combination): Likewise. * c-typeck.c (build_unary_op): For pointers create the increment as a sizetype. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * gimplify.c (gimplify_self_mod_expr): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (gimplify_omp_atomic_fetch_op): Handle POINTER_PLUS_EXPR. * tree.def (POINTER_PLUS_EXPR): New tree code. * tree-predcom.c (ref_at_iteration): If we have a pointer type do the multiplication in sizetype. * tree-mudflap.c (mf_xform_derefs_1): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-ssa-forwprop.c (forward_propagate_addr_into_variable_array_index): Don't expect there to be a cast for the index as that does not exist anymore. (forward_propagate_addr_expr_1): Check for POINTER_PLUS_EXPR instead of PLUS_EXPR. Don't check for the first operand of the POINTER_PLUS_EXPR was the index as it cannot be. Call forward_propagate_addr_into_variable_array_index with the SSA_NAME instead of the statement. * varasm.c (const_hash_1): Handle POINTER_PLUS_EXPR. (compare_constant): Likewise. (copy_constant): Likewise. (compute_reloc_for_constant): Likewise. (output_addressed_constants): Likewise. (initializer_constant_valid_p): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion_1): Convert the MIN/MAX of the inner type to the outer type before comparing them. * tree-ssa-loop-prefetch.c (idx_analyze_ref): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (issue_prefetch_ref): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-inline.c (estimate_num_insns_1): Handle POINTER_PLUS_EXPR. * tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (bump_vector_ptr): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for the pointer increment statement. (vect_update_ivs_after_vectorizer): For pointer types, create POINTER_PLUS_EXPR instead of PLUS_EXPR and also create MULT_EXPR in sizetype. (vect_gen_niters_for_prolog_loop): Add a cast when creating byte_misalign. * tree-object-size.c (plus_expr_object_size): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. Removing all the extra code which is trying to figure out which side is a pointer and is the index. (check_for_plus_in_loops_1): Likewise. (check_for_plus_in_loops): Likewise. * c-common.c (pointer_int_sum): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-ssa-structalias.c (handle_ptr_arith): Handle only POINTER_PLUS_EXPR. Removing all the extra code which is trying to figure out which side is a pointer and is the index. * tree-cfg.c (verify_expr): Add extra checking for pointers and PLUS_EXPR and MINUS_EXPR. Also add checking to make sure the operands of POINTER_PLUS_EXPR are correct. * config/frv/frv.c (frv_expand_builtin_va_start): Use sizetype with make_tree, instead of a pointer type. * config/s390/s390.c (s390_va_start): Use POINTER_PLUS_EXPR for pointers instead of PLUS_EXPR. (s390_gimplify_va_arg): Likewise. * config/spu/spu.c (spu_va_start): Create POINTER_PLUS_EXPR instead of PLUS_EXPR when doing addition on pointer types. Use sizetype for the second operand. (spu_gimplify_va_arg_expr): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use POINTER_PLUS_EXPR instead of PLUS_EXPR when the operand was a pointer. Don't create a BIT_AND_EXPR for pointer types. * config/i386/i386.c (ix86_va_start): Use POINTER_PLUS_EXPR for the pointer addition and also use size_int/sizetype for the offset. (ix86_gimplify_va_arg): Likewise. Perform BIT_AND_EXPR on sizetype arguments. * config/sh/sh.c (sh_va_start): Call make_tree with sizetype and convert its result to a pointer type. Use POINTER_PLUS_EXPR for the pointer additions and also use size_int for the offsets. (sh_gimplify_va_arg_expr): Use POINTER_PLUS_EXPR for the pointer additions and also use size_int for the offsets. Perform BIT_AND_EXPR on sizetype arguments. * config/ia64/ia64.c (ia64_gimplify_va_arg): Use POINTER_PLUS_EXPR for pointers and create the BIT_AND_EXPR in sizetype. * config/rs6000/rs6000.c (rs6000_va_start): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition. (rs6000_va_start): Likewise. Also use sizetype for the offset. * config/pa/pa.c (reloc_needed): Handle POINTER_PLUS_EXPR as PLUS_EXPR/MINUS_EXPR. (hppa_gimplify_va_arg_expr): Don't create MINUS_EXPR or PLUS_EXPR for pointers, instead use POINTER_PLUS_EXPR. Don't use BIT_AND_EXPR on a pointer type, convert the expression to sizetype first. * config/mips/mips.c (mips_va_start): Use POINTER_PLUS_EXPR for pointers. (mips_gimplify_va_arg_expr): Likewise. Don't create BIT_AND_EXPR in a pointer type. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition. * trans-expr.c (gfc_trans_string_copy): Create POINTER_PLUS_EXPR instead of a PLUS_EXPR for pointer types. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * typeck.c (build_binary_op): For templates build the expression in pieces to avoid the assert in build2_stat. (get_member_function_from_ptrfunc): Change over to using POINTER_PLUS_EXPR and convert the second operand to sizetype. * typeck2.c (build_m_component_ref): Likewise. * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_vec_delete): Likewise. * class.c (build_base_path): Likewise. (build_base_path): Likewise. (convert_to_base_statically): Likewise. (fixed_type_or_null): Handle POINTER_PLUS_EXPR. (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * call.c (build_special_member_call): Likewise. * rtti.c (build_headof): Likewise. Use sizetype instead of ptrdiff_type_node. (tinfo_base_init): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * except.c (expand_start_catch_block): Do a NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert PLUS_EXPR on pointer types over to use POINTER_PLUS_EXPR and remove the conversion to the pointer types. * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for adding to a pointer type. Use size_int instead of ssize_int. Convert the index to sizetype before adding it to the pointer. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * trans.c (Attribute_to_gnu): When subtracting an offset from a pointer, use POINTER_PLUS_EXPR with NEGATE_EXPR instead of MINUS_EXPR. (gnat_to_gnu): Likewise. * utils.c (convert): When converting between thin pointers, use POINTER_PLUS_EXPR and sizetype for the offset. * utils2.c (known_alignment): POINTER_PLUS_EXPR have the same semantics as PLUS_EXPR for alignment. (build_binary_op): Add support for the semantics of POINTER_PLUS_EXPR's operands. When adding an offset to a pointer, use POINTER_PLUS_EXPR. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * class.c (make_class_data): Build the index in sizetype. Use POINTER_PLUS_EXPR instead of PLUS_EXPR when adding to a pointer type. (build_symbol_entry): Likewise. * expr.c (build_java_arrayaccess): Likewise. (build_field_ref): Likewise. (build_known_method_ref): Likewise. (build_invokevirtual): Likewise. * except.c (build_exception_object_ref): Do a NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/32225 * gcc.c-torture/compile/20070605-1.c: New test. * gcc.c-torture/compile/20070603-1.c: New testcase. * gcc.c-torture/compile/20070603-2.c: New testcase. * gcc.c-torture/compile/20070531-1.c: New test. PR tree-opt/32167 * gcc.c-torture/compile/20070531-2.c: New test. PR tree-opt/32144 * gcc.c-torture/compile/20070529-1.c: New test. PR tree-opt/32145 * gcc.c-torture/compile/20070529-2.c: New test. PR tree-opt/32015 * gcc.c-torture/compile/20070520-1.c: New test. * g++.dg/ext/java-1.C: New test. * gcc.dg/vect/vect-106.c: We are now able to vectorize two loops instead of one. Remove the "can't determine dependence" check. * gcc.dg/tree-ssa/20030815-1.c: Remove testcase which is no longer needed as the cast is gone in the first place. * gcc.dg/max-1.c: Change local variable a to be a global one. * gcc.dg/tree-ssa/ssa-pre-8.c: Update testcase since we don't have a cast which is PREd. From-SVN: r125755
2007-06-06utils2.c (build_allocator): Provide the extra arguments to ↵Olivier Hainque1-50/+143
make_aligning_type for super-aligned objects... 2007-04-20 Olivier Hainque <hainque@adacore.com> Eric Botcazou <ebotcazou@adacore.com> * utils2.c (build_allocator): Provide the extra arguments to make_aligning_type for super-aligned objects allocated from the default pool. Leave enough room for a pointer before the aligning field, and store the system's allocator return value there. (build_call_alloc_dealloc): When releasing a super-aligned object, retrieve the system's allocator return value from where build_allocator has stored it, just ahead of the adjusted address we are passed. (build_call_raise): Handle properly the generation of line numbers when the node is marked No_Location. (compare_elmt_bitpos): Use tree_int_cst_compare. Stabilize the sort by using DECL_UID on ties. (build_binary_op) <EQ_EXPR>: Accept fat pointer types with the same main variant. (build_call_raise): Handle converting exception into goto; support new argument KIND. (build_component_ref): Add new arg to build_call_raise. From-SVN: r125383
2007-04-06utils2.c (known_alignment): Handle COMPOUND_EXPR, COND_EXPR and BIT_AND_EXPR.Olivier Hainque1-0/+21
2007-04-06 Olivier Hainque <hainque@adacore.com> * utils2.c (known_alignment): Handle COMPOUND_EXPR, COND_EXPR and BIT_AND_EXPR. Handle also VIEW_CONVERT_EXPR, as the other conversion opcodes. From-SVN: r123604
2007-03-09cuintp.c (UI_To_gnu): Use fold_buildN calls instead of calling fold with the ↵Roger Sayle1-71/+77
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-50/+28
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-02-03* misc.c, utils2.c: Fix comment typos.Kazu Hirata1-1/+1
From-SVN: r121547
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-09-29decl.c (gnat_to_gnu_entity): Do not set "const" flag on "pure" Ada ↵Eric Botcazou1-1/+2
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-03-04gigi.h (get_ada_base_type): Delete.Eric Botcazou1-13/+0
* gigi.h (get_ada_base_type): Delete. * utils2.c (get_ada_base_type): Likewise. * trans.c (convert_with_check): Operate in the real base type. From-SVN: r111711
2006-02-17re PR ada/26315 (ACATS failures c43208b c85006a c85006d cd92001)Eric Botcazou1-2/+3
2006-02-17 Eric Botcazou <botcazou@adacore.com> PR ada/26315 * utils2.c (find_common_type): If both input types are BLKmode and have the same constant size, keep using the first one. * bindgen.adb: (Gen_Versions_Ada): Revert previous workaround. * decl.c (gnat_to_gnu_entity): Only check TREE_OVERFLOW for a constant. * misc.c (gnat_handle_option): New case for -Woverlength-strings. From-SVN: r111183
2006-02-15re PR ada/26096 (Ada bootstrap fails in g-alleve.adb)Richard Kenner1-4/+9
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-09trans.c (tree_transform, emit_check): Adjust calls to build_call_raise, ↵Olivier Hainque1-12/+39
passing the now expected GNAT_NODE argument. 2005-12-05 Olivier Hainque <hainque@adacore.com> Eric Botcazou <ebotcazou@adacore.com> * trans.c (tree_transform, emit_check): Adjust calls to build_call_raise, passing the now expected GNAT_NODE argument. * gigi.h (build_call_raise): Add a GNAT_NODE argument to convey better source line information than what the current global locus indicates when appropriate. * utils2.c (build_simple_component_ref): Return 0 if the offset of the field has overflowed. (build_call_raise): Add a GNAT_NODE argument to convey better source line information than what the current global locus indicates when appropriate. (build_component_ref): Adjust call to build_call_raise. From-SVN: r108290
2005-11-15decl.c: Factor common code to build a storage type for an unconstrained ↵Thomas Quinot1-65/+62
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-10-21re PR ada/21937 (Member record alignment triggers an ICE)Eric Botcazou1-1/+43
PR ada/21937 PR ada/22328 PR ada/22381 PR ada/22383 PR ada/22419 PR ada/22420 * utils2.c (build_return_expr): New helper function. * gigi.h (build_return_expr): Declare it. * trans.c (Subprogram_Body_to_gnu): Use build_return_expr instead of manually building the RETURN_EXPR tree. (call_to_gnu): Pass MODIFY_EXPR through build_binary_op. (gnat_to_gnu) <N_Return_Statement>: Pass MODIFY_EXPR through build_binary_op for the "target pointer" case. �Use build_return_expr instead of manually building the RETURN_EXPR tree. From-SVN: r105741
2005-07-20Make CONSTRUCTOR use VEC to store initializers.Giovanni Bajo1-11/+16
* 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-01Update FSF addressR. Kelley Cook1-2/+2
From-SVN: r101492
2005-06-16fe.h: Add entry for Opt.Exception_Locations_Suppressed so that gigi can ↵Jose Ruiz1-5/+10
determine... 2005-06-14 Jose Ruiz <ruiz@adacore.com> * fe.h: Add entry for Opt.Exception_Locations_Suppressed so that gigi can determine whether pragma Suppress_Exception_Locations is in effect. * utils2.c (build_call_raise): Do not pass the file name to the exception handler if pragma Suppress_Exception_Locations is in effect. (build_allocator): Add and process arg IGNORE_INIT_TYPE. From-SVN: r101037
2005-05-29cal.c, [...]: Fix comment typos.Kazu Hirata1-1/+1
* cal.c, decl.c, init.c, raise.c, trans.c, utils2.c: Fix comment typos. * gnat_rm.texi, gnat_ugn.texi: Fix typos. From-SVN: r100312
2005-04-01adaint.c, [...]: Fix comment typos.Kazu Hirata1-1/+1
* 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-15[multiple changes]Arnaud Charlet1-3/+3
2005-03-08 Robert Dewar <dewar@adacore.com> * s-bitops.adb, s-bitops.ads, s-taprop-os2.adb, s-intman-vms.ads, s-intman-vxworks.ads, s-taprop-vxworks.adb, a-caldel.ads, a-calend.adb, a-tasatt.adb, tbuild.ads, s-finimp.adb, s-imgwch.adb, s-intman.ads, s-intman.ads, s-memory.adb, s-soflin.ads, s-taasde.ads, s-taprob.adb, s-taprop.ads, s-taprop.ads, s-tasini.adb, s-tasini.ads, s-tasini.ads, s-tasini.ads, s-taskin.ads, s-tasren.adb, s-tassta.adb, s-tassta.ads, s-tassta.ads, s-tasuti.ads, s-tataat.ads, s-tataat.ads, s-tataat.ads, s-tataat.ads, s-tpoben.adb, s-tpoben.adb, s-tpobop.ads: Update comments. Minor reformatting. 2005-03-08 Eric Botcazou <ebotcazou@adacore.com> * utils2.c (build_binary_op): Fix typo. 2005-03-08 Doug Rupp <rupp@adacore.com> * s-crtl.ads (popen,pclose): New imports. 2005-03-08 Cyrille Comar <comar@adacore.com> * comperr.adb (Compiler_Abort): remove references to obsolete procedures in the bug boxes for various GNAT builds. 2005-03-08 Vincent Celier <celier@adacore.com> * snames.ads, snames.adb: Save as Unix text file, not as DOS text file From-SVN: r96512
2005-02-10Fix for c330001 - PR ada/19386Eric Botcazou1-6/+12
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
2004-12-23re PR middle-end/17746 (ICE when building the Ada RTS)Eric Botcazou1-1/+1
PR middle-end/17746 * expr.c (get_inner_reference): Add 'keep_aligning' parameter. Break on aligning VIEW_CONVERT_EXPR nodes on STRICT_ALIGNMENT platforms only if keep_aligning is true. (expand_assignment): Adjust call to get_inner_reference. (expand_expr_addr_expr_1): Likewise. (expand_expr_real_1): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (loc_descriptor_from_tree_1): Likewise. * fold-const.c (optimize_bit_field_compare): Likewise. (decode_field_reference): Likewise. (split_address_to_core_and_offset): Likewise. * tree-ssa-loop-ivopts.c (split_address_cost): Likewise. * expr.h (get_inner_reference): Adjust prototype. ada/ * trans.c (Attribute_to_gnu): Adjust call to get_inner_reference. * utils2.c (build_unary_op): Likewise. From-SVN: r92549
2004-10-04cuintp.c, [...]: Use gcc_assert and gcc_unreachable.Richard Kenner1-52/+30
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-10/+10
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-17alias.c (find_base_decl): Remove unreachable case '3' block.Jeffrey D. Oldham1-3/+4
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-107/+108
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-0/+1
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-27tree.h (size_int_type): Remove.Nathan Sidwell1-2/+2
* tree.h (size_int_type): Remove. * fold-const.c: Do not #include gt-fold-const.h. (size_htab_hash, size_htab_eq): Remove. (size_int_kind): Use build_int_cst. (new_const, size_htab): Remove. (size_int_type): Remove. (round_up): Use build_int_cst. (round_down): Likewise. Remove spurious constant build. * ada/utils2.c (build_allocator): Use ssize_int. * cp/class.c (build_vtbl_initializer): Use ssize_int. * cp/decl.c (complete_array_type): Likewise. * cp/method.c (finish_thunk): Likewise. * cp/search.c (get_dynamic_base_type): Likewise. From-SVN: r86667
2004-08-25tree.h (build_int_cst): New, sign extended constant.Nathan Sidwell1-4/+4
* 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