Richard Biener [Tue, 26 Mar 2019 13:18:23 +0000 (13:18 +0000)]
backport: [multiple changes]
2019-02-26 Richard Biener <rguenther@suse.de>
Backport from mainline
2019-02-12 Richard Biener <rguenther@suse.de>
PR tree-optimization/89253
* tree-ssa-loop-split.c (tree_ssa_split_loops): Check we can
duplicate the loop.
* gfortran.dg/pr89253.f: New testcase.
2019-02-08 Richard Biener <rguenther@suse.de>
PR middle-end/89223
* tree-data-ref.c (initialize_matrix_A): Fail if constant
doesn't fit in HWI.
(analyze_subscript_affine_affine): Handle failure from
initialize_matrix_A.
* gcc.dg/torture/pr89223.c: New testcase.
2019-01-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/88739
* tree-ssa-sccvn.c (vn_reference_lookup_3): Avoid generating
BIT_FIELD_REFs of non-mode-precision integral operands.
Richard Biener [Tue, 26 Mar 2019 11:18:26 +0000 (11:18 +0000)]
backport: [multiple changes]
2019-03-26 Richard Biener <rguenther@suse.de>
Backport from mainline
2019-01-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/86554
* tree-ssa-sccvn.c (visit_nary_op): When value-numbering to
expressions with different overflow behavior make sure there's an
available expression on the path.
* gcc.dg/torture/pr86554-1.c: New testcase.
* gcc.dg/torture/pr86554-2.c: Likewise.
2018-11-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/88105
* tree-ssa-dom.c (pass_dominator::execute): Do not walk
backedges.
* gcc.dg/gomp/pr88105.c: New testcase.
2018-03-08 Richard Biener <rguenther@suse.de>
PR middle-end/84552
* tree-scalar-evolution.c: Include tree-into-ssa.h.
(follow_copies_to_constant): Do not follow SSA names registered
for update.
Thomas Schwinge [Thu, 21 Mar 2019 18:57:56 +0000 (19:57 +0100)]
[testsuite, Fortran] Consistently set 'DEFAULT_FFLAGS'
In the same 'runtest' instance, 'global' variables persist from one '*.exp'
file to another.
All other '*.exp' files are using " -pedantic-errors" instead of the empty
string as the default for 'DEFAULT_FFLAGS'. Thus this setting of
'DEFAULT_FFLAGS' is not idempotent, depends on whether
'gfortran.dg/ieee/ieee.exp', or an other defining '*.exp' file is executed
first.
gcc/testsuite/
PR fortran/29383
* gfortran.dg/ieee/ieee.exp (DEFAULT_FFLAGS): Set the same as in
other '*.exp' files.
Matthias Klose [Thu, 21 Mar 2019 12:28:26 +0000 (12:28 +0000)]
backport: re PR tree-optimization/89505 (LibreOffice miscompilation starting with r260383)
2019-03-21 Matthias Klose <doko@ubuntu.com>
Backport from mainline
2019-02-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/89505
* tree-ssa-structalias.c (compute_dependence_clique): Make sure
to handle restrict pointed-to vars with multiple subvars
correctly.
2019-03-21 Matthias Klose <doko@ubuntu.com>
Backport from mainline
2019-02-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/89505
* gcc.dg/torture/pr89505.c: New testcase.
Thomas Koenig [Sun, 17 Mar 2019 12:54:29 +0000 (12:54 +0000)]
re PR fortran/84394 (compiler error when using modules with derived types in block data subprograms)
2019-03-17 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/84394
Backport from trunk
* symbol.c (gfc_add_subroutine): If we are encountering a
subrtoutine within a BLOCK DATA and the name starts with an
underscore, do not check.
2019-03-17 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/84394
Backport from trunk
* gfortran.dg/blockdata_11.f90: New test.
H.J. Lu [Sun, 17 Mar 2019 09:27:56 +0000 (09:27 +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/
Backport from mainline
2019-03-14 H.J. Lu <hongjiu.lu@intel.com>
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.
gcc/testsuite/
Backport from mainline
2019-03-14 H.J. Lu <hongjiu.lu@intel.com>
Thomas Koenig [Sat, 16 Mar 2019 14:03:00 +0000 (14:03 +0000)]
re PR fortran/66089 (elemental dependency mishandling when class array are involved)
2019-03-16 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/66089
Backport from trunk
* 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-16 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/66089
Backport from trunk
* gfortran.dg/dependency_53.f90: New test.
* gfortran.dg/assumed_type_2.f90: Adapted tree dumps.
* gfortran.dg/no_arg_check_2.f90: Likewise.
Thomas Koenig [Sat, 16 Mar 2019 13:24:40 +0000 (13:24 +0000)]
re PR fortran/66695 ([F03] ICE with binding-name equal to the name of a use-associated procedure)
2019-03-16 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/66695
PR fortran/77746
PR fortran/79485
Backport from trunk
* 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-16 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/66695
PR fortran/77746
PR fortran/79485
Backport from trunk
* 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.
Richard Biener [Thu, 14 Mar 2019 09:18:07 +0000 (09:18 +0000)]
backport: re PR target/84272 (AddressSanitizer: heap-use-after-free ../../gcc/config/aarch64/cortex-a57-fma-steering.c:519 in fma_node::get_parity())
2019-03-14 Richard Biener <rguenther@suse.de>
Backport from mainline
2018-02-16 Jakub Jelinek <jakub@redhat.com>
PR target/84272
* config/aarch64/cortex-a57-fma-steering.c (fma_forest::merge_forest):
Use ++iter rather than iter++ for std::list iterators.
(func_fma_steering::dfs): Likewise. Don't delete nodes right away,
defer deleting them until all nodes in the forest are processed. Do
free even leaf nodes. Change to_process into auto_vec.
Martin Liska [Mon, 11 Mar 2019 11:18:08 +0000 (12:18 +0100)]
Backport r268789
2019-03-11 Martin Liska <mliska@suse.cz>
Backport from mainline
2019-02-11 David Malcolm <dmalcolm@redhat.com>
PR lto/88147
* input.c (selftest::test_line_offset_overflow): New selftest.
(selftest::input_c_tests): Call it.
2019-03-11 Martin Liska <mliska@suse.cz>
Backport from mainline
2019-02-11 Martin Liska <mliska@suse.cz>
PR lto/88147
* line-map.c (linemap_line_start): Don't reuse the existing line
map if the line offset is sufficiently large to cause overflow
when computing location_t values.
Thomas Koenig [Sun, 10 Mar 2019 11:26:25 +0000 (11:26 +0000)]
re PR fortran/71544 (gfortran compiler optimization bug when dealing with c-style pointers)
2019-03-10 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/71544
Backport from trunk
* 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-10 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/71544
Backport from trunk
* gfortran.dg/c_ptr_tests_19.f90: New test.
Thomas Koenig [Sun, 10 Mar 2019 11:09:30 +0000 (11:09 +0000)]
re PR fortran/87734 (ICE in is_illegal_recursion check for character len= parameter)
2019-03-10 Thomas Koenig <tkoenig@gcc.gnu.org>
Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/87734
Backort from trunk
* symbol.c (gfc_add_procedure): Only throw an error if the
procedure has not been declared either PUBLIC or PRIVATE.
* resolve.c (is_illegal_recursion): Remove an assert().
2019-03-10 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/87734
Backport from trunk
* gfortran.dg/public_private_module_10.f90: New test.
Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>
From-SVN: r269550
Thomas Koenig [Sun, 3 Mar 2019 09:20:09 +0000 (09:20 +0000)]
re PR fortran/87689 (PowerPC64 ELFv2 function parameter passing violation)
2019-03-03 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/87689
Backport from trunk
* trans-decl.c (gfc_get_extern_function_decl): Add argument
actual_args and pass it through to gfc_get_function_type.
* trans-expr.c (conv_function_val): Add argument actual_args
and pass it on to gfc_get_extern_function_decl.
(conv_procedure_call): Pass actual arguments to conv_function_val.
* trans-types.c (get_formal_from_actual_arglist): New function.
(gfc_get_function_type): Add argument actual_args. Generate
formal args from actual args if necessary.
* trans-types.h (gfc_get_function_type): Add optional argument.
* trans.h (gfc_get_extern_function_decl): Add optional argument.
2019-03-03 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/87689
Backport from trunk
* gfortran.dg/lto/20091028-1_0.f90: Add -Wno-lto-type-mismatch to
options.
* gfortran.dg/lto/20091028-2_0.f90: Likewise.
* gfortran.dg/lto/pr87689_0.f: New file.
* gfortran.dg/lto/pr87689_1.f: New file.
* gfortran.dg/altreturn_9_0.f90: New file.
* gfortran.dg/altreturn_9_1.f90: New file.
Eric Botcazou [Tue, 26 Feb 2019 08:12:21 +0000 (08:12 +0000)]
re PR ada/81956 (call to null procedure not optimized away)
PR ada/81956
Backport from mainline
2017-09-06 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_Call_Helper): Do not optimize calls to
null procedures when GNAT coverage is used, so that their (empty)
bodies are properly covered.
2017-09-06 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_Call_Helper): Replace call to null
procedure by a single null statement, after evaluating the
actuals that require it.
Thomas Koenig [Sat, 23 Feb 2019 11:49:47 +0000 (11:49 +0000)]
re PR fortran/71066 (ICE in set_loop_bounds, at fortran/trans-array.c:4680)
2019-02-23 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/71066
Backport from trunk
* trans-decl.c (generate_coarray_sym_init): For an array
constructor in a DATA statement of a coarray variable, set the
rank to 1 to avoid confusion later on. If the constructor
contains only one value, use that for initiailizig.
2019-02-23 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/71066
Backport from trunk
* gfortran.dg/coarray_data_1.f90: New test.
Eric Botcazou [Sat, 23 Feb 2019 10:04:41 +0000 (10:04 +0000)]
re PR ada/89349 (segfault when building GCC 7 & 8 branch with GCC master)
PR ada/89349
Backport from mainline
2018-05-25 Arnaud Charlet <charlet@adacore.com>
* osint.ads (Unknown_Attributes): No longer pretend this is a constant.
(No_File_Info_Cache): Initialize separately.
* osint.adb (No_File_Info_Cache): Update initializer.
Jonathan Wakely [Sat, 23 Feb 2019 01:01:56 +0000 (01:01 +0000)]
PR libstdc++/89446 fix null pointer dereference in char_traits
PR libstdc++/89446
* include/bits/char_traits.h (__constant_char_array): Check index is
in range before dereferencing.
* testsuite/21_strings/basic_string_view/operators/char/89446.cc:
New test.
Martin Liska [Fri, 15 Feb 2019 10:59:02 +0000 (11:59 +0100)]
Backport r268873
2019-02-15 Martin Liska <mliska@suse.cz>
Backport from mainline
2019-02-14 Martin Liska <mliska@suse.cz>
PR rtl-optimization/89242
* dce.c (delete_unmarked_insns): Call free_dominance_info we
process a transformation.
2019-02-15 Martin Liska <mliska@suse.cz>
Backport from mainline
2019-02-14 Martin Liska <mliska@suse.cz>
PR rtl-optimization/89242
* g++.dg/pr89242.C: New test.