2017-12-16 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Backport from trunk
PR libgfortran/78549
* io/inquire.c (inquire_via_unit): Adjust test for existence for
pre-connected internal units.
* io/transfer.c (finalize_transfer): When done with a transfer
to internal units, free the format buffer and close the stream.
(st_read_done): Delete freeing the stream, now handled using
sclose in finalize_transfer. (st_write_done): Likewise.
* io/unit.c (get_unit): Return NULL for special reserved unit
numbers, signifying not accessible to the user.
(init_units): Insert the two special internal units into the
unit treap. This makes these unit structures available without
further allocations for later use by internal unit I/O. These
units are automatically deleted by normal program termination.
* io/unix.c (mem_close): Add a guard check to protect from double free.
From-SVN: r255751
Backported from mainline
2017-12-15 Jakub Jelinek <jakub@redhat.com>
PR c++/83205
* decl.c (cp_finish_decomp): Handle the case when tsize is not
error_mark_node, but doesn't fit into uhwi. Split up count != eltscnt
and !tree_fits_uhwi_p (tsize) error_at calls into error_n and inform_n
to handle plural forms properly.
* g++.dg/cpp1z/decomp3.C: Adjust for structured binding count
mismatch diagnostics split into error and warning with plural
forms.
* g++.dg/cpp1z/decomp10.C: Likewise.
* g++.dg/cpp1z/decomp32.C: New test.
From-SVN: r255736
PR c++/83217
* decl.c (cp_finish_decomp): If decl's type is REFERENCE_TYPE,
call complete_type (TREE_TYPE (type)).
* g++.dg/cpp1z/decomp33.C: New test.
From-SVN: r255730
PR tree-optimization/83269
* fold-const.c (fold_binary_loc): Perform (-A) - B -> (-B) - A
subtraction in arg0's type if type is signed and arg0 is unsigned.
Formatting fix.
* gcc.c-torture/execute/pr83269.c: New test.
From-SVN: r255729
Backported from mainline
2017-12-14 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/83198
* gimple-ssa-sprintf.c (format_floating): Set type solely based on
dir.modifier, regardless of TREE_TYPE (arg). Assume non-REAL_CST
value if arg is a REAL_CST with incompatible type.
* gcc.dg/pr83198.c: New test.
* gcc.dg/tree-ssa/pr83198.c: New test.
From-SVN: r255728
Backported from mainline
2017-12-12 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/80631
* tree-vect-loop.c (get_initial_def_for_reduction): Fix comment typo.
(vect_create_epilog_for_reduction): Add INDUC_VAL argument, for
INTEGER_INDUC_COND_REDUCTION use INDUC_VAL instead of
hardcoding zero as the value if COND_EXPR is never true. For
INTEGER_INDUC_COND_REDUCTION don't emit the final COND_EXPR if
INDUC_VAL is equal to INITIAL_DEF.
(vectorizable_reduction): Compute INDUC_VAL for
vect_create_epilog_for_reduction, if no value is suitable, don't
use INTEGER_INDUC_COND_REDUCTION for now. Formatting fixes.
* gcc.dg/vect/pr80631-1.c: New test.
* gcc.dg/vect/pr80631-2.c: New test.
PR tree-optimization/80631
* gcc.target/i386/avx2-pr80631.c: New test.
From-SVN: r255726
Backported from mainline
2017-12-06 Jakub Jelinek <jakub@redhat.com>
PR c++/80259
* decl2.c (grokfield): Diagnose = delete redefinition of a friend.
* g++.dg/cpp0x/pr80259.C: New test.
From-SVN: r255723
Backported from mainline
2017-12-02 Jakub Jelinek <jakub@redhat.com>
PR c++/81212
* tree-cfg.c (pass_warn_function_return::execute): Handle
__builtin_ubsan_handle_missing_return like __builtin_unreachable
with BUILTINS_LOCATION.
* g++.dg/ubsan/pr81212.C: New test.
From-SVN: r255722
Backported from mainline
2017-12-02 Jakub Jelinek <jakub@redhat.com>
PR target/78643
PR target/80583
* expr.c (get_inner_reference): If DECL_MODE of a non-bitfield
is BLKmode for vector field with vector raw mode, use TYPE_MODE
instead of DECL_MODE.
* gcc.target/i386/pr80583.c: New test.
From-SVN: r255721
Backported from mainline
2017-11-27 Jakub Jelinek <jakub@redhat.com>
PR c++/81888
* parser.c (cp_parser_decomposition_declaration): Reject just
BRACE_ENCLOSED_INITIALIZER_P initializers with nelts != 1 rather
than all such CONSTRUCTORs, and only if is_direct_init is true.
* g++.dg/cpp1z/decomp30.C: Add a test for structured binding with
= {} and = { a, a } initializers.
* g++.dg/cpp1z/decomp31.C: New test.
From-SVN: r255719
Backported from mainline
2017-11-27 Jakub Jelinek <jakub@redhat.com>
PR c++/81675
* cp-gimplify.c (cp_fold) <case COND_EXPR>: Don't return immediately
for VOID_TYPE_P COND_EXPRs, instead fold the operands and if op0 is
INTEGER_CST, ensure that both op1 and op2 are non-NULL and fall
through into normal folding, otherwise just rebuild x if any op
changed.
* g++.dg/warn/pr81675.C: New test.
From-SVN: r255718
Backported from mainline
2017-11-25 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/81553
* combine.c (simplify_if_then_else): In (if_then_else COND (OP Z C1) Z)
to (OP Z (mult COND (C1 * STORE_FLAG_VALUE))) optimization, if OP
is a shift where C1 has different mode than the whole shift, use C1's
mode for MULT rather than the shift's mode.
* gcc.c-torture/compile/pr81553.c: New test.
From-SVN: r255717
Backported from mainline
2017-11-24 Jakub Jelinek <jakub@redhat.com>
PR fortran/81304
* trans-openmp.c (gfc_trans_omp_array_reduction_or_udr): Set
attr.implicit_type in intrinsic_sym to avoid undesirable warning.
* testsuite/libgomp.fortran/pr81304.f90: New test.
From-SVN: r255716
Backported from mainline
2017-11-24 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/83014
* ubsan.c (ubsan_type_descriptor): Use pp_unsigned_wide_integer
instead of pp_printf with HOST_WIDE_INT_PRINT_DEC. Avoid calling
tree_to_uhwi twice.
* gcc.dg/ubsan/pr83014.c: New test.
From-SVN: r255715
Backported from mainline
2017-11-24 Jakub Jelinek <jakub@redhat.com>
* tree-object-size.c (pass_through_call): Do not handle
BUILT_IN_STPNCPY_CHK which is not a pass through call.
* gcc.dg/builtin-object-size-18.c: New test.
From-SVN: r255714
Backported from mainline
2017-11-23 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_omp_declare): Change return type to bool from
void, return true for declare simd.
(cp_parser_pragma): Return cp_parser_omp_declare returned value
rather than always false.
From-SVN: r255713
Backported from mainline
2017-11-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/82253
* expr.c (expand_assignment): For CONCAT to_rtx, complex type from and
bitpos/bitsize covering the whole destination, use store_expr only if
the complex mode is the same. Otherwise, use expand_normal and if
it returns CONCAT, subreg each part separately instead of trying to
subreg the whole result.
* gfortran.dg/pr82253.f90: New test.
From-SVN: r255711
Backported from mainline
2017-11-22 Jakub Jelinek <jakub@redhat.com>
PR debug/83084
* valtrack.c (propagate_for_debug_subst, propagate_for_debug): Reset
debug insns if they would contain UNSPEC_VOLATILE or volatile asm.
(dead_debug_insert_temp): Likewise, but also ignore even non-volatile
asm.
* g++.dg/opt/pr83084.C: New test.
From-SVN: r255710
Backported from mainline
2017-11-21 James Cowgill <James.Cowgill@imgtec.com>
Jakub Jelinek <jakub@redhat.com>
PR target/82880
* config/mips/frame-header-opt.c (mips_register_frame_header_opt):
Remove static keyword from f variable.
* gcc.dg/opts-8.c: New test.
From-SVN: r255709
Backported from mainline
2017-11-21 Jakub Jelinek <jakub@redhat.com>
PR c++/83059
* c-common.c (get_atomic_generic_size): Use TREE_INT_CST_LOW
instead of tree_to_uhwi, formatting fix.
* c-c++-common/pr83059.c: New test.
From-SVN: r255708
Backported from mainline
2017-11-20 Jakub Jelinek <jakub@redhat.com>
PR c++/82781
* constexpr.c (cxx_eval_vector_conditional_expression): New function.
(cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
of cxx_eval_conditional_expression.
* g++.dg/ext/constexpr-pr82781.C: New test.
From-SVN: r255707
2017-12-15 Richard Biener <rguenther@suse.de>
PR bootstrap/83439
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
Adjust remaining gimple_set_modified to use the modified
variable instead.
From-SVN: r255704
2017-12-15 Richard Biener <rguenther@suse.de>
Backport from mainline
PR tree-optimization/82060
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
Move devirtualization after stmt folding and before EH/AB/noreturn
cleanup to get the stmt refs canonicalized. Use a bool instead
of gimple_modified_p since that doesn't work for NOPs. Schedule
NOPs generated by folding for removal.
* g++.dg/torture/pr82060.C: New testcase.
From-SVN: r255682
2017-12-15 Richard Biener <rguenther@suse.de>
Backport from mainline
2017-09-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/82102
* tree-ssa-pre.c (eliminate): Check if lhs is NULL.
* gcc.dg/torture/pr82102.c: New testcase.
2017-09-13 Richard Biener <rguenther@suse.de>
PR middle-end/82128
* gimple-fold.c (gimple_fold_call): Update SSA name in-place to
default-def to avoid breaking iterator update with the weird
interaction with cgraph_update_edges_for_call_stmt_node.
* g++.dg/pr82128.C: New testcase.
From-SVN: r255678
2017-12-15 Richard Biener <rguenther@suse.de>
Backport from mainline
2017-11-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/82402
* tree-vect-loop-manip.c (create_lcssa_for_virtual_phi): Properly
set SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
* gcc.dg/torture/pr82402.c: New testcase.
2017-10-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/82697
* tree-ssa-phiopt.c (cond_store_replacement): Use alias-set
zero for conditional load and unconditional store.
* gcc.dg/torture/pr82697.c: New testcase.
2017-11-02 Richard Biener <rguenther@suse.de>
PR middle-end/82765
* varasm.c (decode_addr_const): Make offset HOST_WIDE_INT.
Truncate ARRAY_REF index and element size.
* gcc.dg/pr82765.c: New testcase.
2017-11-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/82902
* tree-ssa-phiprop.c (propagate_with_phi): Test proper type.
* g++.dg/torture/pr82902.C: New testcase.
From-SVN: r255677
gcc/
Backport from mainline
2017-10-02 Peter Bergner <bergner@vnet.ibm.com>
PR target/80210
* config/rs6000/rs6000.c (rs6000_option_override_internal): Rewrite
function to not use the have_cpu variable. Do not set cpu_index,
rs6000_cpu_index or rs6000_tune_index if we end up using TARGET_DEFAULT
or the default cpu.
(rs6000_valid_attribute_p): Remove duplicate initializations of
old_optimize and func_optimize.
(rs6000_pragma_target_parse): Call rs6000_activate_target_options ().
(rs6000_activate_target_options): Make global.
* config/rs6000/rs6000-protos.h (rs6000_activate_target_options): Add
prototype.
gcc/testsuite/
Backport from mainline
2017-10-02 Peter Bergner <bergner@vnet.ibm.com>
PR target/80210
* gcc.target/powerpc/pr80210-2.c: New test.
From-SVN: r255655
PR libstdc++/59568
* include/std/complex (operator>>): Only use putback if a character
was successfully extracted and only set the value if a number was
successfully extracted.
* testsuite/26_numerics/complex/inserters_extractors/char/59568.cc:
New test.
From-SVN: r255633
gcc/
Backport from mainline
2017-12-13 Peter Bergner <bergner@vnet.ibm.com>
* config/rs6000/ppc-auxv.h (PPC_FEATURE2_HTM_NO_SUSPEND): New define.
* config/rs6000/rs6000.c (cpu_supports_info): Use it.
gcc/testsuite/
Backport from mainline
2017-12-13 Peter Bergner <bergner@vnet.ibm.com>
* gcc.target/powerpc/cpu-builtin-1.c (htm-no-suspend): Add test.
From-SVN: r255622
* gcc-interface/decl.c (gnat_to_gnu_entity): Robustify test for types
descendant of System.Address.
(gnat_to_gnu_subprog_type): Likewise.
From-SVN: r255600
[gcc]
2017-12-11 Michael Meissner <meissner@linux.vnet.ibm.com>
Back port from trunk
2017-12-01 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/81959
* config/rs6000/rs6000.c (rs6000_address_for_fpconvert): Check for
whether we can allocate pseudos before trying to fix an address.
* config/rs6000/rs6000.md (float_<mode>si2_hw): Make sure the
memory address is indexed or indirect.
(floatuns_<mode>si2_hw2): Likewise.
[gcct/testsuite]
2017-12-11 Michael Meissner <meissner@linux.vnet.ibm.com>
Back port from trunk
2017-12-01 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/81959
* gcc.target/powerpc/pr81959.c: New test.
From-SVN: r255545
ChangeLog entry are as follow:
*** gcc/ChangeLog ***
2017-12-11 Sudakshina Das <sudi.das@arm.com>
Backported from trunk
2017-12-01 Sudakshina Das <sudi.das@arm.com>
* config/arm/vfp.md (*movhf_vfp_fp16): Add conds attribute.
*** gcc/testsuite/ChangeLog ***
2017-12-11 Sudakshina Das <sudi.das@arm.com>
Backported from trunk
2017-12-01 Sudakshina Das <sudi.das@arm.com>
* gcc.target/arm/armv8_2-fp16-move-2.c: New test.
From-SVN: r255541
2017-12-10 Tom de Vries <tom@codesourcery.com>
backport from trunk:
2017-09-16 Tom de Vries <tom@codesourcery.com>
PR c/81875
* c-parser.c (c_parser_omp_for_loop): Fold only operands of cond, not
cond itself.
* testsuite/libgomp.c/pr81875.c: New test.
From-SVN: r255531