2008-10-31 Mikael Morin <mikael.morin@tele2.fr>
PR fortran/35840
* expr.c (gfc_reduce_init_expr): New function, containing checking code
from gfc_match_init_expr, so that checking can be deferred.
(gfc_match_init_expr): Use gfc_reduce_init_expr.
* io.c (check_io_constraints): Use gfc_reduce_init_expr instead of
checking that the expression is a constant.
* match.h (gfc_reduce_init_expr): Prototype added.
2008-10-31 Mikael Morin <mikael.morin@tele2.fr>
PR fortran/35840
* gfortran.dg/write_check4.f90: New test.
From-SVN: r141497
2008-10-31 Mikael Morin <mikael.morin@tele2.fr>
PR fortran/35820
* resolve.c (gfc_count_forall_iterators): New function.
(gfc_resolve_forall): Use gfc_count_forall_iterators to evaluate
the needed memory amount to allocate. Don't forget to free allocated
memory. Add an assertion to check for memory leaks.
2008-10-16 Mikael Morin <mikael.morin@tele2.fr>
PR fortran/35820
* gfortran.dg/nested_forall_1.f: New test.
From-SVN: r141496
2008-10-30 Steven G. Kargl <kargls@comcast.net>
PR fortran/37930
* fortran/arith.c (gfc_mpfr_to_mpz): Test for NaN and Inf values.
Remove stale comment and kludge code for MPFR 2.0.1 and older.
(gfc_real2int): Error on conversion of NaN or Inf.
(gfc_complex2int): Ditto.
* fortran/arith.h: Update mpfr_to_mpz prototype.
* fortran/simplify.c (gfc_simplify_ceiling, gfc_simplify_floor,
gfc_simplify_ifix, gfc_simplify_idint, simplify_nint): Update function
calls to include locus.
From-SVN: r141488
2008-10-30 Mikael Morin <mikael.morin@tele2.fr>
PR fortran/37903
* trans-array.c (gfc_trans_create_temp_array): If n is less
than the temporary dimension, assert that loop->from is
zero (reverts to earlier versions). If there is at least one
null loop->to[n], it is a callee allocated array so set the
size to NULL and break.
(gfc_trans_constant_array_constructor): Set the offset to zero.
(gfc_trans_array_constructor): Remove loop shifting around the
temporary creation.
(gfc_conv_loop_setup): Prefer zero-based descriptors if
possible. Calculate the translation from loop variables to
array indices if an array constructor.
2008-10-30 Mikael Morin <mikael.morin@tele2.fr>
PR fortran/37749
* trans-array.c (gfc_trans_create_temp_array): If size is NULL
use the array bounds for loop->to.
2008-10-30 Mikael Morin <mikael.morin@tele2.fr>
PR fortran/37903
* gfortran.dg/vector_subscript_4.f90: New test.
2008-10-30 Mikael Morin <mikael.morin@tele2.fr>
PR fortran/37749
* gfortran.dg/vector_subscript__5.f90: New test.
From-SVN: r141467
PR middle-end/37730
* expr.c (store_constructor): For vectors, if target is a MEM, use
target's MEM_ALIAS_SET instead of elttype alias set.
* gcc.dg/vect/pr37730.c: New test.
From-SVN: r141461
PR middle-end/36578
* convert.c (convert_to_real): Do not optimize conversions of
binary arithmetic operations between binary and decimal
floating-point types. Consider mode of target type in determining
decimal type for arithmetic. Unless
flag_unsafe_math_optimizations, do not optimize binary conversions
where this may change rounding behavior.
* real.c (real_can_shorten_arithmetic): New.
* real.h (real_can_shorten_arithmetic): Declare.
testsuite:
* gcc.dg/dfp/convert-bfp-13.c, gcc.dg/dfp/convert-bfp-14.c,
gcc.dg/dfp/convert-dfp-fold-2.c, gcc.target/i386/pr36578-1.c,
gcc.target/i386/pr36578-2.c: New tests.
From-SVN: r141432
* config/bfin/bfin-protos.h (WA_05000257, WA_05000283, WA_05000315,
ENABLE_WA_05000257, ENABLE_WA_05000283, ENABLE_WA_05000315): New.
* config/bfin/bfin.c (bfin_cpus): Add these workaround bits as
appropriate.
(must_save_p): For some workarounds, interrupts need to clobber a
P register.
(expand_prologue_reg_save, expand_epilogue_reg_restore): Save LC0
and LC1 for WA_05000257.
(expand_interrupt_handler_prologue): Add dummy read of CHIPID for
WA_05000283 and WA_05000315.
* config/bfin/bfin.md (UNSPEC_VOLATILE_DUMMY): New constant.
(movbi): Add alternative to set CC to 1; improve code for setting
CC to 0.
(dummy_load): New pattern.
From-SVN: r141431
PR middle-end/37870
* expmed.c (extract_bit_field_1): If int_mode_for_mode returns
BLKmode for non-memory, convert using a wider MODE_INT mode
or through memory.
* gcc.target/i386/pr37870.c: New test.
From-SVN: r141430
2008-10-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/26997
cp/
* parser.c (cp_parser_token_starts_cast_expression): New.
(cp_parser_cast_expression): Peek the next token to decide whether
this could be a parenthesized constructor or is definitely an
actual cast.
testsuite/
* g++.dg/parse/pr26997.C: New.
From-SVN: r141429
PR middle-end/37913
* tree-cfgcleanup.c (split_bbs_on_noreturn_calls): Only split bbs
that haven't been removed yet.
* gcc.c-torture/compile/pr37913.c: New test.
From-SVN: r141426
* config/bfin/bfin.c (struct machine_function): New member
has_loopreg_clobber.
(bfin_expand_movmem): Set it when generating memcpy insns.
(n_regs_saved_by_prologue, expand_prologue_reg_save,
expand_epilogue_reg_restore): If we have hardware loops,
memcpy insns (indicated by has_loopreg_clobber) or function
calls, we need to save the loop registers.
From-SVN: r141425
* convert.c (strip_float_extensions): Do not remove or introduce
conversions between binary and decimal floating-point types.
testsuite:
* gcc.dg/dfp/convert-bfp-12.c: New test.
From-SVN: r141407
PR middle-end/37931
* fold-const.c (distribute_bit_expr): Convert common, left and
right arguments to type.
* gcc.c-torture/execute/pr37931.c: New test.
From-SVN: r141406
* config/mn10300/mn10300.h (CALL_REALLY_USED_REGISTERS): Define.
* config/mn10300/mn10300.c (fp_regs_to_save): Test the
call_really_used_regs array rather than the call_used_regs array.
(mn10300_get_live_callee_saved_regs, expand_prologue,
expand_epilogue, output_tst): Likewise.
From-SVN: r141405
PR tree-optimization/37879
* predict.c (tree_estimate_probability): Check if last_stmt is
non-NULL before dereferencing it.
* gcc.dg/pr37879.c: New test.
From-SVN: r141390
2008-10-27 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/37919
Revert:
2008-10-18 Douglas Gregor <doug.gregor@gmail.com>
* include/bits/stl_pair.h (__may_be_null_pointer_init): New.
(pair::pair): Eliminate the redundant pair(U1&&, U2&&) constructor.
Add lvalue pair<U1, U2> constructor to handle non-const pair lvalues.
Remove the old variadic constructor, and instead provide several
variadic constructors that avoid failing when attempting to
initialize a pointer from a null pointer constant.
* testsuite/20_util/pair/moveable.cc (test3): Add new tests with
initialization of pointers from the null pointer constant.
From-SVN: r141388