David Edelsohn [Wed, 15 May 2019 17:11:31 +0000 (17:11 +0000)]
backport: re PR target/61976 (aix64: Data corruption in struct passed by value)
Backport from mainline
2019-04-11 David Edelsohn <dje.gcc@gmail.com>
* xcoffout.h (xcoff_private_rodata_section_name): Declare.
* xcoffout.c (xcoff_private_rodata_section_name): Define.
* config/rs6000/rs6000.c (rs6000_xcoff_asm_init_sections): Create
read_only_private_data_section using coff_private_rodata_section_name.
(rs6000_xcoff_file_start): Generate coff_private_rodata_section_name.
2018-12-04 David Edelsohn <dje.gcc@gmail.com>
2018-12-13 David Edelsohn <dje.gcc@gmail.com>
PR target/61976
* config/rs6000/rs6000.c (rs6000_function_arg): Don't pass aggregates
in FPRs on AIX. Ensure type is non-NULL.
(rs6000_arg_partial_bytes): Same.
Jonathan Wakely [Wed, 8 May 2019 12:17:26 +0000 (13:17 +0100)]
PR libstdc++/90105 make forward_list::sort stable
While testing the fix I also discovered that operator== assumes the
elements are comparable with operator!= which is not required.
Backport from mainline
2019-04-17 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/90105
* include/bits/forward_list.tcc (operator==): Do not use operator!= to
compare elements.
(forward_list<T, A>::sort(Comp)): When elements are equal take the one
earlier in the list, so that sort is stable.
* testsuite/23_containers/forward_list/operations/90105.cc: New test.
* testsuite/23_containers/forward_list/comparable.cc: Test with
types that meet the minimum EqualityComparable and LessThanComparable
requirements. Remove irrelevant comment.
Jonathan Wakely [Wed, 8 May 2019 12:17:20 +0000 (13:17 +0100)]
PR libstdc++/89629 fix _Hash_bytes for lengths > INT_MAX
Backport from mainline
2019-03-11 Jonathan Wakely <jwakely@redhat.com>
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.
Fix output_constructor_bitfield handling of wide bitfields (PR89037)
The testcase was failing because we were trying to access
TREE_INT_CST_ELT (x, 1) of a 128-bit integer that was small enough
to need only a single element.
2019-05-07 Richard Sandiford <richard.sandiford@arm.com>
gcc/
Backport from mainline:
2019-01-25 Richard Sandiford <richard.sandiford@arm.com>
PR middle-end/89037
* varasm.c (output_constructor_bitfield): Use wi::extract_uhwi
instead of accessing TREE_INT_CST_ELT directly.
gcc/testsuite/
Backport from mainline:
2019-01-25 Richard Sandiford <richard.sandiford@arm.com>
This keeps coming up repeatedly and the ACLE has finally added
__ARM_FEATURE_ATOMICS for the LSE feature in GCC. This is now part of
the latest ACLE release
(https://developer.arm.com/docs/101028/latest/5-feature-test-macros)
I know it's late for GCC-9 but this is a simple macro which need not
wait for another year.
Ok for trunk and to backport to all release branches ?
Tested with a simple build and a smoke test.
Backport from mainline.
PR target/86538
* config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Define
__ARM_FEATURE_ATOMICS
backport: re PR target/87532 (bad results from vec_extract(unsigned char, foo) dependent upon function inline)
gcc/ChangeLog:
2019-04-22 Kelvin Nilsen <kelvin@gcc.gnu.org>
Backport from mainline
2019-03-15 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/87532
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
When handling vec_extract, use modular arithmetic to allow
constant selectors greater than vector length.
* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Allow
V1TImode vectors to have constant selector values greater than 0.
Use modular arithmetic to compute vector index.
(rs6000_split_vec_extract_var): Use modular arithmetic to compute
index for in-memory vectors. Correct code generation for
in-register vectors. Use inner mode of vector rather than mode of
destination for move instruction.
(altivec_expand_vec_ext_builtin): Use modular arithmetic to
compute index.
2019-04-12 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/87532
* config/rs6000/vsx.md (*vsx_extract_<mode>_<VS_scalar>mode_var):
Use QI inner mode with V16QI vector mode.
gcc/testsuite/ChangeLog:
2019-04-22 Kelvin Nilsen <kelvin@gcc.gnu.org>
Backport from mainline
2019-03-15 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/87532
* gcc.target/powerpc/pr87532-mc.c: New test.
* gcc.target/powerpc/pr87532.c: New test.
* gcc.target/powerpc/vec-extract-v16qiu-v2.h: New test.
* gcc.target/powerpc/vec-extract-v16qiu-v2a.c: New test.
* gcc.target/powerpc/vec-extract-v16qiu-v2b.c: New test.
* gcc.target/powerpc/vsx-builtin-10a.c: New test.
* gcc.target/powerpc/vsx-builtin-10b.c: New test.
* gcc.target/powerpc/vsx-builtin-11a.c: New test.
* gcc.target/powerpc/vsx-builtin-11b.c: New test.
* gcc.target/powerpc/vsx-builtin-12a.c: New test.
* gcc.target/powerpc/vsx-builtin-12b.c: New test.
* gcc.target/powerpc/vsx-builtin-13a.c: New test.
* gcc.target/powerpc/vsx-builtin-13b.c: New test.
* gcc.target/powerpc/vsx-builtin-14a.c: New test.
* gcc.target/powerpc/vsx-builtin-14b.c: New test.
* gcc.target/powerpc/vsx-builtin-15a.c: New test.
* gcc.target/powerpc/vsx-builtin-15b.c: New test.
* gcc.target/powerpc/vsx-builtin-16a.c: New test.
* gcc.target/powerpc/vsx-builtin-16b.c: New test.
* gcc.target/powerpc/vsx-builtin-17a.c: New test.
* gcc.target/powerpc/vsx-builtin-17b.c: New test.
* gcc.target/powerpc/vsx-builtin-18a.c: New test.
* gcc.target/powerpc/vsx-builtin-18b.c: New test.
* gcc.target/powerpc/vsx-builtin-19a.c: New test.
* gcc.target/powerpc/vsx-builtin-19b.c: New test.
* gcc.target/powerpc/vsx-builtin-20a.c: New test.
* gcc.target/powerpc/vsx-builtin-20b.c: New test.
* gcc.target/powerpc/vsx-builtin-9a.c: New test.
* gcc.target/powerpc/vsx-builtin-9b.c: New test.
2019-03-19 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/89736
* gcc.target/powerpc/pr87532-mc.c: Modify dejagnu directives to
restrict this test to vsx targets.
Xiong Hu Luo [Fri, 19 Apr 2019 03:30:33 +0000 (03:30 +0000)]
backport r257541, r259936, r260294, r260623, r261098, r261333, r268585 from trunk
These patches are followed changes for r255555 on testcases
vsx-vector-6*.c. Backport them to update file names and fix regressions
for GCC7 on power9.
See e.g. https://gcc.gnu.org/ml/gcc-testresults/2019-04/msg00159.html
for the failures this patch fixes; the patch is for GCC 7.
gcc/ChangeLog:
2019-04-19 Xiong Hu Luo <luoxhu@linux.ibm.com>
Backport from trunk
2018-05-23 Segher Boessenkool <segher@kernel.crashing.org>
* doc/sourcebuild.texi (Endianness): New subsubsection.
gcc/testsuite/ChangeLog:
2019-04-19 Xiong Hu Luo <luoxhu@linux.ibm.com>
Backport from trunk
2018-02-07 Will Schmidt <will_schmidt@vnet.ibm.com>
* gcc.target/powerpc/vsx-vector-6-le.c: Update CPU target.
* gcc.target/powerpc/vsx-vector-6-le.p9.c: New.
Backport from trunk
2018-05-04 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/vsx-vector-6.h (foo): Add test for vec_max,
vec_trunc.
* gcc.target/powerpc/vsx-vector-6-le.c (dg-final): Update xvcmpeqdp,
xvcmpgtdp, xvcmpgedp counts. Add xxsel counts.
* gcc.target/powerpc/vsx-vector-6-be.c (dg-final): Update xvcmpgtdp,
xvcmpgedp counts. Add xxsel counts.
Backport from trunk
2018-05-16 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/vsx-vector-6-be.c: Remove file.
* gcc.target/powerpc/vsx-vector-6-be.p7.c: New test file.
* gcc.target/powerpc/vsx-vector-6-be.p8.c: New test file.
* gcc.target/powerpc/vsx-vector-6-le.c (dg-final): Update counts for
xvcmpeqdp., xvcmpgtdp., xvcmpgedp., xxlxor, xvrdpi.
Backport from trunk
2018-05-23 Segher Boessenkool <segher@kernel.crashing.org>
Backport from trunk
2018-06-01 Carl Love <cel@us.ibm.com>
Commit 260294 on 2018-05-16 by Carl Love was supposed to add the
following files.
* gcc.target/powerpc/vsx-vector-6-be.p7.c: New test file.
* gcc.target/powerpc/vsx-vector-6-be.p8.c: New test file.
Backport from trunk
2018-06-08 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/vsx-vector-6-be.p7.c: Rename this file to
vsx-vector-6.p7.c.
* gcc.target/powerpc/vsx-vector-6-le.p9.c: Rename this file to
vsx-vector-6.p9.c.
* gcc.target/powerpc/vsx-vector-6-be.p8.c: Move instruction counts
for BE system that are different then for an LE system from this file
into vsx-vector-6-le.c using be target qualifier. Remove this file.
* gcc.target/powerpc/vsx-vector-6-le.c: Add le qualifiers as needed for
the various instruction counts. Rename file to vsx-vector-6.p8.c.
Backport from trunk
2019-02-06 Bill Seurer <seurer@linux.vnet.ibm.com>
* gcc.target/powerpc/vsx-vector-6.p7.c: Update instruction
counts and target.
* gcc.target/powerpc/vsx-vector-6.p8.c: Update instruction
counts and target.
* gcc.target/powerpc/vsx-vector-6.p9.c: Update instruction
counts and target.
Thomas Koenig [Sun, 14 Apr 2019 12:27:44 +0000 (12:27 +0000)]
re PR fortran/87352 (Large stack usage with new gfortran)
2019-04-14 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/87352
Backport from trunk
* gfortran.h (gfc_component): Add finalized field.
* class.c (finalize_component): If the component is already
finalized, return early. Set component->finalized on exit.
2019-04-14 Thomas Koenig <tkoenig@gcc.gnu.org>
Backport from trunk
PR fortran/87352
* gfortran.dg/finalize_28.f90: Adjust count of __builtin_free.
* gfortran.dg/finalize_34.f90: New test.
Martin Liska [Thu, 11 Apr 2019 08:59:48 +0000 (10:59 +0200)]
Backport r269492
2019-04-11 Martin Liska <mliska@suse.cz>
Backport from mainline
2019-03-08 Martin Liska <mliska@suse.cz>
PR target/86952
* config/i386/i386.c (ix86_option_override_internal): Disable
jump tables when retpolines are used.
2019-04-11 Martin Liska <mliska@suse.cz>
Backport from mainline
2019-03-08 Martin Liska <mliska@suse.cz>
PR target/86952
* gcc.target/i386/pr86952.c: New test.
* gcc.target/i386/indirect-thunk-7.c: Use jump tables to match
scanned pattern.
* gcc.target/i386/indirect-thunk-inline-7.c: Likewise.
The "*neon_mov<mode>" patterns for 128 bit sized quantities uses the "Dn"
constraint to match vmov.f32 and vmov.i<vec-width> patterns.
This constraint boils down to using the `neon_immediate_valid` function.
Once the constraint has matched, the output C statement asserts that function
passes.
The output C statement calls `neon_immediate_valid` with the mode taken from the
iterator, while the constraint takes the mode from the operand.
This can cause a discrepency when the operand is a CONST_INT, as the constraint
passes VOIDmode which `neon_immediate_valid` treats as DImode, while the C
statement passes the mode of the iterator which can be TImode.
When this happens, the `neon_immediate_valid` can fail in the second call (if
e.g. the CONST_INT is a valid immediate in DImode but not TImode) which would
trigger the assertion.
The testcase added with this patch triggers this when compiled with an arm cross
compiler using the command line below.
gcc -march=armv8-a -c neon-immediate-timode.c -O1 -mfloat-abi=hard -mfpu=neon-fp-armv8
This patch splits the original "Dn" constraint into three new constraints, "DN"
for TImode CONST_INT, "Dn" for DImode CONST_INT, and "Dm" for CONST_VECTOR.
Splitting things up this way requires using one extra alternative in the
"*neon_mov<mode>" patterns, but makes it clear from the constraint what mode is
being used.
We also remove the behaviour of treating VOIDmode as DImode in
`neon_valid_immediate` since the original "Dn" constraint was the only place
that functionality was used. VOIDmode is now never passed to that function.
An assertion has been added to the function to ensure this problem is caught
earlier on.
bootstrapped and regtested on arm-none-linux-gnueabihf
gcc/ChangeLog:
2019-04-10 Matthew Malcomson <matthew.malcomson@arm.com>
PR target/90024
* config/arm/arm.c (neon_valid_immediate): Disallow VOIDmode parameter.
* config/arm/constraints.md (Dm, DN, Dn): Split previous Dn constraint
into three.
* config/arm/neon.md (*neon_mov<mode>): Account for TImode and DImode
differences directly.
(*smax<mode>3_neon, vashl<mode>3, vashr<mode>3_imm): Use Dm constraint.
gcc/testsuite/ChangeLog:
2019-04-10 Matthew Malcomson <matthew.malcomson@arm.com>
PR target/90024
* gcc.dg/torture/neon-immediate-timode.c: New test.
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.