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.
David Edelsohn [Wed, 15 Jun 2016 14:43:09 +0000 (14:43 +0000)]
David Edelsohn <dje.gcc@gmail.com>
Backport from mainline
2016-06-13 David Edelsohn <dje.gcc@gmail.com>
* inclhack.def (aix_stdlib_malloc): New fix.
(aix_stdlib_realloc): New fix.
(aix_stdlib_calloc): New fix.
(aix_stdlib_valloc): New fix.
* fixincl.x: Regenerate.
* tests/base/stdlib.h [AIX_STDLIB_MALLOC]: New test.
[AIX_STDLIB_REALLOC]: New test.
[AIX_STDLIB_CALLOC]: New test.
[AIX_STDLIB_VALLOC]: New test.
Paul Thomas [Thu, 2 Jun 2016 17:44:59 +0000 (17:44 +0000)]
re PR fortran/70350 (ICE with -fcheck=all and array initialization)
2016-06-02 Paul Thomas <pault@gcc.gnu.org>
PR fortran/70350
Backport from trunk.
* trans-expr.c (gfc_trans_assignment_1): Exclude initialization
assignments from check on assignment of scalars to unassigned
arrays and correct wrong code within the corresponding block.
PR target/68696
* config/aarch64/aarch64-simd.md (*aarch64_simd_bsl<mode>_alt):
New pattern.
(aarch64_simd_bsl<mode>_internal): Update comment to reflect
the above.
Backport from mainline
2016-04-19 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/69703
* src/c++11/codecvt.cc (__codecvt_utf8_base<char16_t>::do_in)):
Override endianness bit in mode.
* testsuite/22_locale/codecvt/codecvt_utf8/69703.cc: New test.
* testsuite/22_locale/codecvt/codecvt_utf8_utf16/66855.cc: Test
that little_endian mode is ignored.
* testsuite/experimental/filesystem/path/native/string.cc: New test.
Jonathan Wakely [Wed, 25 May 2016 15:43:17 +0000 (16:43 +0100)]
Test begin and end functions for directory iterators
Backport from mainline
2016-05-10 Jonathan Wakely <jwakely@redhat.com>
* include/experimental/bits/fs_dir.h (begin, end): Add noexcept.
* testsuite/experimental/filesystem/iterators/directory_iterator.cc:
Test begin and end functions.
* testsuite/experimental/filesystem/iterators/
recursive_directory_iterator.cc: Likewise.
Jonathan Wakely [Wed, 25 May 2016 15:42:57 +0000 (16:42 +0100)]
libstdc++/71037 Add base path to filesystem::canonical exceptions
Backport from mainline
2016-05-10 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/71037
* src/filesystem/ops.cc (canonical(const path&, const path&)): Add
base path to exception.
* testsuite/experimental/filesystem/operations/canonical.cc: Test
paths contained in exception.
Jonathan Wakely [Wed, 25 May 2016 15:42:40 +0000 (16:42 +0100)]
libstdc++/70609 fix filesystem::copy()
Backport from mainline
2016-04-19 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/70609
* src/filesystem/ops.cc (close_fd): New function.
(do_copy_file): Set permissions before copying file contents. Check
result of closing file descriptors. Don't copy streambuf when file
is empty.
(copy(const path&, const path&, copy_options, error_code&)): Use
lstat for source file when copy_symlinks is set.
* testsuite/experimental/filesystem/operations/copy.cc: Test copy().