* dependency.c (gfc_dep_compare_expr) <EXPR_OP>: Allow unary and
binary operators to compare equal if their operands are equal.
<EXPR_FUNCTION>: Allow "constant" intrinsic conversion functions
to compare equal, if their operands are equal.
* gfortran.dg/dependency_10.f90: New test case.
* gfortran.dg/dependency_11.f90: Likewise.
From-SVN: r111970
* function.h (frame_offset_overflow): Declare.
* function.c (frame_offset_overflow): New function.
(assign_stack_local_1): Call it to detect that the offset overflows.
* cfgexpand.c (alloc_stack_frame_space): Likewise.
From-SVN: r111964
2006-03-11 Steven Bosscher <stevenb.gcc@gmail.com>
* config/sh/sh.c: Include alloc-pool.h.
(label_ref_list_pool): New alloc pool.
(label_ref_list_t): New type for lists of labels.
(struct pool_node): Make wend a label_ref_list_t.
(add_constant): Use the new type, eradicate LABEL_NEXTREF
references.
(dump_table): Likewise.
(sh_reorg): Set up the alloc pool before using add_constant and
dump_table, and destroy it when finishing.
From-SVN: r111963
fortran/
2006-03-11 Erik Edelmann <eedelman@gcc.gnu.org>
* symbol.c (check_conflict): Allow allocatable function results,
except for elemental functions.
* trans-array.c (gfc_trans_allocate_temp_array): Rename to ...
(gfc_trans_create_temp_array): ... this, and add new argument callee_alloc.
(gfc_trans_array_constructor, gfc_conv_loop_setup): Update call
to gfc_trans_allocate_temp_array.
* trans-array.h (gfc_trans_allocate_temp_array): Update prototype.
* trans-expr.c (gfc_conv_function_call): Use new arg of
gfc_trans_create_temp_array avoid pre-allocation of temporary
result variables of pointer AND allocatable functions.
(gfc_trans_arrayfunc_assign): Return NULL for allocatable functions.
* resolve.c (resolve_symbol): Copy value of 'allocatable' attribute
from sym->result to sym.
testsuite/
2006-03-08 Paul Thomas <pault@gcc.gnu.org>
Erik Edelmann <eedelman@gcc.gnu.org>
* gfortran.dg/allocatable_function_1.f90: New.
* gfortran.dg/allocatable_function_2.f90: New.
From-SVN: r111951
* config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h
when building with libgloss.
(sh*elf): Implement --without-fp option.
(sh64-superh-linux*): Don't multilib.
From-SVN: r111933
2006-03-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/26499
* gfortran.dg/write_back.f: New test.
* gfortran.dg/write_rewind_1.f: New test.
* gfortran.dg/write_rewind_2.f: New test.
From-SVN: r111925
2006-03-09 Andrew Pinski <pinskia@physics.uc.edu>
* tree-ssa-phiopt.c (tree_ssa_phiopt): Add cfgchanged variable.
Set it when one of the replacement functions returned true.
Return TODO_cleanup_cfg if cfgchanged is true.
(pass_phiopt) <todo_flags_finish>: Remove TODO_cleanup_cfg.
From-SVN: r111920
fortran/
2006-03-09 Erik Edelmann <eedelman@gcc.gnu.org>
* trans-expr.c (gfc_add_interface_mapping): Copy 'allocatable'
attribute from sym to new_sym. Call build_fold_indirect_ref()
for allocatable arguments.
testsuite/
2006-03-09 Erik Edelmann <eedelman@gcc.gnu.org>
* gfortran.dg/allocatable_dummy_1.f90: Test for functions returning
arrays too.
From-SVN: r111910
* config/mips/mips-protos.h (mips_output_conditional_branch): Change
interface.
(mips_output_order_conditional_branch): Declare.
* config/mips/mips.h (MIPS_BRANCH): New macro.
* config/mips/mips.c (gen_conditional_branch): Use VOIDmode
for the comparison. Use gen_condjump.
(mips_output_conditional_branch): Rework interface to take the
asm templates for a direct branch and the inverse of a direct branch.
(mips_output_order_conditional_branch): New function.
(mips_builtin_branch_and_move): New function.
(mips_expand_builtin_compare): Use it. Use VOIDmode for the
branch condition. Use gen_single_cc as the condition for
__builtin_mips_upper_* or __builtin_mips_lower_*.
(mips_expand_builtin_bposge): Use mips_builtin_branch_and_move.
Use VOIDmode for the branch condition.
* config/mips/predicates.md (order_operator): New predicate.
* config/mips/mips.md (UNSPEC_SINGLE_CC): New constant.
(branch_fp): Rename to...
(*branch_fp): ...this. Remove mode from comparison operator.
Use new mips_output_conditional_branch interface.
(branch_fp_inverted): Rename to...
(*branch_fp_inverted): ...this and update as for *branch_fp.
(*branch_zero<mode>): Rename to...
(*branch_order<mode>): ...this. Remove mode from comparison operator.
Use mips_output_order_conditional_branch. Only accept ordered
comparisons.
(*branch_zero<mode>_inverted): Rename to...
(*branch_order<mode>_inverted): ...this and update as for
*branch_order<mode>.
(*branch_equality<mode>): Accept zero as the second operand to
the equality operator. Use the new mips_output_conditional_branch
interface.
(*branch_equality<mode>_inverted): Likewise.
(condjump): New expander.
* config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison
operator.
* config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise.
(bc1any2t, bc1any2f): Likewise.
(single_cc): New expander.
(*branch_upper_lower, *branch_upper_lower_inverted): New patterns.
From-SVN: r111909
* fold-const.c (build_range_check): Make sure to use a valid type to
apply the "(c>=low) && (c<=high) into (c-low>=0) && (c-low<=high-low)"
transformation.
(range_predecessor): New static function.
(range_successor): Likewise.
(merge_ranges): Use them to compute predecessors and successors of
range bounds.
From-SVN: r111866
2006-03-09 Roger Sayle <roger@eyesopen.com>
Eric Botcazou <ebotcazou@libertysurf.fr>
PR middle-end/26561
* fold-const.c (fold_div_compare): When optimizing X/C1 op C2 as
X op C3, consider whether C3 overflows towards +Inf or -Inf.
* gcc.c-torture/execute/divcmp-5.c: New test case.
Co-Authored-By: Eric Botcazou <ebotcazou@libertysurf.fr>
From-SVN: r111862
2006-03-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/26257
* trans-array.c (gfc_conv_expr_descriptor): Exclude calculation of
the offset and data when se->data_not_needed is set.
* trans.h: Include the data_not_need bit in gfc_se.
* trans-intrinsic.c (gfc_conv_intrinsic_size): Set it for SIZE.
2006-03-09 Paul Thomas <pault@gcc.gnu.org>
* PR fortran/26257
gfortran.dg/auto_char_len_3.f90: New test
From-SVN: r111860