2006-10-21 Richard Guenther <rguenther@suse.de>
PR tree-optimization/3511
* tree-ssa-pre.c (phi_translate): Fold CALL_EXPRs that
got new invariant arguments during PHI translation.
* gcc.dg/tree-ssa/ssa-pre-15.c: New testcase.
From-SVN: r117932
2006-10-21 Richard Guenther <rguenther@suse.de>
PR middle-end/26898
* fold-const.c (fold_comparison): Fold signed comparisons
of the form X +- C1 CMP Y +- C2.
* gcc.dg/torture/pr26898-1.c: New testcase.
* gcc.dg/torture/pr26898-2.c: Likewise.
From-SVN: r117931
2006-10-21 Richard Guenther <rguenther@suse.de>
PR target/19116
* config/i386/i386.c (override_options): Do not set MASK_IEEE_FP
if flag_unsafe_math_optimizations is specified. We have
flag_finite_math_only for that.
* config/i386/i386.md (sqrtxf2): Do not require TARGET_IEEE_FP
or flag_unsafe_math_optimizations.
From-SVN: r117930
2006-10-21 Richard Guenther <rguenther@suse.de>
PR middle-end/28796
* simplify-rtx.c (simplify_const_relational_operation):
Do not constant-fold ORDERED and UNORDERED for
flag_unsafe_math_optimizations but only we do not need to
honor NaNs for the given mode.
From-SVN: r117928
2006-10-20 Daniel Berlin <dberlin@dberlin.org>
* tree.h (DECL_PTA_ARTIFICIAL): Remove.
(tree_decl_with_vis): Remove artificial_pta_var flag.
* tree-flow.h (referenced_var_check_and_insert): Expose.
(nonlocal_all): New prototype.
* tree-ssa-structalias.c (nonlocal_for_type): Remove.
(nonlocal_all): Make global.
(nonlocal_lookup): Remove.
(nonlocal_insert): Ditto.
(create_nonlocal_var): Do not call nonlocal_insert.
(get_nonlocal_id_for_type): Remove.
(find_global_initializers): Mark new vars we find for renaming.
(intra_create_variable_infos): Only create one nonlocal.
(expand_nonlocal_solutions): Remove.
(compute_points_to_sets): Don't call it.
(ipa_pta_execute): Ditto.
(init_alias_heapvars): Don't create nonlocal_for_type.
(delete_alias_heapvars): Don't remove it.
* tree-ssa-operands.c (access_can_touch_variable): Don't prune
nonlocal_all.
From-SVN: r117922
2006-10-19 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/28778
Fix PR tree-optimization/29156
Fix PR tree-optimization/29415
* tree.h (DECL_PTA_ARTIFICIAL): New macro.
(tree_decl_with_vis): Add artificial_pta_var flag.
* tree-ssa-alias.c (is_escape_site): Remove alias info argument,
pushed into callers.
* tree-ssa-structalias.c (nonlocal_for_type): New variable.
(nonlocal_all): Ditto.
(struct variable_info): Add directly_dereferenced member.
(var_escaped_vars): New variable.
(escaped_vars_tree): Ditto.
(escaped_vars_id): Ditto.
(nonlocal_vars_id): Ditto.
(new_var_info): Set directly_dereferenced.
(graph_size): New variable
(build_constraint_graph): Use graph_size.
(solve_graph): Don't process constraints that cannot change the
solution, don't try to propagate an empty solution to our
successors.
(process_constraint): Set directly_dereferenced.
(could_have_pointers): New function.
(get_constraint_for_component_ref): Don't process STRING_CST.
(nonlocal_lookup): New function.
(nonlocal_insert): Ditto.
(create_nonlocal_var): Ditto.
(get_nonlocal_id_for_type): Ditto.
(get_constraint_for): Allow results vector to be empty in the case
of string constants.
Handle results of calls properly.
(update_alias_info): Update alias info stats on number and type of
calls.
(find_func_aliases): Use could_have_pointers.
(make_constraint_from_escaped): Renamed from
make_constraint_to_anything, and changed to make constraints from
escape variable.
(make_constraint_to_escaped): New function.
(find_global_initializers): Ditto.
(create_variable_info_for): Make constraint from escaped to any
global variable, and from any global variable to the set of
escaped vars.
(intra_create_variable_infos): Deal with escaped instead of
pointing to anything.
(set_uids_in_ptset): Do type pruning on directly dereferenced
variables.
(find_what_p_points_to): Adjust call to set_uids_with_ptset.
(init_base_vars): Fix comment, and initialize escaped_vars.
(need_to_solve): Removed.
(find_escape_constraints): New function.
(expand_nonlocal_solutions): Ditto.
(compute_points_to_sets): Call find_escape_constraints and
expand_nonlocal_solutions.
(delete_points_to_sets): Don't fall off the end of the graph.
(init_alias_heapvars): Initialize nonlocal_for_type and
nonlocal_all.
(delete_alias_heapvars): Free nonlocal_for_type and null out
nonlocal_all.
From-SVN: r117891
* fold-const.c (add_double): Rename to add_double_with_sign.
Add 'unsigned_p' parameter and take it into account for the overflow.
(mul_double): Rename to mul_double_with_sign.
Add 'unsigned_p' parameter and take it into account for the overflow.
(fold_div_compare): Call add_double_with_sign instead of add_double
and mul_double_with_sign instead of mul_double, passing them the
unsignedness of the type.
* tree.h (add_double): Macroize.
(add_double_with_sign): New prototype.
(mul_double): Macroize.
(mul_double_with_sign): New prototype.
From-SVN: r117887
2006-10-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29216
PR fortran/29314
* gfortran.h : Add EXEC_INIT_ASSIGN.
* dump-parse-tree.c (gfc_show_code_node): The same.
* trans-openmp.c (gfc_trans_omp_array_reduction): Set new
argument for gfc_trans_assignment to false.
* trans-stmt.c (gfc_trans_forall_1): The same.
* trans-expr.c (gfc_conv_function_call, gfc_trans_assign,
gfc_trans_arrayfunc_assign, gfc_trans_assignment): The
same. In the latter function, use the new flag to stop
the checking of the lhs for deallocation.
(gfc_trans_init_assign): New function.
* trans-stmt.h : Add prototype for gfc_trans_init_assign.
* trans.c (gfc_trans_code): Implement EXEC_INIT_ASSIGN.
* trans.h : Add new boolean argument to the prototype of
gfc_trans_assignment.
* resolve.c (resolve_allocate_exp): Replace EXEC_ASSIGN by
EXEC_INIT_ASSIGN.
(resolve_code): EXEC_INIT_ASSIGN does not need resolution.
(apply_default_init): New function.
(resolve_symbol): Call it for derived types that become
defined but which do not already have an initialization
expression..
* st.c (gfc_free_statement): Include EXEC_INIT_ASSIGN.
2006-10-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29216
* gfortran.dg/result_default_init_1.f90: New test.
PR fortran/29314
* gfortran.dg/automatic_default_init_1.f90: New test.
* gfortran.dg/alloc_comp_basics_1.f90: Reduce deallocate count
from 38 to 33.
From-SVN: r117879
2006-10-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/29277
* io/write.c (write_a): Add conversion of LF to CR-LF for systems with
#define HAVE_CRLF.
From-SVN: r117866
2006-10-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/29277
* io/list_read.c (next_char): Update strm_pos.
(eat_separator): Delete extra call to unget_char.
* io/transfer.c (read_block): Use read_sf for formatted stream I/O.
(next_record_r): Update strm_pos for formatted stream I/O and handle
end-of-record correctly.
(next_record_w): Ditto.
(next_record): Enable next record (r/w) functions and update strm_pos.
(finalize_transfer): Call next_record to finish the record.
From-SVN: r117846
PR c++/27952
* cp-tree.h (xref_basetypes): Return bool instead of void.
* decl.c (xref_basetypes): Adjust definition. Return false
if the class bases are invalid.
* parser.c (cp_parser_class_head): Check the return value
from xref_basetypes.
* g++.dg/inherit/virtual1.C: New test.
From-SVN: r117839
PR c++/28261
* parser.c (cp_lexer_next_token_is_decl_specifier_keyword): New
function.
(cp_parser_constructor_declarator_p): Use it.
(cp_parser_check_type_definition): Return a value indicating
whether or not the definition is valid.
(cp_parser_enum_specifier): Skip invalid enum definitions.
PR c++/28261
* g++.dg/parse/enum3.C: New test.
From-SVN: r117835