Iain Sandoe [Wed, 25 Dec 2019 20:31:04 +0000 (20:31 +0000)]
[Darwin, PPC] Use Darwin9 bundle header for Rosetta builds.
On Darwin10 it's possible to make a 32b PPC build using the
'Rosetta' emulator. However, these builds need to make use of
Darwin9 crts (for exes, dylibs and bundles). This adds the
change to cater for bundles.
gcc/ChangeLog:
Backport from mainline.
2019-12-14 Iain Sandoe <iain@sandoe.co.uk>
* config/darwin.h (DARWIN_EXTRA_SPECS): Add new
bundle spec. (DARWIN_BUNDLE1_SPEC): New.
(STARTFILE_SPEC): Use darwin bundle spec.
* config/rs6000/darwin.h (DARWIN_BUNDLE1_SPEC): New.
(DARWIN_DYLIB1_SPEC): Delete duplicate.
Paul Thomas [Sat, 21 Dec 2019 18:21:21 +0000 (18:21 +0000)]
re PR fortran/92753 (ICE in gfc_trans_call, at fortran/trans-stmt.c:392)
2019-12-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/92753
* expr.c (find_inquiry_ref): Catch INQUIRY_LEN case, where the
temporary expression has been converted to a constant and make
the new expression accordingly. Correct the error in INQUIRY_RE
and INQUIRY_IM cases. The original rather than the resolved
expression was being used as the source in mpfr_set.
2019-12-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/92753
* gfortran.dg/inquiry_type_ref_5.f90 : New test.
Jakub Jelinek [Fri, 20 Dec 2019 17:44:50 +0000 (18:44 +0100)]
backport: re PR ipa/92357 (ICE in IPA pass fnsummary in openmp offload)
Backported from mainline
2019-12-14 Jakub Jelinek <jakub@redhat.com>
PR ipa/92357
* ipa-fnsummary.c (ipa_fn_summary_write): Use
lto_symtab_encoder_iterator with lsei_start_function_in_partition and
lsei_next_function_in_partition instead of walking all cgraph nodes
in encoder.
Jakub Jelinek [Fri, 20 Dec 2019 17:43:23 +0000 (18:43 +0100)]
backport: re PR target/92904 (varargs for __int128 is placed at an unaligned location and uses movdqa for the load)
Backported from mainline
2019-12-12 Jakub Jelinek <jakub@redhat.com>
PR target/92904
* config/i386/i386.c (ix86_gimplify_va_arg): If need_intregs and
not need_temp, decrease alignment of the read because the GPR save
area only guarantees 8-byte alignment.
Jakub Jelinek [Fri, 20 Dec 2019 17:41:17 +0000 (18:41 +0100)]
backport: re PR target/92723 (ICE in expand_shift_1, at expmed.c:2635)
Backported from mainline
2019-12-11 Jakub Jelinek <jakub@redhat.com>
PR target/92723
* tree-vect-patterns.c (vect_recog_rotate_pattern): If dt is not
vect_internal_def, use oprnd1 as is, without trying to cast it.
Formatting fix.
Jakub Jelinek [Fri, 20 Dec 2019 17:37:45 +0000 (18:37 +0100)]
backport: PR c++/92831 - CWG 1299, not extending temporary lifetime for ?:
Backported from mainline
2019-12-06 Jakub Jelinek <jakub@redhat.com>
PR c++/92831 - CWG 1299, not extending temporary lifetime for ?:
* cp-tree.h (extend_ref_init_temps): Add a new argument with NULL
default arg.
* call.c (set_up_extended_ref_temp): Add COND_GUARD argument, pass it
down to extend_ref_init_temps. Before pushing cleanup, if COND_GUARD
is non-NULL, create a bool temporary if needed, initialize to false
and guard the cleanup with the temporary being true.
(extend_ref_init_temps_1): Add COND_GUARD argument, pass it down
to recursive calls and set_up_extended_ref_temp. Handle COND_EXPR.
(extend_ref_init_temps): Add COND_GUARD argument, pass it down to
recursive calls and to extend_ref_init_temps_1.
Jakub Jelinek [Fri, 20 Dec 2019 17:36:08 +0000 (18:36 +0100)]
backport: re PR fortran/92781 (ICE in convert_nonlocal_reference_op, at tree-nested.c:1065)
Backported from mainline
2019-12-05 Jakub Jelinek <jakub@redhat.com>
PR fortran/92781
* trans-decl.c (gfc_get_symbol_decl): If sym->backend_decl is
current_function_decl, add length to current rather than parent
function and expect DECL_CONTEXT (length) to be current_function_decl.
Jakub Jelinek [Fri, 20 Dec 2019 17:33:13 +0000 (18:33 +0100)]
backport: re PR c++/92695 (P1064R0 - virtual constexpr fails if object taken from array)
Backported from mainline
2019-12-03 Jakub Jelinek <jakub@redhat.com>
PR c++/92695
* constexpr.c (cxx_bind_parameters_in_call): For virtual calls,
adjust the first argument to point to the derived object rather
than its base.
Jakub Jelinek [Fri, 20 Dec 2019 17:30:38 +0000 (18:30 +0100)]
backport: re PR c++/60228 (ICE using lambda in #pragma omp declare reduction)
Backported from mainline
2019-11-29 Jakub Jelinek <jakub@redhat.com>
PR c++/60228
* parser.c (cp_parser_omp_declare_reduction_exprs): If
processing_template_decl, wrap the combiner or initializer
into EXPR_STMT.
* decl.c (start_preparsed_function): Don't start a lambda scope
for DECL_OMP_DECLARE_REDUCTION_P functions.
(finish_function): Don't finish a lambda scope for
DECL_OMP_DECLARE_REDUCTION_P functions, nor cp_fold_function
them nor cp_genericize them.
* mangle.c (decl_mangling_context): Look through
DECL_OMP_DECLARE_REDUCTION_P functions.
* semantics.c (expand_or_defer_fn_1): For DECL_OMP_DECLARE_REDUCTION_P
functions, use tentative linkage, don't keep their bodies with
-fkeep-inline-functions and return false at the end.
* g++.dg/gomp/openmp-simd-2.C: Don't expect bodies for
DECL_OMP_DECLARE_REDUCTION_P functions.
* testsuite/libgomp.c++/udr-20.C: New test.
* testsuite/libgomp.c++/udr-21.C: New test.
Jakub Jelinek [Fri, 20 Dec 2019 16:57:21 +0000 (17:57 +0100)]
backport: re PR inline-asm/92615 (ICE in extract_insn)
Backported from mainline
2019-11-23 Jakub Jelinek <jakub@redhat.com>
PR target/92615
* config/i386/i386.c (ix86_md_asm_adjust): If dest_mode is
GET_MODE (dest), is not QImode, using ZERO_EXTEND and dest is not
register_operand, force x into register before storing it into dest.
Formatting fix.
Jakub Jelinek [Fri, 20 Dec 2019 16:56:30 +0000 (17:56 +0100)]
backport: re PR c/90677 (gcc-9.1.0 fails to build __gcc_diag__ souce: error: 'cgraph_node' is not defined as a type)
Backported from mainline
2019-11-22 Jakub Jelinek <jakub@redhat.com>
PR c/90677
* c-common.h (identifier_global_tag): Declare.
* c-format.c (get_pointer_to_named_type): Renamed to ...
(get_named_type): ... this. Use identifier_global_tag instead of
identifier_global_value, handle the return value being a TYPE_P.
(init_dynamic_diag_info): Adjust get_pointer_to_named_type callers
to call get_named_type instead. Formatting fixes.
Jakub Jelinek [Fri, 20 Dec 2019 16:55:06 +0000 (17:55 +0100)]
backport: re PR c++/90842 (ICE in poplevel, at cp/decl.c:585)
Backported from mainline
2019-11-21 Jakub Jelinek <jakub@redhat.com>
Jason Merrill <jason@redhat.com>
PR c++/90842
* parser.c (cp_parser_decl_specifier_seq): For concept or typedef
break early if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
For type specifiers, set CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS
if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR is set.
Jason Merrill [Fri, 13 Dec 2019 05:10:11 +0000 (00:10 -0500)]
PR c++/57082 - new X{} and private destructor.
build_new_1 already passes tf_no_cleanup to build_value_init, but in this
testcase we end up calling build_value_init by way of
build_special_member_call, so we need to pass it to that function as well.
* init.c (build_new_1): Also pass tf_no_cleanup to
build_special_member_call.
Kewen Lin [Tue, 10 Dec 2019 12:54:21 +0000 (12:54 +0000)]
[PATCH] Fix PR91790 by considering different first_stmt_info for realign
As PR91790 exposed, when we have one slp node whose first_stmt_info_for_drptr
is different from first_stmt_info, it's possible that the first_stmt DR isn't
initialized yet before stmt SLP_TREE_SCALAR_STMTS[0] of slp node. So we
shouldn't use first_stmt_info for vect_setup_realignment, instead we can use
the one based on first_stmt_info_for_drptr DR with additional adjustment by
bumping the distance from first_stmt DR.
2019-12-10 Kewen Lin <linkw@gcc.gnu.org>
Backport from mainline
2019-11-27 Kewen Lin <linkw@gcc.gnu.org>
PR tree-optimization/91790
* gcc/tree-vect-stmts.c (vectorizable_load): Use the adjusted DR for
vect_setup_realignment when first_stmt_info is different from
first_stmt_info_for_drptr.
Eric Botcazou [Mon, 9 Dec 2019 16:43:52 +0000 (16:43 +0000)]
tree.c (build_array_type_1): Add SET_CANONICAL parameter and compute TYPE_CANONICAL from the element type...
* tree.c (build_array_type_1): Add SET_CANONICAL parameter and compute
TYPE_CANONICAL from the element type only if it is true. Remove a few
obsolete lines and adjust recursive call.
(fld_process_array_type): Adjust call to build_array_type_1.
(build_array_type): Likewise.
(build_nonshared_array_type): Likewise.
Jonathan Wakely [Mon, 9 Dec 2019 11:16:29 +0000 (11:16 +0000)]
libstdc++: fix buffer overflow in path::operator+= (PR92853)
When concatenating a path ending in a root-directory onto another path,
we added an empty filename to the end of the path twice, but only
reserved space for one. That meant the second write went past the end of
the allocated buffer.
PR libstdc++/92853
* src/c++17/fs_path.cc (filesystem::path::operator+=(const path&)):
Do not process a trailing directory separator twice.
* testsuite/27_io/filesystem/path/concat/92853.cc: New test.
* testsuite/27_io/filesystem/path/concat/path.cc: Test more cases.
* testsuite/27_io/filesystem/path/concat/strings.cc: Test more cases.
Fix bugs relating to flexibly-sized objects in nios2 backend.
PR target/92499
gcc/c/
* c-decl.c (flexible_array_type_p): Move to common code.
gcc/
* config/nios2/nios2.c (nios2_in_small_data_p): Do not consider
objects of flexible types to be small if they have internal linkage
or are declared extern.
* config/nios2/nios2.h (ASM_OUTPUT_ALIGNED_LOCAL): Replace with...
(ASM_OUTPUT_ALIGNED_DECL_LOCAL): ...this. Use targetm.in_small_data_p
instead of the size of the object initializer.
* tree.c (flexible_array_type_p): Move from C front end, and
generalize to handle fields in non-C structures.
* tree.h (flexible_array_type_p): Declare.
Li Jia He [Mon, 2 Dec 2019 06:23:56 +0000 (06:23 +0000)]
[rs6000]Fix PR92098 by backporting vec_cmp and vcond_mask supports to gcc-9-branch
As PR92132 added vec_cmp_* and vcond_mask_* supports on trunk. This is a
partial backport of vec_{cmp,cmpu}<mode><mode> interface and related expand
to gcc-9-branch to fix PR92098.
gcc/ChangeLog
2019-12-02 Li Jia He <helijia@linux.ibm.com>
Partial backport from mainline
PR target/92098
2019-11-08 Kewen Lin <linkw@gcc.gnu.org>
PR target/92132
* config/rs6000/predicates.md
(signed_or_equality_comparison_operator): New predicate.
(unsigned_or_equality_comparison_operator): Likewise.
* config/rs6000/rs6000.md (one_cmpl<mode>2): Remove expand.
(one_cmpl<mode>3_internal): Rename to one_cmpl<mode>2.
* config/rs6000/vector.md
(vcond_mask_<mode><mode> for VEC_I and VEC_I): New expand.
(vec_cmp<mode><mode> for VEC_I and VEC_I): Likewise.
(vec_cmpu<mode><mode> for VEC_I and VEC_I): Likewise.
gcc/testsuite/ChangeLog
2019-12-02 Li Jia He <helijia@linux.ibm.com>
Partial backport from trunk
PR target/92098
2019-11-08 Kewen Lin <linkw@gcc.gnu.org>
PR target/92132
* gcc.target/powerpc/pr92132-fp-1.c: New test.
* gcc.target/powerpc/pr92132-fp-2.c: New test.
Thomas Koenig [Sat, 30 Nov 2019 15:08:32 +0000 (15:08 +0000)]
backport: re PR fortran/91783 (ICE in gfc_dep_resolver, at fortran/dependency.c:2111)
Backport from trunk as an insurance policy.
2019-11-30 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/91783
* gfortran.dg/dependency_56.f90: New test. Backport from trunk on
the off-chance that somebody backports something that will break
this test case.
Eric Botcazou [Fri, 29 Nov 2019 09:07:53 +0000 (09:07 +0000)]
re PR ada/92489 (internal error on Invalid_Value Attribute attribute)
PR ada/92489
Backport from mainline
2019-07-01 Ed Schonberg <schonberg@adacore.com>
* exp_attr.adb (Expand_Attribute_Reference, case Invalid_Value):
Resolve result of call to Get_Simple_Init_Val, which may be a
conversion of a literal.
Richard Biener [Wed, 27 Nov 2019 12:09:36 +0000 (12:09 +0000)]
backport: re PR tree-optimization/92222 (ice in useless_type_conversion_p, at gimple-expr.c:86)
2019-11-27 Richard Biener <rguenther@suse.de>
Backport from mainline
2019-10-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/92222
* tree-vect-slp.c (_slp_oprnd_info::first_pattern): Remove.
(_slp_oprnd_info::second_pattern): Likewise.
(_slp_oprnd_info::any_pattern): New.
(vect_create_oprnd_info): Adjust.
(vect_get_and_check_slp_defs): Compute whether any stmt is
in a pattern.
(vect_build_slp_tree_2): Avoid building up a node from scalars
if any of the operand defs, not just the first, is in a pattern.
Jerry DeLisle [Tue, 26 Nov 2019 22:56:24 +0000 (22:56 +0000)]
backport: re PR libfortran/92100 (Formatted stream IO irreproducible read with binary data in file)
2019-11-26 Jerry DeLisle <jvdelisle@gcc.ngu.org>
Backport from mainline
PR fortran/92100
io/transfer.c (data_transfer_init_worker): Use fbuf_reset
instead of fbuf_flush before the seek. Note that fbuf_reset
calls fbuf_flush and adjusts fbuf pointers.
Eric Botcazou [Mon, 25 Nov 2019 10:52:33 +0000 (10:52 +0000)]
re PR ada/92362 (double elaboration of expression in Address aspect)
PR ada/92362
* gcc-interface/trans.c (gnat_to_gnu) <N_Attribute_Definition_Clause>:
Use a temporary instead of clobbering the result with a freeze node.
Jonathan Wakely [Fri, 22 Nov 2019 12:36:18 +0000 (12:36 +0000)]
PR libstdc++/92267 fix ABI change in deque iterators
Defaulting the copy constructor on its first declaration made it change
from user-provided (and non-trivial) to implicitly-defined (and
trivial). This caused an ABI incompatibility between GCC 8 and GCC 9,
where functions taking a deque iterator disagree on the argument passing
convention.
Backport from mainline
2019-10-29 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/92267
* include/bits/stl_deque.h (_Deque_iterator(const _Deque_iterator&)):
Do not define as defaulted.
* testsuite/23_containers/deque/types/92267.cc: New test.