2018-03-06 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/56667
* primary.c (match_sym_complex_part): Give the matcher for an implied
do-loop a chance to run.
2018-03-06 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/56667
* gfortran.dg/implied_do_2.f90: New test.
* gfortran.dg/coarray_8.f90: Update for new error message.
From-SVN: r258281
* gcc-interface/trans.c (convert_with_check): Fix typo in the condition
guarding the overflow check emitted for the upper bound of a floating-
point conversion.
From-SVN: r258277
A non-type-dependent COND_EXPR within a template is reconstructed with
the original operands, after one with non-dependent proxies is built to
determine its result type. This is problematic because the operands of
a COND_EXPR determined to be an rvalue may have been converted to denote
their rvalue nature. The reconstructed one, however, won't have such
conversions, so lvalue_kind may not recognize it as an rvalue, which may
lead to e.g. incorrect overload resolution decisions.
If we mistake such a COND_EXPR for an lvalue, overload resolution might
regard a conversion sequence that binds it to a non-const reference as
viable, and then select that over one that binds it to a const
reference. Only after template substitution would we rebuild the
COND_EXPR, realize it is an rvalue, and conclude the reference binding
is ill-formed, but at that point we'd have long discarded any alternate
candidates we could have used.
This patch modifies the logic that determines whether a
(non-type-dependent) COND_EXPR in a template is an lvalue, to rely on
its type, more specifically, on the presence of a REFERENCE_TYPE
wrapper. In order to avoid a type bootstrapping problem, the
REFERENCE_TYPE that wraps the type of some such COND_EXPRs is
introduced earlier, so that we don't have to test for lvalueness of
the expression using the very code that we wish to change.
for gcc/cp/ChangeLog
PR c++/84231
* tree.c (lvalue_kind): Use presence/absence of REFERENCE_TYPE
only while processing template decls.
* typeck.c (build_x_conditional_expr): Move wrapping of
reference type around type...
* call.c (build_conditional_expr_1): ... here. Rename
is_lvalue to is_glvalue.
* parser.c (cp_parser_fold_expression): Catch REFERENCE_REF_P
INDIRECT_REF of COND_EXPR too.
for gcc/testsuite/ChangeLog
PR c++/84231
* g++.dg/pr84231.C: New.
From-SVN: r258271
If an initializer expr is to be NULL in a ctor initializer list, we
ICE in picflag_from_initializer and elsewhere.
If we're missing an initializer for a reference field, we report the
error, but then build a zero initializer to avoid the ICE.
for gcc/cp/ChangeLog
PR c++/84593
* init.c (build_zero_init_1): Zero-initialize references.
for gcc/testsuite/ChangeLog
PR c++/84593
* g++.dg/cpp1y/pr84593.C: New.
From-SVN: r258270
We ICEd when returning a stmt expr that ends with an overloaded
function, because instantiate_type did not know what to do with
STMT_EXPRs. And it shouldn't have to: the expected type of a stmt
expr cannot be used to resolve its value: an unresolved overload
cannot supply the result of a stmt expr. Catch that and report the
error in the stmt expr before we have a chance to instantiate it.
for gcc/cp/ChangeLog
PR c++/84492
* semantics.c (finish_stmt_expr_expr): Reject unresolved
overloads used as stmt expr values.
for gcc/testsuite/ChangeLog
PR c++/84492
* g++.dg/pr84492.C: New.
From-SVN: r258269
[gcc]
2018-03-05 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/rs6000-builtin.def (rs6000_speculation_barrier):
Rename to ppc_speculation_barrier.
* config/rs6000/rs6000.c (rs6000_init_builtins): Rename builtin to
__builtin_ppc_speculation_barrier.
[gcc/testsuite]
2018-03-05 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* gcc.target/powerpc/spec-barr-1.c: Change called function name to
__builtin_ppc_speculation_barrier.
From-SVN: r258268
PR target/84700
* combine.c (combine_simplify_rtx): Don't try to simplify if
if_then_else_cond returned non-NULL, but either true_rtx or false_rtx
are equal to x.
* gcc.target/powerpc/pr84700.c: New test.
From-SVN: r258263
For POWER4..POWER8 we align loops of 5..8 instructions to 32 bytes
(instead of to 16 bytes) because that executes faster. This is no
longer the case on POWER9, so we can just as well only align to 16
bytes.
* config/rs6000/rs6000.c (rs6000_loop_align): Don't align tiny loops
to 32 bytes when compiling for POWER9.
From-SVN: r258260
PR target/84564
* config/i386/i386.c (ix86_function_ok_for_sibcall): Check for
regparm >= 3 with no arg reg available also for calls with
flag_force_indirect_call. Pass decl to ix86_function_regparm.
* gcc.target/i386/pr84564.c: New test.
From-SVN: r258256
2018-03-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/84486
* tree-ssa-pre.c (create_expression_by_pieces): Remove dead code.
When inserting a __builtin_assume_aligned call set the LHS
SSA name alignment info accordingly.
From-SVN: r258249
As discussed in the PR, the reassociation phase runs before FMAs are formed
and so can significantly reduce FMA opportunities. Although reassociation
could be switched off, it helps in many cases, so a better alternative is to
only avoid reassociation of floating point additions. This fixes the testcase
and gives 1% speedup on SPECFP2017, fixing the performance regression.
gcc/
PR tree-optimization/84114
* config/aarch64/aarch64.c (aarch64_reassociation_width)
Avoid reassociation of FLOAT_MODE addition.
From-SVN: r258248
2018-03-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/84670
* tree-ssa-pre.c (struct bb_bitmap_sets): Add visited_with_visited_succs
member.
(BB_VISITED_WITH_VISITED_SUCCS): New define.
(compute_antic): Initialize BB_VISITED_WITH_VISITED_SUCCS.
(compute_antic_aux): Only assert the number of values in ANTIC_IN
doesn't grow if all successors (recursively) were visited at least
once.
* gcc.dg/pr84670-1.c: New testcase.
* gcc.dg/pr84670-2.c: Likewise.
* gcc.dg/pr84670-3.c: Likewise.
* gcc.dg/pr84670-4.c: Likewise.
From-SVN: r258243
2018-03-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/84650
* tree-ssa-loop-im.c (pass_lim::execute): Reset the SCEV cache
if executed in the loop pipeline.
* gcc.dg/graphite/pr84650.c: New testcase.
From-SVN: r258242
2018-03-03 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66128
* simplify.c (is_size_zero_array): New function to check for size
zero array.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_simplify_minval, gfc_simplify_maxval, gfc_simplify_norm2,
gfc_simplify_product, gfc_simplify_sum): Use it, and implement
requirements from F2018.
2018-03-03 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66128
* gfortran.dg/zero_sized_8.f90: New test.
From-SVN: r258223
2018-03-03 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/51434
* simplify.c (gfc_simplify_transfer): Resolve mold.
2018-03-03 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/51434
* gfortran.dg/pr51434.f90: New test.
From-SVN: r258220
/cp
2018-03-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71464
* optimize.c (maybe_thunk_body): Bail out immediately if either
fns[0] or fns[1] is null.
/testsuite
2018-03-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71464
* g++.dg/torture/pr71464.C: New.
From-SVN: r258216
2018-03-03 Paul Thomas <pault@gcc.gnu.org>
PR fortran/80965
* resolve.c (build_loc_call): Change symtree name from 'loc' to
'_loc'.
2018-03-03 Paul Thomas <pault@gcc.gnu.org>
PR fortran/80965
* gfortran.dg/select_type_41.f90: New test.
From-SVN: r258195