* gcc.c-torture/unsorted/dump-noaddr.x (dump_compare): Use --dumpbase
to put dump files in a subdirectory.
* gcc/testsuite/lib/gcc-dg.exp (cleanup-saved-temps): Also remove
".o" temporary files.
From-SVN: r148768
2009-06-21 Janus Weil <janus@gcc.gnu.org>
PR fortran/39850
* interface.c (gfc_compare_interfaces): Take care of implicit typing
when checking the function attribute. Plus another bugfix.
(compare_parameter): Set attr.function and attr.subroutine according
to the usage of a procedure as actual argument.
2009-06-21 Janus Weil <janus@gcc.gnu.org>
PR fortran/39850
* gfortran.dg/interface_19.f90: Add 'cleanup-modules'.
* gfortran.dg/interface_20.f90: Ditto.
* gfortran.dg/interface_21.f90: Ditto.
* gfortran.dg/interface_22.f90: Ditto.
* gfortran.dg/interface_30.f90: New.
* gfortran.dg/proc_ptr_11.f90: Fix invalid test case.
From-SVN: r148767
2009-06-21 Thomas Quinot <quinot@adacore.com>
* exp_ch3.adb, exp_prag.adb, exp_util.adb, exp_util.ads, freeze.adb,
sem_ch13.adb, sem_elab.adb (Exp_Prag.Expand_Pragma_Import_Or_Interface):
Factor out code to new subprogram...
(Exp_Util.Find_Init_Call): New shared routine to find the init proc call
for a default initialized variable.
(Freeze.Check_Address_Clause): Do not reset Has_Delayed_Freeze on an
entity that has an associated freeze node.
(Sem_Ch13.Analyze_Attribute_Definition_Clause, case Address):
If there is an init call for the object, defer it to the object freeze
point.
(Check_Elab_Call.Find_Init_Call): Rename to Check_Init_Call, to avoid
name clash with new subprogram introduced in Exp_Util.
2009-06-21 Robert Dewar <dewar@adacore.com>
* einfo.ads: Minor reformatting
From-SVN: r148764
2009-06-21 Ed Falis <falis@adacore.com>
* env.c (__gnat_environ): return NULL for vThreads - unimplemented
2009-06-21 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads: Update comments.
2009-06-21 Hristian Kirtchev <kirtchev@adacore.com>
* sem_disp.adb (Check_Direct_Call): New routine. Dispatching calls
where the controlling formal is of private class-wide type whose
completion is a synchronized type can be converted into direct calls.
2009-06-21 Vincent Celier <celier@adacore.com>
* gnatcmd.adb (Check_Files): When all sources of the project are to be
indicated to gnatcheck, gnatpp or gnatmetric, always specify the list
of sources using -files=, so that the distinction can be made by the
tool of a call with no source (to display the usage) from a call with
a project file that contains no source.
2009-06-21 Jerome Lambourg <lambourg@adacore.com>
* exp_ch3.adb (Build_Array_Init_Proc): Do not build the init proc in
case of VM convention arrays.
From-SVN: r148763
2009-06-21 Richard Guenther <rguenther@suse.de>
PR tree-optimization/38729
* tree-ssa-loop-niter.c (find_loop_niter_by_eval): Restrict
to loops with a single exit if -fno-expensive-optimizations.
From-SVN: r148761
* var-tracking.c (struct shared_hash_def, shared_hash): New types.
(dataflow_set): Change vars type from htab_t to shared_hash.
(shared_hash_pool, empty_shared_hash): New variables.
(vars_clear): Removed.
(shared_hash_shared, shared_hash_htab, shared_hash_copy,
shared_hash_find_slot_unshare, shared_hash_find_slot,
shared_hash_find_slot_noinsert, shared_hash_find): New
static inlines.
(shared_hash_unshare, shared_hash_destroy): New functions.
(unshare_variable): Unshare set->vars if shared, use
shared_hash_htab.
(vars_copy): Use htab_traverse_noresize instead of htab_traverse.
(get_init_value, find_src_set_src, dump_dataflow_set,
clobber_variable_part, emit_notes_for_differences): Use
shared_hash_htab.
(dataflow_set_init): Remove second argument, set vars to
empty_shared_hash instead of creating a new htab.
(dataflow_set_clear): Call shared_hash_destroy and set vars
to empty_shared_hash instead of calling vars_clear.
(dataflow_set_copy): Don't call vars_copy, instead just share
the src htab with dst.
(variable_union): Use shared_hash_*, use initially NO_INSERT
lookup if set->vars is shared. Don't keep slot cleared before
calling unshare_variable. Unshare set->vars if needed.
Even ->refcount == 1 vars must be unshared if set->vars is shared
and var needs to be modified.
(variable_canonicalize): New function.
(dataflow_set_union): If dst->vars is empty, just share src->vars
with dst->vars and traverse with variable_canonicalize to canonicalize
and unshare what is needed.
(dataflow_set_different): If old_set and new_set use the same shared
htab, they aren't different. If number of htab elements is different,
htabs are different. Use shared_hash_*.
(dataflow_set_destroy): Call shared_hash_destroy instead of
htab_delete.
(compute_bb_dataflow, emit_notes_in_bb, vt_emit_notes): Don't pass
second argument to dataflow_set_init.
(vt_initialize): Likewise. Initialize shared_hash_pool and
empty_shared_hash, move bb in/out initialization afterwards.
Use variable_htab_free instead of NULL as changed_variables del hook.
(variable_was_changed): Change type of second argument to pointer to
dataflow_set. When inserting var into changed_variables, bump
refcount. Unshare set->vars if set is shared htab and slot needs to
be cleared.
(set_variable_part): Use shared_hash_*, use initially NO_INSERT
lookup if set->vars is shared. Unshare set->vars if needed.
Even ->refcount == 1 vars must be unshared if set->vars is shared
and var needs to be modified. Adjust variable_was_changed caller.
(delete_variable_part): Use shared_hash_*. Even ->refcount == 1
vars must be unshared if set->vars is shared and var needs to be
modified. Adjust variable_was_changed caller.
(emit_note_insn_var_location): Don't pool_free var.
(emit_notes_for_differences_1): Initialize empty_var->refcount to 0
instead of 1.
(vt_finalize): Call htab_delete on empty_shared_hash->htab and
free_alloc_pool on shared_hash_pool.
From-SVN: r148760
2009-06-20 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/40497
* include/bits/stl_iterator_base_funcs.h (next, prev): Fix the
signature per the current C++1x draft (N2857).
* testsuite/24_iterators/operations/40497.cc: Add.
From-SVN: r148751
2009-06-20 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (find_func_aliases): For memset use
a constraint from NULL if we memset to zero.
* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Add builtins
we explicitly handle that do not read from memory.
(call_may_clobber_ref_p_1): Properly handle builtins that may
set errno.
From-SVN: r148747
2009-06-20 Ed Schonberg <schonberg@adacore.com>
* exp_ch3.adb (Build_Record_Init_Proc): When copying initial
expressions (possibly from a parent type) indicate that the scope of
the new itypes is the initialization procedure being built.
2009-06-20 Robert Dewar <dewar@adacore.com>
* a-nudira.adb (Fits_In_32_Bits): New name (inverted sense) for
Needs_64, and now computed without anomolies for some dynamic types.
2009-06-20 Thomas Quinot <quinot@adacore.com>
* sem_prag.adb: Minor reformatting
* exp_disp.ads: Minor reformatting
From-SVN: r148745
2009-06-20 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Is_OK_For_Limited_Init): An unchecked conversion of a
function call is a legal expression to initialize a limited object.
* exp_ch3.adb: Rename various freeze operations that perform expansion
actions, to prevent confusion with subprograms in the freeze package.
From-SVN: r148744
2009-06-20 Ed Schonberg <schonberg@adacore.com>
* sem.adb (Walk_Library_Units): Check instantiations first.
* sem_ch6.adb (Analyze_Subprogram_Declaration): Mark a subprogram as a
private primitive if it is a function with a controlling result that is
a type extension with progenitors.
* exp_ch9.adb (Build_Wrapper_Spec, Build_Wrapper_Body): Handle properly
a primitive operation of a synchronized tagged type that has a
controlling result.
2009-06-20 Thomas Quinot <quinot@adacore.com>
* einfo.ads: Fix typo.
2009-06-20 Ed Falis <falis@adacore.com>
* s-vxwext.ads, s-vxwext-kernel.adb: Complete previous change.
From-SVN: r148743
2009-06-20 Richard Guenther <rguenther@suse.de>
PR tree-optimization/40495
* tree-ssa-structalias.c (get_constraint_exp_for_temp): Remove.
(new_scalar_tmp_constraint_exp): New function.
(process_constraint): Do not create temporary decls.
(process_all_all_constraints): Likewise.
(handle_const_call): Likewise.
(create_function_info_for): Do not set decl.
From-SVN: r148742
2009-06-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/40440
* trans-expr.c (gfc_conv_procedure_call): Do not deallocate
allocatable components if the argument is a pointer.
2009-06-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/40440
* gfortran.dg/alloc_comp_result_2.f90: New test.
From-SVN: r148731
* tree.c (substitute_in_expr) <COMPONENT_REF>: Tweak and reformat.
<tcc_vl_exp>: Call process_call_operands on the new CALL_EXPR.
Propagate the TREE_READONLY flag without overwriting it.
(substitute_placeholder_in_expr) <tcc_vl_exp>: Likewise.
Propagate the TREE_READONLY flag onto the result.
(process_call_operands): Move around. Use correct constant value.
From-SVN: r148729
* gcc-interface/trans.c (emit_check): Do not wrap up the result
in a SAVE_EXPR.
(protect_multiple_eval): Always protect complex expressions.
From-SVN: r148723
* config/i386/i386.c (ix86_function_specific_save): Test that
fields match values, rather than testing the values are in a
certain range.
From-SVN: r148721
2009-06-19 Richard Guenther <rguenther@suse.de>
* tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Handle
ADDR_EXPR pointers.
(ptr_derefs_may_alias_p): Likewise.
(ptr_deref_may_alias_ref_p_1): New function.
(ptr_deref_may_alias_ref_p): Likewise.
(ref_maybe_used_by_call_p_1): Handle builtins that are not
covered by looking at the ESCAPED solution.
(call_may_clobber_ref_p_1): Likewise.
* tree-ssa-structalias.c (get_constraint_for_ptr_offset):
Handle NULL_TREE offset. Do not produce redundant constraints.
(process_all_all_constraints): New helper function.
(do_structure_copy): Use it.
(handle_lhs_call): Likewise.
(find_func_aliases): Handle some builtins with pointer arguments
and/or return values explicitly.
* gcc.c-torture/execute/20090618-1.c: New testcase.
From-SVN: r148718
./: * dse.c (struct store_info): Rename bitmap field to bmap. Change
all uses.
* c-decl.c (in_struct, struct_types): Remove.
(struct c_binding): Add in_struct field.
(c_binding_ptr): Define type, along with VEC.
(struct c_struct_parse_info): Define.
(struct_parse_info): New static variable.
(bind): Initialize in_struct field.
(start_struct): Remove enclosing_in_struct and
enclosing_struct_types parameters. Add
enclosing_struct_parse_info parameter. Change all callers. Set
struct_parse_info rather than in_struct and struct_types.
(grokfield): If -Wc++-compat and there is a symbol binding for the
field name, set the in_struct flag and push it on the
struct_parse_info->fields vector.
(warn_cxx_compat_finish_struct): New static function.
(finish_struct): Remove enclosing_in_struct and
enclosing_struct_types parameters. Add
enclosing_struct_parse_info parameter. Change all callers. Don't
set C_TYPE_DEFINED_IN_STRUCT here. Call
warn_cxx_compat_finish_struct. Free struct_parse_info and set to
parameter. Only push on struct_types if warn_cxx_compat.
(finish_enum): Only push on struct_types if warn_cxx_compat.
(declspecs_add_type): Add loc parameter. Change all callers.
Change all error calls to error_at. Pass loc, not input_location,
to pedwarn calls. Warn if -Wc++-compat and a typedef name is
defined in a struct. If -Wc++-compat and parsing a struct, record
that a typedef name was used.
* c-parser.c (c_parser_declspecs): Get location to pass to
declspecs_add_type.
(c_parser_struct_or_union_specifier): Update calls to start_struct
and finish_struct.
* c-tree.h (struct c_struct_parse_info): Declare.
(finish_struct, start_struct): Update declarations.
(declspecs_add_type): Update declaration.
objc/:
* objc-act.c (objc_in_struct, objc_struct_types): Remove.
(objc_struct_info): New static variable.
(objc_start_struct): Pass &objc_struct_info, not &objc_in_struct
and &objc_struct_types, to start_struct.
(objc_finish_struct): Likewise for finish_struct.
objcp/:
* objcp-decl.h (start_struct): Remove in_struct and struct_types
parameters. Add struct_info parameter.
(finish_struct): Likewise.
testsuite/:
* gcc.dg/Wcxx-compat-15.c: New testcase.
From-SVN: r148709
./: * c-decl.c (grokdeclarator): If -Wc++-compat, warn about a global
variable with an anonymous type.
fortran/:
* cpp.c (struct gfc_cpp_option_data): Give this struct, used for
the global variable gfc_cpp_option, a name.
testsuite/:
* gcc.dg/Wcxx-compat-16.c: New testcase.
From-SVN: r148708
2009-06-19 Emmanuel Briot <briot@adacore.com>
* prj-ext.adb, makeutl.adb, makeutl.ads (Executable_Prefix_Path): Now
make sure we always return a name ending with a path separator.
2009-06-19 Javier Miranda <miranda@adacore.com>
* sem_ch12.adb (Instantiate_Package_Body, Instantiate_Subprogram_Body):
Save and restore the visibility of the parent when installed.
2009-06-19 Jose Ruiz <ruiz@adacore.com>
* s-tposen.ads (Protection_Entry): Replace fields L, Ceiling, and Owner
by Common which contains all these fields.
* s-tposen.adb (Initialize_Protection_Entry, Lock_Entry,
Lock_Read_Only_Entry, Timed_Protected_Single_Entry_Call, Unlock_Entry):
Remove code duplication in this package by means of calling the
equivalent code in s-taprob.
2009-06-19 Robert Dewar <dewar@adacore.com>
* a-einuoc.ads: Minor reformatting
From-SVN: r148701
2009-06-19 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Handling of Type'Size Values): Fix Object_Size values.
2009-06-19 Robert Dewar <dewar@adacore.com>
* a-nudira.adb (Need_64): Handle negative ranges and also dynamic
ranges
* checks.adb (Determine_Range): Move the test for generic types later.
* sem_eval.adb (Compile_Time_Compare): Improve circuitry to catch more
cases.
(Eval_Relational_Op): Fold more cases including string compares
* sem_util.ads, sem_util.adb (References_Generic_Formal_Type): New
function.
From-SVN: r148697
2009-06-19 Robert Dewar <dewar@adacore.com>
* sem_type.ads, sem_ch12.adb: Minor reformatting
* s-wchcnv.adb (UTF_32_To_Char_Sequence): Handle invalid data properly
2009-06-19 Ed Schonberg <schonberg@adacore.com>
* exp_ch9.adb (Build_Wrapper_Spec): Handle properly an overridden
primitive operation of a rivate extension whose controlling argument
is an out parameter.
* sem.adb (Walk_Library_Units): exclude generic package declarations
from check.
From-SVN: r148696
* sem.adb (Walk_Library_Items): Include bodies in the list of units to
traverse, to account for front-end inlining and instantiations in a
spec or in the main unit.
From-SVN: r148695
2009-06-19 Thomas Quinot <quinot@adacore.com>
* i-vxwoio.ads: Add comments
2009-06-19 Thomas Quinot <quinot@adacore.com>
* socket.c, g-socthi-vms.adb, g-socthi-vms.ads, g-socthi-vxworks.adb,
g-socthi-vxworks.ads, g-socthi-mingw.adb, g-socthi-mingw.ads,
g-socthi.adb, g-socthi.ads, g-socket.adb, g-sothco.ads
(GNAT.Sockets.Thin.C_Ioctl): Rename to Socket_Ioctl.
(GNAT.Sockets.Thin.Socket_Ioctl): Use new function
Thin_Common.Socket_Ioctl.
(GNAT.Sockets.Thin_Common.Socket_Ioctl): Binding to new C wrapper
__gnat_socket_ioctl.
(__gnat_socket_ioctl): Wrapper for ioctl(2) called with a single int*
argument after the file descriptor and request code.
2009-06-19 Robert Dewar <dewar@adacore.com>
* checks.adb: Minor reformatting
From-SVN: r148694