Jonathan Wakely [Sat, 6 Aug 2016 12:21:42 +0000 (13:21 +0100)]
Fix construction of std::function from null pointer-to-member
PR libstdc++/69293
* include/std/functional (_Function_base::_M_not_empty_function):
Change overloads for pointers to take arguments by value.
* testsuite/20_util/function/cons/57465.cc: Add tests for
pointer-to-member cases.
Paul Thomas [Fri, 29 Jul 2016 05:16:05 +0000 (05:16 +0000)]
[multiple changes]
2016-07-29 Steven G. Kargl <kargl@gcc.gnu.org>
Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/71883
* frontend-passes.c (gfc_run_passes): Bail out if there are any
errors.
* error.c (gfc_internal_error): If there are any errors in the
buffer, exit with EXIT_FAILURE.
2016-07-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/71883
* gfortran.dg/pr71883.f90 : New test.
rs6000: Fix logic for when to emit .machine (PR71216)
The current logic determining whether to use .machine in the generated
asm code puts it there if the compiler is not configured with a default
target cpu, _or_ no -mcpu= was given on the command line. It should
be "and" instead.
PR target/71216
* config/rs6000/rs6000.c (rs6000_file_start): Fix condition for
when to emit a ".machine" pseudo-op.
backport: re PR fortran/71807 (Internal compiler error with NULL() reference in structure constructor)
gcc/fortran/ChangeLog:
2016-07-22 Andre Vehreschild <vehre@gcc.gnu.org>
Backported from trunk:
PR fortran/71807
* trans-expr.c (gfc_trans_subcomponent_assign): Special casing
when allocatable component is set to null() in initializer.
gcc/testsuite/ChangeLog:
2016-07-22 Andre Vehreschild <vehre@gcc.gnu.org>
Backported from trunk:
PR fortran/71807
* gfortran.dg/null_9.f90: New test.
backport: re PR fortran/70842 (internal compiler error with character members within a polymorphic pointer)
gcc/testsuite/ChangeLog:
2016-07-22 Andre Vehreschild <vehre@gcc.gnu.org>
Backport from trunk:
PR fortran/70842
* gfortran.dg/select_type_35.f03: New test.
gcc/fortran/ChangeLog:
2016-07-22 Andre Vehreschild <vehre@gcc.gnu.org>
Backport from trunk:
PR fortran/70842
* simplify.c (gfc_simplify_len): Only for unlimited polymorphic
types replace the expression's _data ref with a _len ref.
Jakub Jelinek [Wed, 20 Jul 2016 14:16:40 +0000 (16:16 +0200)]
re PR c++/71909 (g++ accepts an unreachable function catch block that lacks a corresponding try)
PR c++/71909
* parser.c (cp_parser_save_member_function_body): Consume
__transaction_relaxed or __transaction_atomic with optional
attribute. Only skip catch with block if try keyword is seen.
* g++.dg/parse/pr71909.C: New test.
* g++.dg/tm/pr71909.C: New test.
Jonathan Wakely [Tue, 19 Jul 2016 17:17:05 +0000 (18:17 +0100)]
libstdc++/71320 Add or remove file permissions correctly
Backport from mainline
2016-06-06 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/71320
* src/filesystem/ops.cc (permissions(const path&, perms, error_code&)):
Add or remove permissions according to perms argument.
* testsuite/experimental/filesystem/operations/permissions.cc: New
test.
Jonathan Wakely [Tue, 12 Jul 2016 10:56:11 +0000 (11:56 +0100)]
Implement N4258 noexcept for std::basic_string.
Backport from mainline
2015-10-02 Jonathan Wakely <jwakely@redhat.com>
* testsuite/21_strings/basic_string/allocator/char/minimal.cc: Guard
explicit instantiation with check for new ABI.
* testsuite/21_strings/basic_string/allocator/wchar_t/minimal.cc:
Likewise. Use wchar_t as char_type.
Backport from mainline
2015-09-11 Jonathan Wakely <jwakely@redhat.com>
Backport from trunk:
2016-07-08 Cesar Philippidis <cesar@codesourcery.com>
gcc/fortran/
* parse.c (matcha): Define.
(decode_oacc_directive): Add spec_only local var and set it. Use
matcha to parse acc directives except for routine and declare. Return
ST_GET_FCN_CHARACTERISTICS if a non-declarative directive could be
matched.
gcc/testsuite/
* gfortran.dg/goacc/pr71704.f90: New test.
Martin Liska [Fri, 8 Jul 2016 20:21:02 +0000 (22:21 +0200)]
Do not consider COMPLEX_TYPE as fold_convertible_p
Backported from mainline
2016-07-08 Martin Liska <mliska@suse.cz>
PR middle-end/71606
* fold-const.c (fold_convertible_p): As COMPLEX_TYPE
folding produces SAVE_EXPRs, thus return false for the type.
Backported from mainline
2016-07-08 Martin Liska <mliska@suse.cz>
rs6000: Fix gcc.target/powerpc/ti_math1.c on GCC 5 (PR69019)
This testcase currently fails on GCC 5, for LE only. Since it is fixed
for 6 and later, and backporting the relevant code is rather invasive,
let's just weaken the testcase for GCC 5 instead.
PR target/69019
* gcc.target/powerpc/ti_math1.c: Allow addze as well as adde.
Jakub Jelinek [Thu, 7 Jul 2016 12:50:01 +0000 (14:50 +0200)]
backport: re PR fortran/71704 (ICE with -fopenmp and some omp constructs)
Backported from mainline
2016-06-30 Jakub Jelinek <jakub@redhat.com>
PR fortran/71704
* parse.c (matchs, matcho): Move right before decode_omp_directive.
If spec_only, only gfc_match the keyword and if successful, goto
do_spec_only.
(matchds, matchdo): Define.
(decode_omp_directive): Add spec_only local var and set it.
Use matchds or matchdo macros instead of matchs or matcho
for declare target, declare simd, declare reduction and threadprivate
directives. Return ST_GET_FCN_CHARACTERISTICS if a non-declarative
directive could be matched.
(next_statement): For ST_GET_FCN_CHARACTERISTICS restore
gfc_current_locus from old_locus even if there is no label.
Jakub Jelinek [Thu, 7 Jul 2016 12:48:16 +0000 (14:48 +0200)]
backport: re PR middle-end/71626 (ICE at -O1 and above on x86_64-linux-gnu (in output_constant_pool_2, at varasm.c:3837))
Backported from mainline
2016-06-28 Jakub Jelinek <jakub@redhat.com>
PR middle-end/71626
* config/i386/i386.c (ix86_expand_vector_move): For SUBREG of
a constant, force its SUBREG_REG into memory or register instead
of whole op1.
* gcc.c-torture/execute/pr71626-1.c: New test.
* gcc.c-torture/execute/pr71626-2.c: New test.
Jakub Jelinek [Thu, 7 Jul 2016 12:47:20 +0000 (14:47 +0200)]
backport: re PR tree-optimization/71588 (ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in execute_todo, at passes.c:2009)
Backported from mainline
2016-06-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/71588
* tree-ssa-strlen.c (valid_builtin_call): New function.
(adjust_last_stmt, handle_builtin_memset, strlen_optimize_stmt): Use
it.
Jakub Jelinek [Thu, 7 Jul 2016 12:46:33 +0000 (14:46 +0200)]
backport: re PR middle-end/71581 (ICE on valid code on x86_64-linux-gnu with -Wuninitialized (Segmentation fault))
Backported from mainline
2016-06-20 Jakub Jelinek <jakub@redhat.com>
PR middle-end/71581
* tree-ssa-uninit.c (warn_uninit): If EXPR and VAR are NULL,
see if T isn't anonymous SSA_NAME with COMPLEX_EXPR created
for conversion of scalar user var to complex type and use the
underlying SSA_NAME_VAR in that case. If EXPR is still NULL,
punt.
Jakub Jelinek [Thu, 7 Jul 2016 12:43:50 +0000 (14:43 +0200)]
backport: re PR middle-end/71494 (label as value in nested function)
Backported from mainline
2016-06-10 Jakub Jelinek <jakub@redhat.com>
PR middle-end/71494
* tree-nested.c (convert_nonlocal_reference_stmt): For GIMPLE_GOTO
without LABEL_DECL, set *handled_ops_p to false instead of true.
Jakub Jelinek [Thu, 7 Jul 2016 12:42:43 +0000 (14:42 +0200)]
backport: re PR sanitizer/71498 (ubsan bounds checking influenced by surrounding code)
Backported from mainline
2016-06-13 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/71498
* c-gimplify.c (ubsan_walk_array_refs_r): Set *walk_subtrees = 0 on
all BIND_EXPRs, and on all BIND_EXPRs recurse also on BIND_EXPR_BODY.
Jakub Jelinek [Thu, 7 Jul 2016 12:41:25 +0000 (14:41 +0200)]
backport: re PR c++/70641 (ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed)
Backported from mainline
2016-04-13 Jakub Jelinek <jakub@redhat.com>
PR c++/70641
* ipa-pure-const.c (pass_nothrow::execute): Call maybe_clean_eh_stmt
on all recursive call stmts. Return TODO_cleanup_cfg if any dead
eh edges have been purged.
PR debug/70628
* rtl.h (convert_memory_address_addr_space_1): New prototype.
* explow.c (convert_memory_address_addr_space_1): No longer static,
add NO_EMIT argument and don't call convert_modes if true, pass
it down recursively, remove break after return.
(convert_memory_address_addr_space): Adjust caller.
* simplify-rtx.c (simplify_unary_operation_1): Call
convert_memory_address_addr_space_1 instead of convert_memory_address,
if it returns NULL, don't simplify.
Jakub Jelinek [Thu, 7 Jul 2016 12:34:07 +0000 (14:34 +0200)]
backport: re PR target/70574 (wrong code with -mavx2, read of partially initialised stack variable)
Backported from mainline
2016-04-08 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/70574
* fwprop.c (forward_propagate_and_simplify): Don't add
REG_EQUAL note if DF_REF_REG (use) is a paradoxical subreg.
(try_fwprop_subst): Don't add REG_EQUAL note if there are any
paradoxical subregs within *loc.
Jakub Jelinek [Thu, 7 Jul 2016 12:33:10 +0000 (14:33 +0200)]
backport: re PR c++/70336 (Incorrect Wconversion warning)
Backported from mainline
2016-04-05 Jakub Jelinek <jakub@redhat.com>
PR c++/70336
* match.pd (nested int casts): Limit to GIMPLE.
* c-c++-common/pr70336.c: New test.
* gcc.dg/torture/builtin-isinf_sign-1.c (foo): Guard tests
no longer optimized away at -O0 with #ifndef __OPTIMIZE__.
Richard Biener [Thu, 7 Jul 2016 10:33:01 +0000 (10:33 +0000)]
backport: [multiple changes]
2016-07-07 Richard Biener <rguenther@suse.de>
Backport from mainline
2016-06-07 Richard Biener <rguenther@suse.de>
PR middle-end/71423
* match.pd ((X | ~Y) -> Y <= X): Properly invert the comparison
for signed ops.
* gcc.dg/torture/pr71423.c: New testcase.
2016-06-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/71452
* tree-ssa.c (non_rewritable_lvalue_p): Make sure that the
type used for the SSA rewrite has enough precision to cover
the dynamic type of the location.
* gcc.dg/torture/pr71452.c: New testcase.
2016-06-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/71522
* tree-ssa.c (non_rewritable_lvalue_p): Do not rewrite non-float
copying into float copying.
backport: re PR libstdc++/71313 ([Filesystem TS] remove_all fails to remove directory contents recursively)
Backport from mainline
2016-07-04 Ville Voutilainen <ville.voutilainen@gmail.com>
PR libstdc++/71313
* src/filesystem/ops.cc (remove_all(const path&, error_code&)):
Call remove_all for children of a directory.
* testsuite/experimental/filesystem/operations/create_directories.cc:
Adjust.
Jakub Jelinek [Thu, 30 Jun 2016 09:08:32 +0000 (11:08 +0200)]
re PR middle-end/71693 (ICE: verify_gimple failed (type mismatch in shift expression, -O0, -O1, -O2, -O3))
PR middle-end/71693
* fold-const.c (fold_binary_loc) <case RROTATE_EXPR>: Cast
TREE_OPERAND (arg0, 0) and TREE_OPERAND (arg0, 1) to type
first when permuting bitwise operation with rotate. Cast
TREE_OPERAND (arg0, 0) to type when cancelling two rotations.