Richard Biener [Thu, 7 Jun 2018 11:56:25 +0000 (11:56 +0000)]
backport: re PR sanitizer/84761 (AddressSanitizer is not compatible with glibc 2.27 on x86)
2018-06-07 Richard Biener <rguenther@suse.de>
Backport from mainline
2018-03-19 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/84761
* sanitizer_common/sanitizer_linux_libcdep.cc (__GLIBC_PREREQ):
Define if not defined.
(DL_INTERNAL_FUNCTION): Don't define.
(InitTlsSize): For __i386__ if not compiled against glibc 2.27+
determine at runtime whether to use regparm(3), stdcall calling
convention for older glibcs or normal calling convention for
newer glibcs for call to _dl_get_tls_static_info.
Richard Biener [Thu, 7 Jun 2018 10:10:00 +0000 (10:10 +0000)]
backport: [multiple changes]
2018-06-07 Richard Biener <rguenther@suse.de>
Backport from mainline
2018-05-04 Richard Biener <rguenther@suse.de>
PR middle-end/85588
* fold-const.c (negate_expr_p): Restrict negation of operand
zero of a division to when we know that can happen without
overflow.
(fold_negate_expr_1): Likewise.
* gcc.dg/torture/pr85588.c: New testcase.
* gcc.dg/torture/pr57656.c: Use dg-additional-options.
2018-05-02 Richard Biener <rguenther@suse.de>
PR middle-end/85567
* gimplify.c (gimplify_save_expr): When in SSA form allow
SAVE_EXPRs to compute to SSA vars.
* gcc.dg/torture/pr85567.c: New testcase.
2018-05-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/85597
* tree-vect-stmts.c (vectorizable_operation): For ternary SLP
do not use split vect_get_vec_defs call but call vect_get_slp_defs
directly.
Eric Botcazou [Sat, 2 Jun 2018 10:52:39 +0000 (10:52 +0000)]
ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.
* gcc-interface/ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.
* gcc-interface/decl.c (gnat_to_gnu_component_type): Cache the padding
type built for an aliased component with variable size.
Eric Botcazou [Sat, 2 Jun 2018 09:52:57 +0000 (09:52 +0000)]
backport: trans.c (Call_to_gnu): If this is a function call and there is no target...
Backport from mainline
2018-05-31 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Call_to_gnu): If this is a function call and
there is no target, also create a temporary for the return value for
an allocator if the type is an unconstrained record type with default
discriminant.
Jerry DeLisle [Fri, 1 Jun 2018 18:34:09 +0000 (18:34 +0000)]
backport: re PR fortran/85840 (Memory leak in write.c)
2018-06-01 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Backport from trunk.
PR libgfortran/85840
* io/write.c (write_float_0, write_real, write_real_g0,
write_complex): Use separate local variables for the float
string length.
Bill Schmidt [Fri, 1 Jun 2018 12:57:16 +0000 (12:57 +0000)]
backport: [multiple changes]
2018-06-01 Bill Schmidt <wschmidt@linux.ibm.com>
PR tree-optimization/85712
Backport from mainline:
2018-05-23 Bill Schmidt <wschmidt@linux.ibm.com>
PR tree-optimization/85712
* gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add
first_interp field.
(alloc_cand_and_find_basis): Initialize first_interp field.
(slsr_process_mul): Modify first_interp field.
(slsr_process_add): Likewise.
(slsr_process_cast): Modify first_interp field for each new
interpretation.
(slsr_process_copy): Likewise.
(dump_candidate): Dump first_interp field.
(replace_mult_candidate): Process all interpretations, not just
subsequent ones.
(replace_rhs_if_not_dup): Likewise.
(replace_one_candidate): Likewise.
Backport from mainline:
2018-05-25 Bill Schmidt <wschmidt@linux.ibm.com>
PR tree-optimization/85712
* gimple-ssa-strength-reduction.c (replace_one_candidate): Skip if
this candidate has already been replaced in-situ by a copy.
This patch uses pre-computed size of struct ustat for Linux.
PR sanitizer/85835
* sanitizer_common/sanitizer_platform_limits_posix.cc: Don't
include <sys/ustat.h> for Linux.
(SIZEOF_STRUCT_USTAT): New.
(struct_ustat_sz): Use SIZEOF_STRUCT_USTAT for Linux.
Paul Thomas [Sun, 20 May 2018 18:08:04 +0000 (18:08 +0000)]
re PR fortran/80657 (Loop in character function declaration)
2018-05-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/80657
Backport from trunk
* resolve.c (flag_fn_result_spec): Use the 'sym' argument to
test for self refs to the function result in the character len
expression. If a self reference is found, emit an error and
return true.
(resolve_fntype): Use the function symbol in the calls to the
above.
2018-05-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/80657
Backport from trunk
* gfortran.dg/char_result_18.f90: New test.
Paul Thomas [Sun, 20 May 2018 17:16:09 +0000 (17:16 +0000)]
re PR fortran/82275 (gfortran rejects valid & accepts invalid reference to dimension-remapped type SELECT TYPE selector)
2018-05-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/82275
Backport from trunk
* match.c (gfc_match_type_spec): Go through the array ref and
decrement 'rank' for every dimension that is an element.
2018-05-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/82275
Backport from trunk
* gfortran.dg/select_type_42.f90: New test.
Paul Thomas [Sat, 19 May 2018 14:53:58 +0000 (14:53 +0000)]
re PR fortran/82923 (Automatic allocation of deferred length character using function result)
2018-05-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/82923
PR fortran/66694
PR fortran/82617
* trans-array.c (gfc_alloc_allocatable_for_assignment): Set the
charlen backend_decl of the rhs expr to ss->info->string_length
so that the value in the current scope is used.
2018-05-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/82923
* gfortran.dg/allocate_assumed_charlen_4.f90: New test. Note
that the patch fixes PR66694 & PR82617, although the testcases
are not explicitly included.
Jonathan Wakely [Thu, 17 May 2018 17:26:44 +0000 (18:26 +0100)]
PR libstdc++/85812 fix memory leak in std::make_exception_ptr
PR libstdc++/85812
* libsupc++/cxxabi_init_exception.h (__cxa_free_exception): Declare.
* libsupc++/exception_ptr.h (make_exception_ptr) [__cpp_exceptions]:
Refactor to separate non-throwing and throwing implementations.
[__cpp_rtti && !_GLIBCXX_HAVE_CDTOR_CALLABI]: Deallocate the memory
if constructing the object throws.
Paul Thomas [Wed, 16 May 2018 11:17:10 +0000 (11:17 +0000)]
re PR fortran/83149 ([6- and 7-branches] Missing test for sym->ns->proc_name: crash_signal in toplev.c:325)
2018-05-16 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83149
Backport from trunk
* trans-decl.c (gfc_finish_var_decl): Test sym->ns->proc_name
before accessing its components.
* trans-types.c (gfc_sym_type): If a character result has null
backend_decl, try the procedure symbol..
2018-05-16 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83149
Backport from trunk
* gfortran.dg/pr83149_1.f90: New test.
* gfortran.dg/pr83149.f90: Additional source for previous.
* gfortran.dg/pr83149_b.f90: New test.
* gfortran.dg/pr83149_a.f90: Additional source for previous.
Paul Thomas [Wed, 16 May 2018 09:35:19 +0000 (09:35 +0000)]
re PR fortran/84546 (Bad sourced allocation of CLASS(*) with source with CLASS(*) component)
2018-05-16 Paul Thomas <pault@gcc.gnu.org>
PR fortran/84546
Backport from trunk
* trans-array.c (structure_alloc_comps): Make sure that the
vptr is copied and that the unlimited polymorphic _len is used
to compute the size to be allocated.
(build_array_ref): Set the 'unlimited' argument false in the
call to gfc_get_class_array_ref.
* trans-expr.c (gfc_get_class_array_ref): If unlimited, use the
unlimited polymorphic _len for the offset to the element.
(gfc_copy_class_to_class): Set the new 'unlimited' argument.
* trans.h : Add the boolean 'unlimited' to the prototype.
2018-05-16 Paul Thomas <pault@gcc.gnu.org>
PR fortran/84546
Backport from trunk
* gfortran.dg/unlimited_polymorphic_29.f90 : New test.
Jonathan Wakely [Mon, 14 May 2018 22:22:23 +0000 (23:22 +0100)]
PR libstdc++/82966 fix swapping of node handles
PR libstdc++/82966
* include/bits/node_handle.h (_Node_handle_common::_M_swap): Use value
instead of type.
* testsuite/23_containers/set/modifiers/node_swap.cc: New.
Steven G. Kargl [Fri, 11 May 2018 17:59:05 +0000 (17:59 +0000)]
re PR fortran/85521 (ICE in gfc_resolve_character_array_constructor, at fortran/array.c:2049)
2018-05-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85521
Backport from trunk
* array.c (gfc_resolve_character_array_constructor): Substrings
with upper bound smaller than lower bound are zero length strings.
2018-05-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85521
Backport from trunk
* gfortran.dg/pr85521_1.f90: New test.
* gfortran.dg/pr85521_2.f90: New test.
Jonathan Wakely [Thu, 10 May 2018 19:23:33 +0000 (20:23 +0100)]
Document Dual ABI for std::ios_base::failure
* doc/xml/faq.xml: Link to C++17 status. Add note to outdated answer.
* doc/xml/manual/debug_mode.xml: Add array and forward_list to list
of C++11 containers with Debug Mode support.
* doc/xml/manual/using.xml: Document Dual ABI for ios_base::failure.
* doc/html/*: Regenerate.
Jason Merrill [Wed, 9 May 2018 02:34:03 +0000 (22:34 -0400)]
PR c++/85646 - lambda visibility.
* decl2.c (determine_visibility): Don't mess with template arguments
from the containing scope.
(vague_linkage_p): Check DECL_ABSTRACT_P before looking at a 'tor
thunk.
backport: re PR libstdc++/80506 (Wrong magic number in std::gamma_distribution)
2018-05-07 Edward Smith-Rowland <3dw4rd@verizon.net>
Jonathan Wakely <jwakely@redhat.com>
Backport from mainline
2018-05-07 Edward Smith-Rowland <3dw4rd@verizon.net>
PR libstdc++/80506
* include/bits/random.tcc (gamma_distribution::operator()): Fix magic
number used in loop condition.
(gamma_distribution::__generate_impl()): Ditto.
Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>
From-SVN: r260006
re PR fortran/85507 (ICE in gfc_dep_resolver, at fortran/dependency.c:2258)
gcc/fortran/ChangeLog:
2018-05-06 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/85507
Backport from trunk.
* dependency.c (gfc_dep_resolver): Revert looking at coarray dimension
introduced by r259385.
* trans-intrinsic.c (conv_caf_send): Always report a dependency for
same variables in coarray assignments.
gcc/testsuite/ChangeLog:
2018-05-06 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/85507
Backport from trunk
* gfortran.dg/coarray_dependency_1.f90: New test.
* gfortran.dg/coarray_lib_comm_1.f90: Fix counting caf-expressions.
Jonathan Wakely [Thu, 3 May 2018 20:16:29 +0000 (21:16 +0100)]
PR libstdc++/85632 fix wraparound in filesystem::space
On 32-bit targets any values over 4GB would wrap and produce the wrong
result.
PR libstdc++/85632 use uintmax_t for arithmetic
* src/filesystem/ops.cc (experimental::filesystem::space): Perform
arithmetic in result type.
* testsuite/experimental/filesystem/operations/space.cc: New.
PR libstdc++/pr66689 - comp_ellint_3 and ellint_3 return garbage values
2018-04-30 Edward Smith-Rowland <3dw4rd@verizon.net>
PR libstdc++/pr66689 - comp_ellint_3 and ellint_3 return garbage values
* include/tr1/ell_integral.tcc: Correct the nu sign convention
in ellint_3 and comp_ellint_3.
* testsuite/tr1/5_numerical_facilities/special_functions/
06_comp_ellint_3/check_value.cc: Regen with correct values.
* testsuite/tr1/5_numerical_facilities/special_functions/
14_ellint_3/check_value.cc: Ditto.
* testsuite/special_functions/06_comp_ellint_3/check_value.cc: Ditto.
* testsuite/special_functions/13_ellint_3/check_value.cc: Ditto.
* testsuite/special_functions/06_comp_ellint_3/pr66689.cc: New.
* testsuite/special_functions/13_ellint_3/pr66689.cc: New.
* testsuite/tr1/5_numerical_facilities/special_functions/
06_comp_ellint_3/pr66689.cc: New.
* testsuite/tr1/5_numerical_facilities/special_functions/
14_ellint_3/pr66689.cc: New.
2018-04-30 Edward Smith-Rowland <3dw4rd@verizon.net>
PR libstdc++/68397 std::tr1::expint fails ... long double arguments.
* include/tr1/exp_integral.tcc: Increase iteration limits.
* testsuite/tr1/5_numerical_facilities/special_functions/15_expint/
pr68397.cc: New test.
* testsuite/special_functions/14_expint/pr68397.cc: New test.
svn commit \ --This line, and those below, will be ignored--
ChangeLog \ M ChangeLog M include/tr1/ell_integral.tcc A testsuite/special_functions/06_comp_ellint_3/pr66689.cc A
testsuite/special_functions/13_ellint_3/pr66689.cc A testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/pr66689.cc A
testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/pr66689.cc M testsuite/special_functions/06_comp_ellint_3/check_value.cc M
testsuite/special_functions/13_ellint_3/check_value.cc M testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_value.cc M
testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/check_value.cc M include/tr1/exp_integral.tcc A
testsuite/special_functions/14_expint/pr68397.cc A testsuite/tr1/5_numerical_facilities/special_functions/15_expint/pr68397.cc
include/tr1/ell_integral.tcc \
testsuite/special_functions/06_comp_ellint_3/pr66689.cc \
testsuite/special_functions/13_ellint_3/pr66689.cc \
testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/pr66689.cc \
testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/pr66689.cc \
testsuite/special_functions/06_comp_ellint_3/check_value.cc \
testsuite/special_functions/13_ellint_3/check_value.cc \
testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_value.cc \
testsuite/tr1/5_numerical_facilities/special_functio
re PR fortran/81773 ([Coarray] Get with vector index on lhs leads to incorrect caf_get_by_ref() call.)
gcc/fortran/ChangeLog:
2018-04-28 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/81773
PR fortran/83606
Backport from trunk
* dependency.c (gfc_dep_resolver): Coarray indexes are to be ignored
during dependency computation. They define no data dependency.
* trans-array.c (conv_array_index_offset): The stride can not be set
here, prevent fail.
* trans-intrinsic.c (conv_caf_send): Add creation of temporary array
for caf_get's result and copying to the array with vectorial
indexing.
gcc/testsuite/ChangeLog:
2018-04-28 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/81773
PR fortran/83606
Backport from trunk
* gfortran.dg/coarray/get_to_indexed_array_1.f90: New test.
* gfortran.dg/coarray/get_to_indirect_array.f90: New test.
Richard Biener [Thu, 26 Apr 2018 10:00:24 +0000 (10:00 +0000)]
Backport PRs 84873, 85168, 85244, 85284
2018-04-26 Richard Biener <rguenther@suse.de>
Backport from mainline
2018-04-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/85284
* tree-ssa-loop-niter.c (number_of_iterations_exit_assumptions):
Only use the niter constraining form of simple_iv when the exit
is always executed.
* gcc.dg/torture/pr85284.c: New testcase.
2018-04-06 Richard Biener <rguenther@suse.de>
PR middle-end/85244
* tree-dfa.c (get_ref_base_and_extent): Reset seen_variable_array_ref
after seeing a component reference with an adjacent field. Treat
refs to arrays at struct end of external decls similar to
refs to unconstrained commons.
* gcc.dg/torture/pr85244-1.c: New testcase.
* gcc.dg/torture/pr85244-2.c: Likewise.
Martin Liska [Tue, 24 Apr 2018 15:17:48 +0000 (17:17 +0200)]
Backport r258924
2018-04-24 Martin Liska <mliska@suse.cz>
Backport from mainline
2018-03-28 Jakub Jelinek <jakub@redhat.com>
Martin Liska <mliska@suse.cz>
PR sanitizer/85081
* gimplify.c (asan_poison_variable): Don't do the check for
gimplify_omp_ctxp here.
(gimplify_decl_expr): Do it here.
(gimplify_target_expr): Likewise.
2018-04-24 Martin Liska <mliska@suse.cz>
Backport from mainline
2018-03-28 Jakub Jelinek <jakub@redhat.com>
Martin Liska <mliska@suse.cz>
PR sanitizer/85081
* g++.dg/asan/pr85081.C: New test.