2007-05-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/31146
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): New
argument, single_use_p. If we have a single use that is
a conversion to the definition rhs type, propagate that rhs.
(forward_propagate_addr_expr): Pass single_use_p argument
to forward_propagate_addr_expr_1.
* g++.dg/tree-ssa/pr31146-2.C: New testcase.
From-SVN: r124349
2007-04-20 Pascal Obry <obry@adacore.com>
* gnatchop.adb (Write_Source_Reference_Pragma): Change implementation
to use Stream_IO.File_Type. This is needed to make use of the UTF-8
encoding support of Stream_IO.
(Write_Unit): Idem.
* adaint.h, adaint.c (__gnat_os_filename): New routine. Returns the
filename and corresponding encoding to match the OS requirement.
(__gnat_file_exists): Do not call __gnat_stat() on Windows as this
routine will fail on specific devices like CON: AUX: ...
PR ada/29856: Add missing braces
From-SVN: r124347
2007-05-01 Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
* config/i386/i386.c (override_options): Accept k8-sse3, opteron-sse3
and athlon64-sse3 as improved versions of k8, opteron and athlon64
with SSE3 instruction set support.
* doc/invoke.texi: Likewise.
From-SVN: r124339
* config/i386/gmon-sol2.c (size_t): New type.
(intptr_t): Likewise.
(s_textsize): Declare as size_t.
(sbrk): Declare.
(monstartup): Use size_t for sizes.
(_mcount): Save and restore registers.
(internal_mcount): Pass 0 as the first argument to monstartup
in 64-bit mode.
(moncontrol): Convert pointer to appropriately sized integer
before passing to profil.
From-SVN: r124333
2007-05-01 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/31732
* dependency.c (gfc_full_array_ref_p): If the reference is
to a single element, check that the array has a single
element and that the correct element is referenced.
2007-05-01 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/31732
* gfortran.dg/array_memset_2: New test case.
From-SVN: r124326
* tree.h (maybe_fold_offset_to_component_ref): Remove.
(maybe_fold_offset_to_reference): Declare.
* fold-const.c (fold_unary): Do not fold
(type *)&A into &A->field_of_type_and_offset_0
* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): When base type
size is unknown, give up.
(maybe_fold_offset_to_component_ref): Ignore firelds with unknown
offsets.
(maybe_fold_offset_to_reference): New.
(maybe_fold_stmt_indirect): Use it.
(fold_stmt_r): Fold (type *)&A+offset into A->field_if_type_and_offset.
* gimplify.c (gimplify_conversion): Canonicalize conversions to
field references.
(gimplify_expr): Likewise for plus_expr.
From-SVN: r124323
* tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Use
bsi_after_labels. Always insert statements before bsi.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Ditto.
* predict.c (apply_return_prediction): Check for empty blocks.
* cfgexpand.c (lab_rtx_for_bb): New variable.
(label_rtx_for_bb): Do not create new tree labels.
(expand_gimple_basic_block): Add labels recorded in lab_rtx_for_bb.
(tree_expand_cfg): Initialize lab_rtx_for_bb.
* tree-cfg.c (build_tree_cfg): Call cleanup_dead_labels after
creating edges.
(label_for_bb): Add field used.
(update_eh_label, main_block_label): Mark the label used.
(cleanup_dead_labels): Remove unused labels.
From-SVN: r124322
2007-05-01 Richard Guenther <rguenther@suse.de>
* tree-vrp.c (set_value_range): Do not allocate equiv bitmap
if it is not about to be set.
(get_value_range): Do not pre-allocate equiv bitmap.
(update_value_range): No need to clear equiv field.
(add_equivalence): Change prototype to get bitmap pointer.
Allocate bitmap here if it is not already.
(extract_range_from_assert): Do not allocate bitmap here.
Update callers to add_equivalence.
(extract_range_from_ssa_name): Likewise.
(get_vr_for_comparison): New static helper.
(compare_name_with_value): Handle NULL equiv bitmap by
peeling the first iteration of the comparison loop.
Use get_vr_for_comparison.
(compare_names): Handle NULL equiv bitmaps by using fake
ones. Use get_vr_for_comparison.
From-SVN: r124321
2007-05-01 Daniel Franke <franke.daniel@gmail.com>
* intrinsic.c (add_functions): Fixed ELEMENTAL specifications.
(add_subroutines): Replaced magic numbers in function calls by
ELEMENTAL and NOT_ELEMENTAL respectively.
* intrinsic.texi (MVBITS): Changed class to elemental subroutine.
(RANDOM_NUMBER): Changed class to subroutine.
(HUGE, TINY): Changed class to inquiry function.
From-SVN: r124320
2007-05-01 Benjamin Kosnik <bkoz@redhat.com>
* tr1/4_metaprogramming/*/explicit_instantiations.cc: Change
"basic_ofstream" in comment to type_traits.
From-SVN: r124317
* interpret-run.cc (NEXT_INSN)[DEBUG]: Advance PC before
executing the instruction.
* include/java-interp.h (_Jv_InterpFrame::get_pc): Subtract
one insn from the frame's PC. _Jv_InterpMethod::run et al
will advance the PC before executing the instruction.
From-SVN: r124313
* trans-const.c (gfc_conv_mpz_to_tree): Use mpz_get_double_int.
(gfc_conv_tree_to_mpz): New function.
(gfc_conv_mpfr_to_tree): Use real_from_mpfr.
(gfc_conv_tree_to_mpfr): New function.
* trans-const.h: (gfc_conv_tree_to_mpz): New prototype.
(gfc_conv_tree_to_mpfr): New prototype.
From-SVN: r124305
* double-int.c (mpz_set_double_int): Moved from
tree-ssa-loop-niter.c.
(mpz_get_double_int): Likewise; also, add option to wrap
out-of-range integers.
* double-int.h: New prototypes for above.
* tree.c (get_static_type_bounds): Moved from
tree-ssa-loop-niter.c; now returns TYPE_MIN_VALUE and
TYPE_MAX_VALUE if they exist..
* tree.h: New prototype for above.
* tree-ssa-loop-niter.c: Adjust mpz_to_double_int and
get_type_bounds calls.
(mpz_set_double_int): Move to double-int.c.
(get_type_bounds): Move to tree.c, rename to
get_static_type_bounds.
(mpz_to_double_int): Move to double-int.c, rename to
mpz_get_double_int.
From-SVN: r124304
PR middle-end/22156
Temporarily revert:
2007-04-06 Andreas Tobler <a.tobler@schweiz.org>
2007-04-05 Alexandre Oliva <aoliva@redhat.com>
* tree-sra.c (try_instantiate_multiple_fields): Needlessly
initialize align to silence bogus warning.
2007-04-05 Alexandre Oliva <aoliva@redhat.com>
* tree-sra.c (struct sra_elt): Add in_bitfld_block. Remove
all_no_warning.
(struct sra_walk_fns): Remove use_all parameter from use.
(sra_hash_tree): Handle BIT_FIELD_REFs.
(sra_elt_hash): Don't hash bitfld blocks.
(sra_elt_eq): Skip them in parent compares as well. Handle
BIT_FIELD_REFs.
(sra_walk_expr): Don't maintain or pass down use_all_p.
(scan_use): Remove use_all parameter.
(scalarize_use): Likewise. Re-expand assignment to
BIT_FIELD_REF of gimple_reg. De-scalarize before input or
output, and re-scalarize after output. Don't mark anything
for no warning.
(scalarize_ldst): Adjust.
(scalarize_walk_gimple_modify_statement): Likewise.
(build_element_name_1): Handle BIT_FIELD_REFs.
(instantiate_element): Don't warn for any element whose parent
is used as a whole.
(instantiate_missing_elements_1): Return the sra_elt.
(canon_type_for_field): New.
(try_instantiate_multiple_fields): New.
(instantiate_missing_elemnts): Use them.
(mark_no_warning): Removed.
(generate_one_element_ref): Handle BIT_FIELD_REFs.
(REPLDUP, sra_build_elt_assignment): New.
(generate_copy_inout): Use them.
(generate_element_copy): Likewise. Handle bitfld differences.
(generate_element_zero): Don't recurse for blocks. Use
sra_build_elt_assignment.
(generate_one_element_int): Take elt instead of var. Use
sra_build_elt_assignment.
(generate_element_init_1): Adjust.
(scalarize_use, scalarize_copy): Use REPLDUP.
(scalarize_ldst): Move assert before dereference.
(dump_sra_elt_name): Handle BIT_FIELD_REFs.
From-SVN: r124302
2007-04-30 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/31721
* tree.c (reconstruct_complex_type): Reconstruct a reference
correctly.
Also use the same mode for the pointer as the old pointer type.
2007-04-30 Andrew pinski <andrew_pinski@playstation.sony.com>
PR C++/31721
* g++.dg/ext/vector7.C: New testcase.
From-SVN: r124300
2007-04-30 Daniel Franke <franke.daniel@gmail.com>
* intrinsic.texi (IERRNO): Changed class to non-elemental function.
(LOG10): Removed COMPLEX as accepted argument type.
(NEW_LINE): Changed class from elemental to inquiry function.
(SIGN): Removed requirement of scalar arguments.
(SNGL): Changed class to elemental function.
From-SVN: r124297