* dwarf2out.c: Include tree-pass.h and gimple.h.
(loc_list_plus_const): New function.
(loc_descriptor_from_tree_1): Rename to ...
(loc_descriptor_from_tree): ... remove original.
(loc_list_from_tree): New function.
(add_AT_location_description): Accept location list.
(tls_mem_loc_descriptor): Update call of loc_descriptor_from_tree.
(concatn_mem_loc_descriptor): Remove.
(mem_loc_descriptor): Handle CONCAT/CONCATN and VAR_LOCATION by
returning NULL.
(secname_for_decl): Move up.
(hidden_reference_p): New function; break out from ...
(loc_by_refernece): ... here; move up.
(dw_loc_list): New function.
(single_element_loc_list): New function.
(single_element_loc_list_p): New function.
(add_loc_descr_to_each): New function.
(add_loc_list): New function.
(loc_descr_from_tree): Make wraper of loc_list_from_tree.
(loc_list_from_tree): Reroganized from loc_descr_from_tree;
add diagnostics why expansion failed.
(add_location_or_const_value_attribute): Support location lists.
(add_bound_info): Likewise.
(descr_info_loc): Update call of loc_descriptor_from_tree.
(gen_variable_die): Work on location lists.
* final.c (pass_final): Add dump file.
* Makefile.in (dwarf2out.o): Add new dependencies.
From-SVN: r151807
gcc/
PR c/41049
* real.c decimal_from_integer, decimal_integer_string): New.
(real_from_integer): Use them as special case for decimal float.
* config/dfp-bit.c (_si_to_sd, _usi_to_sd): Use default rounding.
(_di_to_sd, _di_to_dd, _di_to_td, _udi_to_sd, _udi_to_dd, _udi_to_td):
Do not append zero after the decimal point in string to convert.
gcc/testsuite/
PR c/41049
* dfp/pr41049.c: New test.
From-SVN: r151806
2009-09-17 Alexander Monakov <amonakov@ispras.ru>
gcc:
* graphite-sese-to-poly.c (pdr_add_data_dimensions): Add bounds only
for ARRAY_REFs. Use array_ref_{low,up}_bound to determine bounds.
libgomp:
* testsuite/libgomp.graphite/bounds.c: New test.
From-SVN: r151802
2009-09-17 Martin Jambor <mjambor@suse.cz>
* common.opt (fipa-sra): New switch.
* opts.c (decode_options): Turn flag_ipa_sra on for opt2.
* timevar.def (TV_IPA_SRA): New timevar.
* params.def (ipa-sra-ptr-growth-factor): New parameter.
* doc/invoke.texi: Document -fipa-sra and ipa-sra-ptr-growth-factor.
* tree-sra.c: Include cgraph.c.
(enum sra_mode): Added SRA_MODE_EARLY_IPA.
(struct access): Added fields stmt, grp_maybe_modified, grp_scalar_ptr
and grp_not_necessarilly_dereferenced.
(func_param_count): New variable.
(encountered_apply_args): New variable.
(bb_dereferences): New variable.
(final_bbs): New variable.
(no_accesses_representant): New variable.
(no_accesses_p): New function.
(dump_access): Dump the new fields.
(sra_initialize): Set encountered_apply_args to false.
(get_ssa_base_param): New function.
(mark_parm_dereference): New function.
(create_access): Caring for INIDRECT_REFs and different handling of
varialble length accesses in early IPA SRA. Store the stmt - a new
parameter - to the new access.
(build_access_from_expr_1): New parameter stmt, passed to
create_access. Handle INDIRECT_REFs.
(build_access_from_expr): Pass the current statement to
build_access_from_expr_1.
(disqualify_ops_if_throwing_stmt): Trigger only in intraprocedural
passes.
(build_accesses_from_assign): Pass the current statement to
build_access_from_expr_1. Do not create assign links in IPA-SRA.
(scan_function): Call handle_ssa_defs on phi nodes. Set bits in
final_bbs when necessary. Check for calls to __builtin_apply_args.
Fixup EH info if anythng was changed.
(is_unused_scalar_param): New function.
(ptr_parm_has_direct_uses): New function.
(find_param_candidates): New function.
(mark_maybe_modified): New function.
(analyze_modified_params): New function.
(propagate_dereference_distances): New function.
(dump_dereferences_table): New function.
(analyze_caller_dereference_legality): New function.
(unmodified_by_ref_scalar_representative): New function.
(splice_param_accesses): New function.
(decide_one_param_reduction): New function.
(enum ipa_splicing_result): New type.
(splice_all_param_accesses): New function.
(get_param_index): New function.
(turn_representatives_into_adjustments): New function.
(analyze_all_param_acesses): New function.
(get_replaced_param_substitute): New function.
(get_adjustment_for_base): New function.
(replace_removed_params_ssa_names): New function.
(sra_ipa_reset_debug_stmts): New function.
(sra_ipa_modify_expr): New function.
(sra_ipa_modify_assign): New function.
(convert_callers): New function.
(modify_function): New function.
(ipa_sra_preliminary_function_checks): New function.
(ipa_early_sra): New function.
(ipa_early_sra_gate): New function.
(pass_early_ipa_sra): New variable.
* Makefile.in (tree-sra.o): Add cgraph.h to dependencies.
Testsuite:
* gcc.dg/struct/wo_prof_escape_arg_to_local.c: Do not run IPA-SRA.
* gcc.dg/ipa/ipa-sra-1.c: New test.
* gcc.dg/ipa/ipa-sra-2.c: New test.
* gcc.dg/ipa/ipa-sra-3.c: New test.
* gcc.dg/ipa/ipa-sra-4.c: New test.
* gcc.dg/ipa/ipa-sra-5.c: New test.
* gcc.c-torture/execute/ipa-sra-1.c: New test.
* gcc.c-torture/execute/ipa-sra-2.c: New test.
From-SVN: r151800
PR middle-end/41347
* tree.c (build_type_attribute_qual_variant): Export.
* tree.h (build_type_attribute_qual_variant): Declare.
* tree-inline.c (remap_type_1): Use it to build variants with
the original qualifiers and attributes.
testsuite/
* gfortran.dg/pr41347.f90: New test.
From-SVN: r151799
2009-09-17 Bob Duff <duff@adacore.com>
* g-socket.ads: Document the fact that Close_Selector has no effect on
a closed selector.
* g-socket.adb: Raise an exception when a Selector that should be open
is closed.
(Check_Selector): Declare RSig as a constant rather than a renames,
less confusing.
From-SVN: r151798
2009-09-17 Emmanuel Briot <briot@adacore.com>
* prj-conf.adb, prj-env.adb, prj-env.ads (Create_Temp_File): Moved to
spec.
(Do_Autoconf): If the object directory does not exists, create auto.cgpr
in a temporary directory instead
2009-09-17 Bob Duff <duff@adacore.com>
* a-dynpri.adb (Set_Priority): Don't do anything if the task is already
terminated.
(Get_Priority): Correct message for "terminated" case -- it said "null".
2009-09-17 Robert Dewar <dewar@adacore.com>
* exp_ch6.adb: Minor reformatting
From-SVN: r151795
2009-09-17 Emmanuel Briot <briot@adacore.com>
* prj-ext.adb, prj-ext.ads, makeutl.adb (Is_External_Assignment):
Remove duplicate code.
(Prj.Ext): Fix memory leak
(Check): Now allow the syntax "-Xfoo=" to set an empty value to the
variable. This was previously allowed in the code in
Is_External_Assignment, and some tests rely on it
From-SVN: r151793
2009-09-17 Bob Duff <duff@adacore.com>
* gnat_rm.texi, s-oscons-tmplt.c: Minor typo
2009-09-17 Emmanuel Briot <briot@adacore.com>
* gnatcmd.adb, prj-proc.adb, make.adb, prj-ext.adb, prj-ext.ads,
makeutl.adb, makeutl.ads, clean.adb, prj-pars.adb, prj-pars.ads,
prj-conf.adb, prj-conf.ads, prj-tree.adb, prj-tree.ads, prj-proc.ads,
prj-nmsc.ads (Add, Value_Of, Reset): new parameter Tree.
Scenario variables are now specific to each project tree loaded in
memory.
Code clean ups.
2009-09-17 Javier Miranda <miranda@adacore.com>
* exp_disp.adb (Make_DT): Remove wrong line of code that was
undocumented and probably added by mistake.
From-SVN: r151792
2009-09-17 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* cfglayout.c (fixup_reorder_chain): Accept conditional jumps
without a fallthrough edge.
2009-09-17 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* gcc.c-torture/compile/20090917-1.c: New testcase.
From-SVN: r151790
PR target/41246
* tree-cfg.c (verify_gimple_call): Validate that
* gimple_call_chain
is set only if DECL_NO_STATIC_CHAIN is unset.
* tree-nested.c (iter_nestinfo_start, iter_nestinfo_next): New.
(FOR_EACH_NEST_INFO): New.
(walk_all_functions): Use it.
(finalize_nesting_tree): Likewise.
(unnest_nesting_tree): Likewise.
(free_nesting_tree): Use iter_nestinfo_start, iter_nestinfo_next.
(get_chain_decl, get_chain_field): Reset DECL_NO_STATIC_CHAIN.
(convert_gimple_call): Early out if gimple_call_chain already set.
(convert_all_function_calls): Iterate until no new functions
require a static chain.
(finalize_nesting_tree_1): Assert DECL_NO_STATIC_CHAIN is unset
when building a trampoline. Use dump_function_to_file instead
of dump_function.
(lower_nested_functions): Open dump_file. Validate that decls
that have DECL_NO_STATIC_CHAIN from the front end don't have that
bit reset by this pass.
From-SVN: r151762
* gcc-interface/trans.c (Attribute_to_gnu) <Attr_Size>: Strip
conversions between original and packable version of types from
the expression.
From-SVN: r151757
* gcc-interface/decl.c (gnat_to_gnu_field): Add DEBUG_INFO_P parameter.
If a padding type was made for the field, declare it.
(components_to_record): Add DEBUG_INFO_P parameter. Adjust call
to gnat_to_gnu_field and call to self.
(gnat_to_gnu_entity) <E_Array_Type>: Do not redeclare padding types.
<E_Array_Subtype>: Likewise.
Adjust calls to gnat_to_gnu_field and components_to_record.
From-SVN: r151755
2009-09-16 Robert Dewar <dewar@adacore.com>
* prj-nmsc.adb: Minor reformatting
2009-09-16 Ed Schonberg <schonberg@adacore.com>
* exp_ch4.adb (Expand_N_Conditional_Expression): If the type of the
expression is a by-reference type (tagged or inherently limited)
introduce an access type to capture references to the values of each
branch of the conditional.
2009-09-16 Emmanuel Briot <briot@adacore.com>
* prj-proc.adb, prj-part.adb, prj-tree.adb, prj-tree.ads
(Project_Name_And_Node.Display_Name): new field
The display name of a project (as written in the .gpr file) is now
computed when the project file itself is parsed, not when it is
processed.
From-SVN: r151750
2009-09-16 Thomas Quinot <quinot@adacore.com>
* freeze.adb, exp_intr.adb (Expand_Intrinsic_Call): Leave calls to
intrinsics untouched (to be expanded later on by gigi) if an external
name has been specified.
(Freeze_Entity): Do not generate a default external name for
imported subprograms with convention Intrinsic (so that the above code
can identify the case where an external name has been explicitly
provided).
* s-oscons-tmplt.c: Quote TARGET_OS early so that it is not erroneously
replaced by something else due to an existing #define clause.
2009-09-16 Ed Schonberg <schonberg@adacore.com>
* sinfo.ads, sinfo.adb (Is_Accessibility_Actual): New flag on
Parameter_Association node, created for the extra actual generated for
an access parameter of a function that dispatches on result, to prevent
double generation of such actuals when the call is rewritten is a
dispatching call.
* exp_ch6.adb (Expand_Call): Set Is_Accessibility_Actual when needed.
* exp_disp.adb (Expand_Dispatching_Call): Do not transfer extra actuals
that carry this flag when rewriting the original call as a dispatching
call, after propagating the controlling tag.
2009-09-16 Vincent Celier <celier@adacore.com>
* prj-nmsc.adb (Add_Source): New parameter Source_Dir_Rank to be put
in the source data.
(Check_File): New parameter Source_Dir_Rank, to check if a duplicate
source is allowed.
(Find_Source_Dirs): New parameter Rank to be recorded with the source
directories.
(Search_Directories): Call Check_File with the rank of the directory
* prj.adb (Project_Empty): Add new component Source_Dir_Ranks
(Free): Free also Number_Lists
(Reset): Init also Number_Lists
* prj.ads (Number_List_Table): New dynamic table for lists of numbers
(Source_Data): New component Source_Dir_Rank. Remove component
Known_Order_Of_Source_Dirs, no longer needed.
(Project_Data): New component Source_Dir_Ranks
(Project_Tree_Data): New components Number_Lists
From-SVN: r151749
2009-09-16 Vincent Celier <celier@adacore.com>
* gprep.adb (Yes_No): New global constant
Unix_Line_Terminators: New global Boolean variable
(Process_One_File): Create the out file with a "Text_Translation=" form
that depends on the use of option -T.
(Scan_Command_Line): Add option -T
(Usage): Add line for option -T
2009-09-16 Ed Schonberg <schonberg@adacore.com>
* exp_disp.ads, exp_disp.adb (Is_Predefined_Internal_Operation): New
predicate that describes a proper subset of
Is_Predefined_Dispatching_Operation and excludes stream operations,
which can be overridden by the user.
* sem_ch6.adb (Create_Extra_Formals): use
Is_Predefined_Internal_Operation, so that stream operations get extra
formals.
* exp_ch6.adb (Prevent double generation of extra actuals in calls to
'Input, which may be expanded twice, first as a function call and then
as a dispatching call.
From-SVN: r151748
2009-09-16 Thomas Quinot <quinot@adacore.com>
* s-oscons-tmplt.c (Target_OS, Target_Name): New constants.
* g-expect.adb (Set_Up_Child_Communications): Use
System.OS_Constants.Target_OS to determine whether running on Windows.
From-SVN: r151747
PR bootstrap/41349
* reorg.c (redundant_insn): Don't count notes or DEBUG_INSNs when
trying to limit the extent of searches in the insn stream.
From-SVN: r151731
PR target/41175
PR target/40677
* config/rs6000/rs6000.c (no_global_regs_above): Fix precedence
problem.
(SAVRES_NOINLINE_GPRS_SAVES_LR, SAVRES_NOINLINE_FPRS_SAVES_LR,
SAVRES_NOINLINE_FPRS_DOESNT_RESTORE_LR): New strategy bits.
(rs6000_savres_strategy): Always save FP registers inline if the
target doesn't support hardware double-precision. Set the above
bits in return value when needed.
(rs6000_savres_routine_sym): Fix computation for cache selector.
Mark the generated symbol as a function. Rename exitp argument to
lr. Move code for determining the name of the symbol...
(rs6000_savres_routine_name): ...here. New function. Add cases for
getting the names right on AIX and 64-bit Linux.
(savres_routine_name): New variable.
(rs6000_make_savres_rtx): Rename exitp argument to lr. Don't assert
lr isn't set when savep. Use r12 resp. r1 instead of r11 depending
on what the target routine uses as a base register. If savep && lr
describe saving of r0 into memory slot.
(rs6000_emit_prologue): Correct use of call_used_regs. Fix out of
line calls for AIX ABI.
(rs6000_output_function_prologue): Use rs6000_savres_routine_name to
determine FP save/restore functions.
(rs6000_emit_stack_reset): Handle savres if sp_offset != 0 and
frame_reg_rtx != sp_reg_rtx. Use gen_add3_insn instead of
gen_addsi3.
(rs6000_emit_epilogue): Adjust computation of restore_lr.
Duplicate restoration of LR and execute the appropriate one
depending on whether GPRs are being restored inline. Set r11 from
offsetted frame_reg_rtx instead of sp_reg_rtx; if frame_reg_rtx is
r11, adjust sp_offset. Use gen_add3_insn instead of gen_addsi3.
Fix out of line calls for AIX ABI.
* config/rs6000/rs6000.md (*return_and_restore_fpregs_aix_<mode>):
New insn.
* config/rs6000/spe.md (*save_gpregs_spe): Use explicit match for
register 11.
(*restore_gpregs_spe): Likewise.
(*return_and_restore_gpregs_spe): Likewise.
* config/rs6000/linux64.h (SAVE_FP_SUFFIX, RESTORE_FP_SUFFIX):
Define to empty string unconditionally.
* config/rs6000/sysv4.h (SAVE_FP_SUFFIX, RESTORE_FP_SUFFIX):
Define to empty string unconditionally.
(GP_SAVE_INLINE, FP_SAVE_INLINE): Handle TARGET_64BIT the same as
!TARGET_64BIT.
* gcc.target/powerpc/pr41175.c: New test.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r151729