Backport from mainline
2016-08-11 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR tree-optimization/71083
* gcc.c-torture/execute/pr71083.c: New test.
* gnat.dg/loop_optimization23.adb: New test.
* gnat.dg/loop_optimization23_pkg.ads: New test.
* gnat.dg/loop_optimization23_pkg.adb: New test.
Thomas Koenig [Mon, 8 Aug 2016 22:00:37 +0000 (22:00 +0000)]
backport: re PR fortran/60526 (Accepts-invalid: Variable name same as type name)
2016-08-08 Thomas Koenig <tkoenig@gcc.gnu.org>
Backport from trunk
PR fortran/60526
* decl.c (build_sym): If the name has already been defined as a
type, it has a symtree with an upper case letter at the beginning.
If such a symtree exists, issue an error and exit. Don't do
this if there is no corresponding upper case letter.
2016-08-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/60526
* gfortran.dg/type_decl_4.f90: New test.
backport: re PR rtl-optimization/71976 (insn-combiner deletes a live 64-bit shift)
Backport from 2016-07-29 trunk r238863.
PR rtl-optimization/71976
* combine.c (get_last_value): Return 0 if the argument for which
the function is called has a wider mode than the recorded value.
backport: re PR fortran/70524 (ICE when using -frepack-arrays -Warray-temporaries)
gcc/testsuite/ChangeLog:
2016-08-08 Andre Vehreschild <vehre@gcc.gnu.org>
Backport from trunk:
PR fortran/70524
* gfortran.dg/dependency_48.f90: New test.
gcc/fortran/ChangeLog:
2016-08-08 Andre Vehreschild <vehre@gcc.gnu.org>
Backport from trunk:
PR fortran/70524
* trans-array.c (gfc_trans_dummy_array_bias): Ensure that the
location information is correctly set.
* trans-decl.c (gfc_trans_deferred_vars): Set the locus of the
current construct early.
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.