jakub [Thu, 14 Mar 2019 13:05:34 +0000 (13:05 +0000)]
PR ipa/89684
* multiple_target.c (create_dispatcher_calls): Change
references_to_redirect from vector of ipa_ref * to vector of ipa_ref.
In the node->iterate_referring loop, push *ref rather than ref, call
ref->remove_reference () and always pass 0 to iterate_referring.
jakub [Thu, 14 Mar 2019 08:56:47 +0000 (08:56 +0000)]
PR tree-optimization/89703
* tree-ssa-strlen.c (valid_builtin_call): Punt if stmt call types
aren't compatible also with builtin_decl_explicit. Check pure
or non-pure status of BUILT_IN_STR{{,N}CMP,N{LEN,{CAT,CPY}{,_CHK}}}
and BUILT_IN_STPNCPY{,_CHK}.
* gcc.c-torture/compile/pr89703-1.c: New test.
* gcc.c-torture/compile/pr89703-2.c: New test.
hjl [Thu, 14 Mar 2019 08:49:54 +0000 (08:49 +0000)]
x32: Add addr32 prefix to VSIB address
32-bit indices in VSIB address are sign-extended to 64 bits. In x32,
when 32-bit indices are used as addresses, like in
vgatherdps %ymm7, 0(,%ymm9,1), %ymm6
32-bit indices, 0xf7fa3010, is sign-extended to 0xfffffffff7fa3010 which
is invalid address. Add addr32 prefix to UNSPEC_VSIBADDR instructions
for x32 if there is no base register nor symbol.
This fixes 175.vpr and 254.gap in SPEC CPU 2000 on x32 with
-Ofast -funroll-loops -march=haswell
gcc/
PR target/89523
* config/i386/i386.c (ix86_print_operand): Handle 'M' to add
addr32 prefix to VSIB address for X32.
* config/i386/sse.md (*avx512pf_gatherpf<mode>sf_mask): Prepend
"%M2" to opcode.
(*avx512pf_gatherpf<mode>df_mask): Likewise.
(*avx512pf_scatterpf<mode>sf_mask): Likewise.
(*avx512pf_scatterpf<mode>df_mask): Likewise.
(*avx2_gathersi<mode>): Prepend "%M3" to opcode.
(*avx2_gathersi<mode>_2): Prepend "%M2" to opcode.
(*avx2_gatherdi<mode>): Prepend "%M3" to opcode.
(*avx2_gatherdi<mode>_2): Prepend "%M2" to opcode.
(*avx2_gatherdi<mode>_3): Prepend "%M3" to opcode.
(*avx2_gatherdi<mode>_4): Prepend "%M2" to opcode.`
(*avx512f_gathersi<mode>): Prepend "%M4" to opcode.
(*avx512f_gathersi<mode>_2): Prepend "%M3" to opcode.
(*avx512f_gatherdi<mode>): Prepend "%M4" to opcode.
(*avx512f_gatherdi<mode>_2): Prepend "%M3" to opcode.
(*avx512f_scattersi<mode>): Prepend "%M0" to opcode.
(*avx512f_scatterdi<mode>): Likewise.
jakub [Thu, 14 Mar 2019 08:13:09 +0000 (08:13 +0000)]
PR c++/89652
* constexpr.c (struct constexpr_ctx): Change save_exprs type from
hash_set<tree> to vec<tree>.
(cxx_eval_call_expression): Adjust for save_exprs being a vec instead
of hash_set.
(cxx_eval_loop_expr): Likewise. Truncate the vector after each
removal of SAVE_EXPRs from values.
(cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
method on save_exprs instead of add.
jason [Wed, 13 Mar 2019 23:34:51 +0000 (23:34 +0000)]
PR c++/86521 - C++17 copy elision in initialization by constructor.
This is an overlooked case in C++17 mandatory copy elision: We want overload
resolution to reflect that initializing an object from a prvalue does not
involve a copy or move constructor even when [over.match.ctor] says that
only constructors are candidates. Here I implement that by looking through
the copy/move constructor in joust.
* call.c (joust_maybe_elide_copy): New.
(joust): Call it.
anlauf [Wed, 13 Mar 2019 21:33:27 +0000 (21:33 +0000)]
2019-03-13 Harald Anlauf <anlauf@gmx.de>
PR fortran/87045
* trans-expr.c (gfc_trans_pointer_assignment): Move check for same
string length so that we do not get false errors for deferred
length.
PR fortran/87045
* gfortran.dg/pr87045.f90: New test.
jakub [Wed, 13 Mar 2019 20:22:15 +0000 (20:22 +0000)]
PR debug/89498
* dwarf2out.c (size_of_die): For dw_val_class_view_list always use
DWARF_OFFSET_SIZE.
(value_format): For dw_val_class_view_list never use DW_FORM_loclistx.
mpolacek [Wed, 13 Mar 2019 20:04:33 +0000 (20:04 +0000)]
PR c++/89660 - bogus error with -Wredundant-move.
* typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg
as the std::move's argument. Don't call convert_for_initialization
when warn_redundant_move isn't on.
* g++.dg/cpp0x/Wredundant-move8.C: New test.
* g++.dg/cpp0x/Wredundant-move9.C: New test.
mpolacek [Wed, 13 Mar 2019 19:58:20 +0000 (19:58 +0000)]
PR c++/89686 - mixing init-capture and simple-capture in lambda.
* parser.c (cp_parser_lambda_introducer): Give error when combining
init-capture and simple-capture.
janus [Wed, 13 Mar 2019 19:52:23 +0000 (19:52 +0000)]
fix PR 89601
2019-03-13 Janus Weil <janus@gcc.gnu.org>
PR fortran/89601
* decl.c (gfc_match_formal_arglist): Reject empty type parameter lists.
(gfc_match_derived_decl): Mark as PDT only if type parameter list was
matched successfully.
2019-03-13 Janus Weil <janus@gcc.gnu.org>
PR fortran/89601
* gfortran.dg/pdt_16.f03: Modified to avoid follow-up errors.
* gfortran.dg/pdt_30.f90: New test case.
mpolacek [Wed, 13 Mar 2019 18:38:45 +0000 (18:38 +0000)]
PR c++/88979 - further P0634 fix for constructors.
* parser.c (cp_parser_decl_specifier_seq): Pass flags to
cp_parser_constructor_declarator_p.
(cp_parser_direct_declarator): Allow missing typename for constructor
parameters.
(cp_parser_constructor_declarator_p): Add FLAGS parameter. Pass it to
cp_parser_type_specifier.
ebotcazou [Wed, 13 Mar 2019 09:15:02 +0000 (09:15 +0000)]
PR sanitizer/80953
Merge from LLVM revision 355979
* asan/asan_globals.c (GetGlobalsForAddress): Use internal_memcpy to
copy Global objects for SPARC with GCC.
ebotcazou [Wed, 13 Mar 2019 09:11:46 +0000 (09:11 +0000)]
PR sanitizer/80953
Merge from LLVM revision 355978
* sanitizer_common/sanitizer_allocator_primary32.h
(class SizeClassAllocator32): Assert that kSpaceSize is power of 2 if
SANITIZER_SIGN_EXTENDED_ADDRESSES is set.
(PointerIsMine): Deal with SANITIZER_SIGN_EXTENDED_ADDRESSES.
(ComputeRegionId): Likewise.
* sanitizer_common/sanitizer_linux.cc (GetMaxVirtualAddress): Return
appropriate value for SPARC 64-bit.
* sanitizer_common/sanitizer_platform.h (SANITIZER_MMAP_RANGE_SIZE):
Define for SPARC.
(SANITIZER_SIGN_EXTENDED_ADDRESSES): Define to 1 for SPARC 64-bit.
ebotcazou [Wed, 13 Mar 2019 09:05:43 +0000 (09:05 +0000)]
PR sanitizer/80953
Merge from LLVM revision 355965
* sanitizer_common/sanitizer_linux.cc (GetWriteFlag): Implement for
SPARC/Linux.
(GetPcSpBp): Likewise.
* sanitizer_common/sanitizer_stacktrace.cc (GetNextInstructionPc):
Adjust for SPARC.
* sanitizer_common/sanitizer_stacktrace.h (SANITIZER_CAN_FAST_UNWIND):
Define to 1 for SPARC.
* sanitizer_common/sanitizer_stacktrace_sparc.cc: Rewrite.
* sanitizer_common/sanitizer_unwind_linux_libcdep.cc (SlowUnwindStack):
Adjust the PC address for SPARC with GCC.
tkoenig [Wed, 13 Mar 2019 07:21:33 +0000 (07:21 +0000)]
2019-03-13 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/66695
PR fortran/77746
PR fortran/79485
* gfortran.h (gfc_symbol): Add bind_c component.
(gfc_get_gsymbol): Add argument bind_c.
* decl.c (add_global_entry): Add bind_c argument to
gfc_get_symbol.
* parse.c (parse_block_data): Likewise.
(parse_module): Likewise.
(add_global_procedure): Likewise.
(add_global_program): Likewise.
* resolve.c (resolve_common_blocks): Likewise.
(resolve_global_procedure): Likewise.
(gfc_verify_binding_labels): Likewise.
* symbol.c (gfc_get_gsymbol): Add argument bind_c. Set bind_c
in gsym.
* trans-decl.c (gfc_get_module_backend_decl): Add bind_c argument
to gfc_get_symbol.
(gfc_get_extern_function_decl): If the sym has a binding label
and it cannot be found in the global symbol tabel, it is the wrong
one and vice versa.
2019-03-13 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/66695
PR fortran/77746
PR fortran/79485
* gfortran.dg/binding_label_tests_30.f90: New test.
* gfortran.dg/binding_label_tests_31.f90: New test.
* gfortran.dg/binding_label_tests_32.f90: New test.
* gfortran.dg/binding_label_tests_33.f90: New test.
ian [Wed, 13 Mar 2019 05:12:05 +0000 (05:12 +0000)]
compiler: compare parse methods when indexing interface types for export
This change fixes a bug in which two interface types were being
incorrectly commoned (considered identical) in the initial stages of
writing out types to export data. The indexer does a walk to collect
candidates for export, inserting types into a table to eliminate
duplicates; as part of this process a local interface type T1 was
being commoned with a different interface type T2. This caused a cycle
in the exported type graph due to the way embedded interfaces are
handled.
The fix was to add a new flag to the Type::is_identical utility
routine to request that interface type comparison be done by examining
the original parse methods, as opposed to the expanded method set,
then use the new flag when creating the hash map for the exporter.
ian [Wed, 13 Mar 2019 04:43:33 +0000 (04:43 +0000)]
compiler: add new debugging helper function debug_go_type()
Add a new debugging utility routine debug_go_type(), intended to
display the contents of a Type object in a way useful to debugging
a run of the compiler. Prior to this the only useful alternative
for debugging types was invoking the mangled_name() method, which
has problems (for example, won't work on interface types prior
to finalizing of methods).
This is a "deep" dump, meaning that all types reachable from the
type passed to debug_go_type() will be printed out. Example:
rdapp [Tue, 12 Mar 2019 17:12:56 +0000 (17:12 +0000)]
S/390: Perform more aggressive inlining
This patch sets the inlining parameters for z13 and later to rather
aggressive values in response to PR85103 that caused performance
regressions in SPEC2006's sjeng and gobmk benchmarks.
rdapp [Tue, 12 Mar 2019 17:08:27 +0000 (17:08 +0000)]
S/390: Rework instruction scheduling.
This patch set adds new pipeline descriptions for z13 and z14. Based
on that, the scoring and some properties are handled differently in
the scheduler hooks.
The patch before (r269620) also belongs to this set but I accidentally
applied it separately.
ibuclaw [Tue, 12 Mar 2019 16:31:48 +0000 (16:31 +0000)]
Use libiberty's lrealpath to avoid portability problems.
The dmd front-end function FileName::canonicalName could be called
during the semantic pass of import("file") expressions, so still
requires that realpath() be redefined.
Initial patch by Rainer Orth.
gcc/d/ChangeLog:
2019-03-12 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/87866
* d-system.h (realpath): Redefine as lrealpath.
pault [Tue, 12 Mar 2019 13:40:51 +0000 (13:40 +0000)]
2019-03-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/89363
PR fortran/89364
* trans-expr.c (set_dtype_for_unallocated): New function.
(gfc_conv_gfc_desc_to_cfi_desc): Call it for allocatable and
pointer arguments.
(gfc_conv_procedure_call): Likewise. Also, set the ubound of
the final dimension to -1 for assumed rank formal args that are
associated with assumed size arrays.
* trans-intrinsic.c (gfc_conv_intrinsic_bound): Return -1 for
the final dimension of assumed rank entities that are argument
associated with assumed size arrays.
(gfc_conv_intrinsic_shape): Likewise return -1 for the final
dimension of the shape intrinsic.
2019-03-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/89363
* gfortran.dg/assumed_rank_16.f90: New test.
PR fortran/89364
* gfortran.dg/assumed_rank_17.f90: New test.
Fixes C++ mangling for substituted basic types that are target-specific.
Introduces a new method that currently does nothing, but could in future
make use of flag_abi_version as extern(C++) integration improves in
latter versions of the D front-end.
jakub [Tue, 12 Mar 2019 10:07:25 +0000 (10:07 +0000)]
PR target/52726
* config/s390/s390.md (tabort): Use %wd instead of
HOST_WIDE_INT_PRINT_DEC in error message, reword to avoid two capital
letters and periods.
* config/tilepro/tilepro.c (tilepro_print_operand): Use %wd in
output_operand_lossage instead of HOST_WIDE_INT_PRINT_DEC, replace
's with %< and %>.
jakub [Mon, 11 Mar 2019 22:27:39 +0000 (22:27 +0000)]
PR fortran/89651
* trans-openmp.c (gfc_omp_clause_default_ctor): Set TREE_NO_WARNING
on decl if adding COND_EXPR for allocatable.
(gfc_omp_clause_copy_ctor): Set TREE_NO_WARNING on dest.
jakub [Mon, 11 Mar 2019 21:58:43 +0000 (21:58 +0000)]
PR middle-end/89655
PR bootstrap/89656
* vr-values.c (vr_values::update_value_range): If
old_vr->varying_p (), don't update it, make new_vr also VARYING
and return false.
* gcc-interface/misc.c (gnat_post_options) Wrap an option name
in a string format message and fix GNU coding style.:
2019-03-11 Martin Liska <mliska@suse.cz>
* c-attribs.c (handle_nocf_check_attribute): Wrap an option name
in a string format message and fix GNU coding style.
* c-common.c (vector_types_convertible_p): Likewise.
(c_build_vec_perm_expr): Likewise.
* c-indentation.c (get_visual_column): Likewise.
* c-opts.c (c_common_handle_option): Likewise.
(c_common_post_options): Likewise.
(sanitize_cpp_opts): Likewise.
* c-pch.c (c_common_pch_pragma): Likewise.
* c-pragma.c (handle_pragma_pack): Likewise.
2019-03-11 Martin Liska <mliska@suse.cz>
* c-decl.c (check_for_loop_decls): Wrap an option name
in a string format message and fix GNU coding style.
* c-parser.c (c_parser_declspecs): Likewise.
2019-03-11 Martin Liska <mliska@suse.cz>
* decl.c (match_record_decl): Wrap an option name
in a string format message and fix GNU coding style.
(gfc_match_pointer): Likewise.
* expr.c (find_array_section): Likewise.
* intrinsic.c (gfc_is_intrinsic): Likewise.
* options.c (gfc_post_options): Likewise.
* primary.c (match_integer_constant): Likewise.
* trans-common.c (translate_common): Likewise.
2019-03-11 Martin Liska <mliska@suse.cz>
* lto-lang.c (lto_post_options): Wrap an option name
in a string format message and fix GNU coding style.
* lto-symtab.c (lto_symtab_merge_decls_2): Likewise.
2019-03-11 Martin Liska <mliska@suse.cz>
redi [Mon, 11 Mar 2019 13:46:05 +0000 (13:46 +0000)]
PR libstdc++/89629 fix _Hash_bytes for lengths > INT_MAX
PR libstdc++/89629
* libsupc++/hash_bytes.cc [__SIZEOF_SIZE_T__ == 8] (_Hash_bytes):
Use correct type for len_aligned.
* testsuite/20_util/hash/89629.cc: New test.
krebbel [Mon, 11 Mar 2019 13:30:35 +0000 (13:30 +0000)]
S/390: Fix immediate vector operands for some builtins.
This fixes a problem with vec_add/sub_u128 builtins. The
s390_expand_builtin backend function is supposed to convert the
operand to TImode *AND* load it into a vector register. The current
implementation did only the conversion and gave up then.
gcc/ChangeLog:
2019-03-11 Andreas Krebbel <krebbel@linux.ibm.com>
* config/s390/s390.c (s390_expand_builtin): Do the copy_to_reg not
only on the else branch.
gcc/testsuite/ChangeLog:
2019-03-11 Andreas Krebbel <krebbel@linux.ibm.com>
* gcc.target/s390/zvector/vec-addc-u128.c: New test.
marxin [Mon, 11 Mar 2019 11:48:49 +0000 (11:48 +0000)]
Improve JSON format: add function names for lines.
2019-03-11 Martin Liska <mliska@suse.cz>
* gcov.c (output_intermediate_json_line): Print function
name of each line.
(output_json_intermediate_file): Add new argument.
* doc/gcov.texi: Document the change.
rguenth [Mon, 11 Mar 2019 11:31:05 +0000 (11:31 +0000)]
2019-03-11 Richard Biener <rguenther@suse.de>
PR tree-optimization/89649
* tree-vectorizer.h (vect_loop_versioning): Adjust prototype.
* tree-vect-loop-manip.c (vect_do_peeling): Unset force_vectorize
on the prolog and epilog loops.
(vect_loop_versioning): Return copy of loop.
* tree-vect-loop.c (vect_transform_loop): Unset force_vectorize
on the non-vectorized version of the loop.
jamborm [Sun, 10 Mar 2019 16:20:06 +0000 (16:20 +0000)]
Make SRA less strict with memcpy performing MEM_REFs
2019-03-10 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/85762
PR tree-optimization/87008
PR tree-optimization/85459
* tree-sra.c (contains_vce_or_bfcref_p): New parameter, set the bool
it points to if there is a type changing MEM_REF. Adjust all callers.
(build_accesses_from_assign): Disable total scalarization if
contains_vce_or_bfcref_p returns true through the new parameter, for
both rhs and lhs.
tkoenig [Sun, 10 Mar 2019 10:42:23 +0000 (10:42 +0000)]
2019-03-10 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/66089
* trans-array.c (gfc_scalar_elemental_arg_saved_as_reference):
Return false if a scalar tempoary is needed.
(gfc_walk_variable_expr): Fix up class refs.
2019-03-10 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/66089
* gfortran.dg/dependency_53.f90: New test.
tkoenig [Sat, 9 Mar 2019 19:21:24 +0000 (19:21 +0000)]
2019-03-09 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/71544
* trans-types.c (gfc_typenode_for_spec) Set ts->is_c_interop of
C_PTR and C_FUNPTR.
(create_fn_spec): Mark argument as escaping if ts->is_c_interop is set.
2019-03-09 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/71544
* gfortran.dg/c_ptr_tests_19.f90: New test.