2008-09-18 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37258
* tree-ssa-sccvn.c (vn_phi_compute_hash): Include the precision
and signedness for integral types.
(vn_phi_eq): Require compatible types.
* gcc.c-torture/compile/pr37258.c: New testcase.
From-SVN: r140460
PR debug/34037
* gimplify.c (gimplify_type_sizes): When not optimizing, ensure
TYPE_MIN_VALUE and TYPE_MAX_VALUE is not is not DECL_IGNORED_P
VAR_DECL.
* cfgexpand.c (expand_used_vars): Keep DECL_ARTIFICIAL
!DECL_IGNORED_P vars in local_decls list for instantiate_decls,
ggc_free other TREE_LIST nodes from that chain.
* function.c (instantiate_decls): Instantiate also DECL_RTL
of vars in cfun->local_decls, free that list afterwards.
From-SVN: r140459
2008-09-18 Richard Guenther <rguenther@suse.de>
PR middle-end/37284
* tree-cfg.c (remove_useless_stmts_1): Remove
GIMPLE_CHANGE_DYNAMIC_TYPE if not optimizing.
* g++.dg/tree-ssa/pr37284.C: New testcase.
From-SVN: r140453
* config/frv/frv.h (IRA_COVER_CLASSES): Define.
(SECONDARY_INPUT_RELOAD_CLASS): Omit unused argument in call
to frv_secondary_reload_class.
(SECONDARY_OUTPUT_RELOAD_CLASS): Likewise.
* config/frv/frv.c (TARGET_SECONDARY_RELOAD): Define.
(frv_secondary_reload_class): Omit unused parameter.
(frv_secondary_reload): New function. Handle the case when
secondary_reload_class() is called before the reload_(in|out)
_optabs have been initialised.
* config/frv/frv-protos.h (frv_secondary_reload_class): Omit
unused parameter.
* config/frv/frv.md: Define an exclusion set between fr550_m0
and fr550_f0.
From-SVN: r140452
2008-09-18 Daniel Kraft <d@domob.eu>
PR fortran/37507
* trans.h (gfc_trans_runtime_error): New method.
(gfc_trans_runtime_error_vararg): New method.
(gfc_allocate_array_with_status): New argument `expr' for locus/varname.
(gfc_deallocate_array_with_status): Ditto.
* trans-array.h (gfc_array_deallocate): Ditto.
* trans.c (gfc_trans_runtime_error): New method.
(gfc_trans_runtime_error_vararg): New method, moved parts of the code
from gfc_trans_runtime_check here.
(gfc_trans_runtime_error_check): Moved code partly to new method.
(gfc_call_malloc): Fix tab-indentation.
(gfc_allocate_array_with_status): New argument `expr' and call
gfc_trans_runtime_error for error reporting to include locus.
(gfc_deallocate_with_status): Ditto.
* trans-stmt.c (gfc_trans_deallocate): Pass expr as new argument.
* trans-array.c (gfc_array_allocate): Ditto.
(gfc_array_deallocate): New argument `expr', passed on.
(gfc_trans_dealloc_allocated): Pass NULL for expr.
* trans-openmp.c (gfc_omp_clause_default): Ditto.
2008-09-18 Daniel Kraft <d@domob.eu>
PR fortran/37507
* gfortran.dg/allocate_error_1.f90: New test.
* gfortran.dg/deallocate_error_1.f90: New test.
* gfortran.dg/deallocate_error_2.f90: New test.
From-SVN: r140451
2008-09-18 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37456
* tree-ssa-reassoc.c (build_and_add_sum): If the stmt we
want to insert after ends a BB insert on the single fallthru
outgoing edge.
* testsuite/g++.dg/torture/pr37456.C: New testcase.
From-SVN: r140449
PR rtl-optimization/37544
* regrename.c (maybe_mode_change): Exit early when copy_mode
is narrower than orig_mode and narrower than new_mode.
testsuite/ChangeLog:
PR rtl-optimization/37544
* gcc.dg/pr37544.c: New test.
From-SVN: r140446
* haifa-sched.c (dep_cost_1): Recognize the producer even if the
consumer is an asm. Add comment why this is important.
(choose_ready): Add comment to the "INSN_CODE (insn) >= 0 ||
recog_memoized (insn) < 0" assert. Put ENABLE_CHECKING around
it.
From-SVN: r140444
2008-09-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/37274
PR fortran/36374
* module.c (check_for_ambiguous): New function to test loaded
symbol for ambiguity with fixup symbol.
(read_module): Call check_for_ambiguous.
(write_symtree): Do not write the symtree for symbols coming
from an interface body.
PR fortran/36374
* resolve.c (count_specific_procs ): New function to count the
number of specific procedures with the same name as the generic
and emit appropriate errors for and actual argument reference.
(resolve_assumed_size_actual): Add new argument no_formal_args.
Correct logic around passing generic procedures as arguments.
Call count_specific_procs from two locations.
(resolve_function): Evaluate and pass no_formal_args.
(resolve call): The same and clean up a bit by using csym more
widely.
PR fortran/36454
* symbol.c (gfc_add_access): Access can be updated if use
associated and not private.
2008-09-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/37274
* gfortran.dg/used_types_22.f90: New test.
* gfortran.dg/used_types_23.f90: New test.
PR fortran/36374
* gfortran.dg/generic_17.f90: New test.
* gfortran.dg/ambiguous_specific_2.f90: New test.
* gfortran.dg/generic_actual_arg.f90: Add test for case that is
not ambiguous.
PR fortran/36454
* gfortran.dg/access_spec_3.f90: New test.
From-SVN: r140434
* varasm.c (initializer_constant_valid_p): Forbid view-conversions
from aggregate to non-aggregate type if the bit pattern is not fully
preserved afterwards.
From-SVN: r140432
2008-09-17 Richard Guenther <rguenther@suse.de>
PR c++/22374
* rtti.c (build_dynamic_cast_1): Convert the COND_EXPR
result to the correct type.
From-SVN: r140427
2008-09-17 H.J. Lu <hongjiu.lu@intel.com>
PR c++/37450
* name-lookup.c (pushdecl_maybe_friend): Don't return the old
parameter for duplicate.
From-SVN: r140425
PR c++/37552
* typeck.c (build_array_ref): Use protected_set_expr_location instead
of SET_EXPR_LOCATION when ret might not be an expression.
* g++.dg/parse/crash49.C: New test.
From-SVN: r140422
PR preprocessor/37324
* lib/target-supports.exp
(check_effective_target_wchar_t_char16_t_compatible,
check_effective_target_wchar_t_char32_t_compatible): New.
* gcc.dg/utf-array.c: Use __CHAR{16,32}_TYPE__ macros in typedefs.
Only require from incompatible errors for char{16,32}_t vs. wchar_t
initializations if those types are indeed incompatible.
From-SVN: r140421
* ipa-reference.c (ipa_obstack): Remove.
(local_info_obstack, global_info_obstack): New.
(add_static_var): We now handle variables only.
(mark_address_taken, mark_load, mark_store): New functions based on ...
(check_operand): ... remove.
(get_asm_stmt_operands): Rename to ...
(check_asm_memory_clobber): ... this. Look only for memory clobber.
(scan_stmt_for_static_refs): Rewrite.
(scan_op_for_static_refs): Rename to ...
(scan_initializer_for_static_refs): do not look for VAR_DECL
initializers; stop recursion on types and decls.
(ipa_init): Use proper obstacks.
(analyze_variable): Use scan_initializer_for_static_refs.
(init_function_info): Use local obstack.
(analyze_function): Simplify.
(add_new_function): We don't need visited_nodes obstack.
(generate_summary): Use proper obstacks; cleanup after propagation.
From-SVN: r140415
2008-09-17 Richard Guenther <rguenther@suse.de>
PR middle-end/37385
PR tree-optimization/37491
* alias.c (get_alias_set): Use the canonical type.
* tree-vect-transform.c (vectorizable_store): Use the type of
the lhs for the vector type. Adjust checking.
(vectorizable_load): Adjust checking.
From-SVN: r140412
PR rtl-optimization/37483
* ifcvt.c (noce_try_sign_mask): Use if_info->test_bb instead of
if_info->insn_b's bb as argument to optimize_bb_for_speed_p.
Rearrange code to better match the original comment. Check
t_unconditional first. Improve comment.
testsuite/
* gcc.c-torture/compile/pr37483.c: New test.
* gcc.c-torture/compile/pr37395.c: New test.
Co-Authored-By: Adam Nemet <anemet@caviumnetworks.com>
From-SVN: r140403
PR c++/37531
* semantics.c (finish_compound_literal): Return error_mark_node if
type is errorneous.
* g++.dg/parse/crash47.C: New test.
From-SVN: r140400
PR testsuite/36889
* lib/fortran-torture.exp (get-fortran-torture-options): Only
set test_tree_vectorize on i?86/x86_64 resp. sparc* if sse2 resp.
ultrasparc hw is available.
From-SVN: r140398