* loop-iv.c (replace_single_def_regs, replace_in_expr): New static
functions.
(simplify_using_assignment, simplify_using_initial_values): Call
replace_in_expr to make replacements. Call replace_single_def_regs
once on the initial version of the expression.
From-SVN: r145357
* loop-iv.c (determine_max_iter): New arg OLD_NITER. All callers
changed. Use this when trying to improve the upper bound.
Generate the comparison by using simplify_gen_relational.
From-SVN: r145354
* simplify-rtx.c (simplify_relational_operation_1): Simplify
(LTU (PLUS a C) C) or (LTU (PLUS a C) a) to (GEU a -C); likewise with
GEU/LTU reversed.
From-SVN: r145353
* loop-iv.c (simplify_using_condition): A condition of the form
(EQ REG CONST) can be used to simply make a substitution.
(simplify_using_initial_values): Keep track of conditions we have seen
and keep using them to simplify new expressions, while applying the
same substitutions to them as to the expression.
From-SVN: r145352
* loop-iv.c (suitable_set_for_replacement): Renamed from
simplify_using_assignment; changed to return bool and to accept new
args DEST and SRC. Return true iff we find a source/destination pair
that can be used to make a replacement, and fill SRC and DEST if so.
Remove arg ALTERED. Don't deal with altered regs here. All callers
changed.
(simplify_using_initial_values): Deal with altered regs here and track
more precisely the effect they have on the validity of our expression.
From-SVN: r145351
2009-03-31 Richard Guenther <rguenther@suse.de>
PR middle-end/31029
* fold-const.c (fold_binary): Fold X +- Y CMP X to Y CMP 0 for
equality comparisons. Fold C - X CMP X if C % 2 == 1.
* gcc.dg/fold-compare-4.c: New testcase.
* gcc.dg/fold-compare-5.c: Likewise.
From-SVN: r145345
PR target/39592
* config/i386/i386.md (*floatunssi<mode>2_1, two unnamed
define_splits, floatunssi<mode>2): Require x87 conversions from
DImode to be permitted.
testsuite:
* gcc.target/i386/pr39592-1.c: New test.
From-SVN: r145342
* tree-eh.c (make_eh_edges): Set probability 100% to first edge out of RESX.
(tree_remove_unreachable_handlers): Cleanup EH predecestor detection and label
handling.
From-SVN: r145322
2009-03-30 Paul Thomas <pault@gcc.gnu.org>
PR fortran/22571
PR fortran/26227
PR fortran/24886
* symbol.c : Add gfc_global_ns_list.
* decl.c (add_global_entry): Set the namespace ('ns') field.
* gfortran.h : Add the resolved field to gfc_namespace. Add the
namespace ('ns') field to gfc_gsymbol. Add flag_whole_file to
gfc_option_t. Add the prototype for gfc_free_dt_list.
* lang.opt : Add the whole-file option.
* invoke.texi : Document the whole-file option.
* resolve.c (resolve_global_procedure): If the fwhole-file
option is set, reorder gsymbols to ensure that translation is
in the right order. Resolve the gsymbol's namespace if that
has not occurred and then check interfaces.
(resolve_function): Move call to resolve_global_procedure.
(resolve_call): The same.
(resolve_codes): Store the current labels_obstack.
(gfc_resolve) : Return if the namespace is already resolved.
trans-decl.c (gfc_get_extern_function_decl): If the whole_file
option is selected, use the backend_decl of a gsymbol, if it is
available.
parse.c (add_global_procedure, add_global_program): If the flag
whole-file is set, add the namespace to the gsymbol.
(gfc_parse_file): On -fwhole-file, put procedure namespaces on
the global namespace list. Rearrange to do resolution of all
the procedures in a file, followed by their translation.
* options.c (gfc_init_options): Add -fwhole-file.
(gfc_handle_option): The same.
2009-03-30 Paul Thomas <pault@gcc.gnu.org>
PR fortran/22571
* gfortran.dg/whole_file_1.f90: New test.
PR fortran/26227
* gfortran.dg/whole_file_2.f90: New test.
* gfortran.dg/whole_file_3.f90: New test.
PR fortran/24886
* gfortran.dg/whole_file_4.f90: New test.
From-SVN: r145314
2009-03-30 Vladimir Makarov <vmakarov@redhat.com>
* ira-int.h (ira_allocno): Rename left_conflicts_num to
left_conflicts_size.
(ALLOCNO_LEFT_CONFLICTS_NUM): Rename to
ALLOCNO_LEFT_CONFLICTS_SIZE.
* ira-color.c (allocno_spill_priority, push_allocno_to_stack,
remove_allocno_from_bucket_and_push,
allocno_spill_priority_compare, push_allocnos_to_stack,
setup_allocno_available_regs_num): Use ALLOCNO_LEFT_CONFLICTS_SIZE
instead of ALLOCNO_LEFT_CONFLICTS_NUM.
(setup_allocno_left_conflicts_num): Ditto. Rename to
setup_allocno_left_conflicts_size.
(put_allocno_into_bucket): Use ALLOCNO_LEFT_CONFLICTS_SIZE
instead of ALLOCNO_LEFT_CONFLICTS_NUM and
setup_allocno_left_conflicts_size instead of
setup_allocno_left_conflicts_num.
* ira-build.c (ira_create_allocno): Use
ALLOCNO_LEFT_CONFLICTS_SIZE instead of
ALLOCNO_LEFT_CONFLICTS_NUM.
From-SVN: r145312
* f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_HUGE_VAL
family of intrinsics instead of BUILT_IN_INF family.
* trans-intrinsics.c (gfc_conv_intrinsic_nearest): Use
BUILT_IN_HUGE_VAL instead of BUILT_IN_INF.
From-SVN: r145307
PR target/39558
* macro.c (cpp_get_token): If macro_to_expand returns NULL
and used some tokens, add CPP_PADDING before next token.
* gcc.target/powerpc/altivec-29.c: New test.
From-SVN: r145297
PR debug/39563
* c-decl.c (struct c_binding): Add locus field.
(bind): Add locus argument, set locus field from it.
(pop_scope): For b->nested VAR_DECL or FUNCTION_DECL,
add a DECL_EXTERNAL copy of b->decl to current BLOCK_VARS.
(push_file_scope, pushtag, pushdecl, pushdecl_top_level,
implicitly_declare, undeclared_variable, lookup_label,
declare_label, c_make_fname_decl, c_builtin_function,
c_builtin_function_ext_scope, store_parm_decls_newstyle): Adjust
bind callers.
From-SVN: r145293
2009-03-30 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (jump_func_type): Rename IPA_UNKNOWN, IPA_CONST,
IPA_CONST_MEMBER_PTR, and IPA_PASS_THROUGH to IPA_JF_UNKNOWN,
IPA_JF_CONST, IPA_JF_CONST_MEMBER_PTR, and IPA_JF_PASS_THROUGH
respectively.
* tree-dfa.c (get_ref_base_and_extent): Return -1 maxsize if
seen_variable_array_ref while also traversing a union.
* tree-inline.c (optimize_inline_calls): Do not call
cgraph_node_remove_callees.
* cgraphbuild.c (remove_cgraph_callee_edges): New function.
(pass_remove_cgraph_callee_edges): New variable.
* passes.c (init_optimization_passes): Add
pass_remove_cgraph_callee_edges after early inlining and before all
late intraprocedural passes.
* omp-low.c (expand_omp_taskreg): Always set current_function_decl.
From-SVN: r145291
2009-03-30 Paolo Bonzini <bonzini@gnu.org>
* gcc-interface/decl.c (maybe_pad_type): Use TREE_OVERFLOW
instead of TREE_CONSTANT_OVERFLOW.
From-SVN: r145287
2009-03-30 Paolo Bonzini <bonzini@gnu.org>
* config/sparc/sparc.c (sparc_compare_emitted): Remove.
(gen_compare_reg, emit_v9_brxx_insn): Handle MODE_CC
sparc_compare_op0 like sparc_compare_emitted used to be handled.
(sparc_expand_compare_and_swap_12): Set sparc_compare_op0
instead of sparc_compare_emitted.
* config/sparc/sparc.h (sparc_compare_emitted): Remove.
* config/sparc/sparc.md (stack_protect_test): Set sparc_compare_op0
instead of sparc_compare_emitted.
From-SVN: r145284
2009-03-30 Paolo Bonzini <bonzini@gnu.org>
* bb-reorder.c (partition_hot_cold_basic_blocks): Do not
enter/exit cfglayout mode.
(pass_partition_block): Require it.
* combine.c (find_single_use, reg_dead_at_p): Use CFG.
(combine_instructions): Track basic blocks instead of labels.
(update_cfg_for_uncondjump): New.
(try_combine): Use it. Update jumps after rescanning.
(pass_combine): Require PROP_cfglayout.
* passes.c (pass_outof_cfg_layout_mode): Move after regmove.
From-SVN: r145283
2009-03-30 Sebastian Pop <sebastian.pop@amd.com>
* doc/invoke.texi (-floop-interchange, -floop-strip-mine,
-floop-block): Document dependences on PPL, CLooG and Graphite.
From-SVN: r145273
PR rtl-optimization/323
* c-common.c (c_fully_fold, convert_and_check,
c_common_truthvalue_conversion): Handle EXCESS_PRECISION_EXPR.
(c_fully_fold_internal): Disallow EXCESS_PRECISION_EXPR.
* c-common.def (EXCESS_PRECISION_EXPR): New.
* c-cppbuiltin.c (builtin_define_float_constants): Define
constants with enough digits for long double.
* c-lex.c (interpret_float): Interpret constant with excess
precision where appropriate.
* c-opts.c (c_common_post_options): Set
flag_excess_precision_cmdline. Give an error for
-fexcess-precision=standard for C++ for processors where the
option is significant.
* c-parser.c (c_parser_conditional_expression): Handle excess
precision in condition.
* c-typeck.c (convert_arguments): Handle arguments with excess
precision.
(build_unary_op): Move excess precision outside operation.
(build_conditional_expr): Likewise.
(build_compound_expr): Likewise.
(build_c_cast): Do cast on operand of EXCESS_PRECISION_EXPR.
(build_modify_expr): Handle excess precision in RHS.
(convert_for_assignment): Handle excess precision in converted
value.
(digest_init, output_init_element, process_init_element): Handle
excess precision in initializer.
(c_finish_return): Handle excess precision in return value.
(build_binary_op): Handle excess precision in operands and add
excess precision as needed for operation.
* common.opt (-fexcess-precision=): New option.
* config/i386/i386.h (X87_ENABLE_ARITH, X87_ENABLE_FLOAT): New.
* config/i386/i386.md (float<SSEMODEI24:mode><X87MODEF:mode>2):
For standard excess precision, output explicit conversion to and
truncation from XFmode.
(*float<SSEMODEI24:mode><X87MODEF:mode>2_1,
*float<SSEMODEI24:mode><X87MODEF:mode>2_i387_with_temp,
*float<SSEMODEI24:mode><X87MODEF:mode>2_i387, two unnamed
define_splits, floatdi<X87MODEF:mode>2_i387_with_xmm, two unnamed
define_splits, *floatunssi<mode>2_1, two unnamed define_splits,
floatunssi<mode>2, add<mode>3, sub<mode>3, mul<mode>3, divdf3,
divsf3, *fop_<mode>_comm_i387, *fop_<mode>_1_i387,
*fop_<MODEF:mode>_2_i387, *fop_<MODEF:mode>_3_i387,
*fop_df_4_i387, *fop_df_5_i387, *fop_df_6_i387, two unnamed
define_splits, sqrt<mode>2): Disable where appropriate for
standard excess precision.
* convert.c (convert_to_real): Do not shorten arithmetic to type
for which excess precision would be used.
* defaults.h (TARGET_FLT_EVAL_METHOD_NON_DEFAULT): Define.
* doc/invoke.texi (-fexcess-precision=): Document option.
(-mfpmath=): Correct index entry.
* flags.h (enum excess_precision, flag_excess_precision_cmdline,
flag_excess_precision): New.
* langhooks.c (lhd_post_options): Set
flag_excess_precision_cmdline.
* opts.c (common_handle_option): Handle -fexcess-precision=.
* toplev.c (flag_excess_precision_cmdline, flag_excess_precision,
init_excess_precision): New.
(lang_dependent_init_target): Call init_excess_precision.
* tree.c (excess_precision_type): New.
* tree.h (excess_precision_type): Declare.
ada:
* gcc-interface/misc.c (gnat_post_options): Set
flag_excess_precision_cmdline. Give an error for
-fexcess-precision=standard for processors where the option is
significant.
fortran:
* options.c (gfc_post_options): Set
flag_excess_precision_cmdline. Give an error for
-fexcess-precision=standard for processors where the option is
significant.
java:
* lang.c (java_post_options): Set flag_excess_precision_cmdline.
Give an error for -fexcess-precision=standard for processors where
the option is significant.
testsuite:
* gcc.target/i386/excess-precision-1.c,
gcc.target/i386/excess-precision-2.c,
gcc.target/i386/excess-precision-3.c,
gcc.target/i386/excess-precision-4.c,
gcc.target/i386/excess-precision-5.c,
gcc.target/i386/excess-precision-6.c: New tests.
From-SVN: r145272
PR c/35235
* c-typeck.c (build_component_ref): Do not copy qualifiers from
non-lvalue to component.
testsuite:
* gcc.dg/c99-array-lval-8.c: New test.
From-SVN: r145271