]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
5 years agoDaily bump.
GCC Administrator [Wed, 27 Nov 2019 00:16:15 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278750

5 years agobackport: re PR libfortran/92100 (Formatted stream IO irreproducible read with binary...
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.

        gfortran.dg/streamio_18.f90: New test.

From-SVN: r278740

5 years agoDaily bump.
GCC Administrator [Tue, 26 Nov 2019 00:16:11 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278715

5 years agoFix EOF handling for arrays.
Thomas Koenig [Mon, 25 Nov 2019 20:04:28 +0000 (20:04 +0000)] 
Fix EOF handling for arrays.

2019-11-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
Harald Anlauf <anlauf@gmx.de>

Backport from trunk
PR fortran/92569
* io/transfer.c (transfer_array_inner):  If position is
at AFTER_ENDFILE in current unit, return from data loop.

2019-11-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
Harald Anlauf <anlauf@gmx.de>

Backport from trunk
PR fortran/92569
* gfortran.dg/eof_6.f90: New test.

Co-Authored-By: Harald Anlauf <anlauf@gmx.de>
From-SVN: r278702

5 years agoFortran] PR 92050 - fix ICE with -fcheck=all
Tobias Burnus [Mon, 25 Nov 2019 14:33:32 +0000 (15:33 +0100)] 
Fortran] PR 92050 - fix ICE with -fcheck=all

        Backport from mainline
        2019-10-11  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92050
        * trans-expr.c (gfc_conv_procedure_call): Handle code generated
        by -fcheck=all.

        PR fortran/92050
        * gfortran.dg/pr92050.f90: New.

From-SVN: r278689

5 years agore PR ada/92362 (double elaboration of expression in Address aspect)
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.

From-SVN: r278676

5 years agore PR ada/92575 (couple of suspicious assignments in expect.c)
Eric Botcazou [Mon, 25 Nov 2019 10:30:41 +0000 (10:30 +0000)] 
re PR ada/92575 (couple of suspicious assignments in expect.c)

PR ada/92575
* expect.c (__gnat_expect_poll [VMS, HPUX]): Fix typo.

From-SVN: r278672

5 years agoDaily bump.
GCC Administrator [Mon, 25 Nov 2019 00:16:15 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278662

5 years agoDaily bump.
GCC Administrator [Sun, 24 Nov 2019 00:16:09 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278652

5 years agoDaily bump.
GCC Administrator [Sat, 23 Nov 2019 00:16:16 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278637

5 years agoPR libstdc++/92267 fix ABI change in deque iterators
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.

From-SVN: r278614

5 years agoDaily bump.
GCC Administrator [Fri, 22 Nov 2019 00:16:34 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278606

5 years agore PR tree-optimization/91355 (optimized code does not call destructor while unwindin...
Jakub Jelinek [Thu, 21 Nov 2019 13:53:57 +0000 (14:53 +0100)] 
re PR tree-optimization/91355 (optimized code does not call destructor while unwinding after exception)

PR tree-optimization/91355
* tree-ssa-sink.c (select_best_block): Use >= rather than >
for early_bb scaled count with best_bb count comparison.

* g++.dg/torture/pr91355.C: New test.

From-SVN: r278551

5 years agorevert: re PR tree-optimization/91790 (ICE: verify_ssa failed (error: definition...
Richard Biener [Thu, 21 Nov 2019 09:18:06 +0000 (09:18 +0000)] 
revert: re PR tree-optimization/91790 (ICE: verify_ssa failed (error: definition in block 2 follows the use))

2019-11-21  Richard Biener  <rguenther@suse.de>

Revert
2019-09-17  Richard Biener  <rguenther@suse.de>

PR tree-optimization/91790
* tree-vect-stmts.c (vectorizable_load): For BB vectorization
use the correct DR for setting up realignment.

From-SVN: r278545

5 years agoDaily bump.
GCC Administrator [Thu, 21 Nov 2019 00:16:27 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278536

5 years agoBackport fix for PR92090.
Peter Bergner [Wed, 20 Nov 2019 20:42:41 +0000 (20:42 +0000)] 
Backport fix for PR92090.

gcc/
Backport from mainline
2019-11-07  Peter Bergner <bergner@linux.ibm.com>

PR other/92090
* config/rs6000/predicates.md (input_operand): Allow MODE_PARTIAL_INT
modes for integer constants.

gcc/testsuite/
Backport from mainline
2019-11-13  David Edelsohn  <dje.gcc@gmail.com>

* gcc.target/powerpc/pr92090.c: Limit -mbig to powerpc64le-*-*.
* gcc.target/powerpc/pr92090-2.c: Likewise.

2019-11-07  Peter Bergner <bergner@linux.ibm.com>

PR other/92090
* gcc.target/powerpc/pr92090-2.c: New test.

2019-11-07  Peter Bergner <bergner@linux.ibm.com>

PR other/92090
* gcc.target/powerpc/pr92090.c: New test.

From-SVN: r278527

5 years agore PR middle-end/90796 (GCC: O2 vs O3 output differs on simple test)
Michael Matz [Wed, 20 Nov 2019 16:51:10 +0000 (16:51 +0000)] 
re PR middle-end/90796 (GCC: O2 vs O3 output differs on simple test)

Fix PR90796

       PR middle-end/90796
       * gimple-loop-jam.c (any_access_function_variant_p): New function.
       (adjust_unroll_factor): Use it to constrain safety, new parameter.
       (tree_loop_unroll_and_jam): Adjust call and profitable unroll factor.

testsuite/
       Backport from mainline
       PR middle-end/90796
       * gcc.dg/unroll-and-jam.c: Disable loop-invariant motion and adjust.

       PR middle-end/90796
       * gcc.dg/unroll-and-jam.c: Add three invalid and one valid case.

From-SVN: r278512

5 years agoDocument -Wc11-c2x-compat.
Joseph Myers [Wed, 20 Nov 2019 16:43:14 +0000 (16:43 +0000)] 
Document -Wc11-c2x-compat.

My patch that added initial C2X support and associated command-line
options missed documenting -Wc11-c2x-compat although the other options
were properly documented.  This patch adds the missing documentation.

Tested with "make info" and "make pdf".

* doc/invoke.texi (-Wc11-c2x-compat): Document.

From-SVN: r278511

5 years agore PR c++/90767 (jumbled error message with this and const)
Jakub Jelinek [Wed, 20 Nov 2019 09:55:56 +0000 (10:55 +0100)] 
re PR c++/90767 (jumbled error message with this and const)

PR c++/90767
* call.c (complain_about_no_candidates_for_method_call): If
conv->from is not a type, pass to complain_about_bad_argument
lvalue_type of conv->from.

* g++.dg/diagnostic/pr90767-1.C: New test.
* g++.dg/diagnostic/pr90767-2.C: New test.

From-SVN: r278492

5 years agore PR middle-end/90840 (ICE in simplify_subreg, at simplify-rtx.c:6441)
Jakub Jelinek [Wed, 20 Nov 2019 09:55:01 +0000 (10:55 +0100)] 
re PR middle-end/90840 (ICE in simplify_subreg, at simplify-rtx.c:6441)

PR middle-end/90840
* expmed.c (store_bit_field_1): Handle the case where op0 is not a MEM
and has a mode that doesn't have corresponding integral type.

* gcc.c-torture/compile/pr90840.c: New test.

From-SVN: r278491

5 years agore PR target/90867 (Multiplication or typecast of integer and double always zero...
Jakub Jelinek [Wed, 20 Nov 2019 09:54:02 +0000 (10:54 +0100)] 
re PR target/90867 (Multiplication or typecast of integer and double always zero when...)

PR target/90867
* config/i386/i386.c (ix86_valid_target_attribute_tree): Don't
clear opts->x_ix86_isa_flags{,2} here...
(ix86_valid_target_attribute_inner_p): ... but here when seeing
arch=.  Also clear opts->x_ix86_isa_flags{,2}_explicit.

* gcc.target/i386/pr90867.c: New test.

From-SVN: r278490

5 years agore PR c/90898 (ICE in insert_clobber_before_stack_restore, at tree-ssa-ccp.c:2112)
Jakub Jelinek [Wed, 20 Nov 2019 09:53:15 +0000 (10:53 +0100)] 
re PR c/90898 (ICE in insert_clobber_before_stack_restore, at tree-ssa-ccp.c:2112)

PR c/90898
* tree-ssa-ccp.c (insert_clobber_before_stack_restore): Remove
assertion.
(insert_clobbers_for_var): Fix a typo in function comment.

* gcc.dg/pr90898.c: New test.

From-SVN: r278489

5 years agobackport: re PR c++/92504 (ICE on gcc-9 -fopenmp: internal compiler error: tree check...
Jakub Jelinek [Wed, 20 Nov 2019 09:52:27 +0000 (10:52 +0100)] 
backport: re PR c++/92504 (ICE on gcc-9 -fopenmp: internal compiler error: tree check: expected tree that contains 'decl common' structure, have 'baselink' in get_inner_reference, at expr.c:7238)

Backported from mainline
2019-11-19  Jakub Jelinek  <jakub@redhat.com>

PR c++/92504
* semantics.c (handle_omp_for_class_iterator): Don't call
cp_fully_fold on cond.

* g++.dg/gomp/pr92504.C: New test.

From-SVN: r278488

5 years agoDaily bump.
GCC Administrator [Wed, 20 Nov 2019 00:16:14 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278473

5 years agore PR middle-end/91450 (__builtin_mul_overflow(A,B,R) wrong code if product < 0,...
Jakub Jelinek [Tue, 19 Nov 2019 09:26:23 +0000 (10:26 +0100)] 
re PR middle-end/91450 (__builtin_mul_overflow(A,B,R) wrong code if product < 0, *R is unsigned, and !(A&B))

PR middle-end/91450
* internal-fn.c (expand_mul_overflow): For s1 * s2 -> ur, if one
operand is negative and one non-negative, compare the non-negative
one against 0 rather than comparing s1 & s2 against 0.  Otherwise,
don't compare (s1 & s2) == 0, but compare separately both s1 == 0
and s2 == 0, unless one of them is known to be negative.  Remove
tem2 variable, use tem where tem2 has been used before.

* gcc.c-torture/execute/pr91450-1.c: New test.
* gcc.c-torture/execute/pr91450-2.c: New test.

From-SVN: r278438

5 years ago* doc/invoke.texi (-gno-internal-reset-location-views): Fix typo.
Eric Botcazou [Tue, 19 Nov 2019 09:12:36 +0000 (09:12 +0000)] 
* doc/invoke.texi (-gno-internal-reset-location-views): Fix typo.

From-SVN: r278435

5 years agoDaily bump.
GCC Administrator [Tue, 19 Nov 2019 00:16:20 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278426

5 years agobackport: rs6000.md (rs6000_set_fpscr_drn): Use ULL on big hexadecimal literal.
Segher Boessenkool [Mon, 18 Nov 2019 19:29:03 +0000 (20:29 +0100)] 
backport: rs6000.md (rs6000_set_fpscr_drn): Use ULL on big hexadecimal literal.

Backport from trunk
2019-11-12  Segher Boessenkool  <segher@kernel.crashing.org>

* config/rs6000/rs6000.md (rs6000_set_fpscr_drn): Use ULL on big
hexadecimal literal.

From-SVN: r278420

5 years agoAArch64: Correct HWCAP for fp16fml
Tamar Christina [Mon, 18 Nov 2019 15:29:40 +0000 (15:29 +0000)] 
AArch64: Correct HWCAP for fp16fml

Backport from mainline
2019-09-24  Stamatis Markianos-Wright  <stam.markianos-wright@arm.com>

* config/aarch64/aarch64-option-extensions.def (fp16fml):
Update hwcap string for fp16fml.

From-SVN: r278412

5 years agoDaily bump.
GCC Administrator [Mon, 18 Nov 2019 00:16:09 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278381

5 years agolinux-atomic.c (__kernel_cmpxchg): Change argument 1 to volatile void *.
John David Anglin [Sun, 17 Nov 2019 23:15:29 +0000 (23:15 +0000)] 
linux-atomic.c (__kernel_cmpxchg): Change argument 1 to volatile void *.

* config/pa/linux-atomic.c (__kernel_cmpxchg): Change argument 1 to
volatile void *.  Remove trap check.
(__kernel_cmpxchg2): Likewise.
(FETCH_AND_OP_2): Adjust operand types.
(OP_AND_FETCH_2): Likewise.
(FETCH_AND_OP_WORD): Likewise.
(OP_AND_FETCH_WORD): Likewise.
(COMPARE_AND_SWAP_2): Likewise.
(__sync_val_compare_and_swap_4): Likewise.
(__sync_bool_compare_and_swap_4): Likewise.
(SYNC_LOCK_TEST_AND_SET_2): Likewise.
(__sync_lock_test_and_set_4): Likewise.
(SYNC_LOCK_RELEASE_1): Likewise.  Use __kernel_cmpxchg2 for release.
(__sync_lock_release_4): Adjust operand types.  Use __kernel_cmpxchg
for release.
(__sync_lock_release_8): Remove.

From-SVN: r278378

5 years agoDaily bump.
GCC Administrator [Sun, 17 Nov 2019 00:16:09 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278368

5 years agoDaily bump.
GCC Administrator [Sat, 16 Nov 2019 00:16:10 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278327

5 years agoFree dominance info at the beginning of pass_jump_after_combine
Ilya Leoshkevich [Fri, 15 Nov 2019 12:55:05 +0000 (12:55 +0000)] 
Free dominance info at the beginning of pass_jump_after_combine

try_forward_edges does not update dominance info, and merge_blocks
relies on it being up-to-date.  In PR92430 stale dominance info makes
merge_blocks produce a loop in the dominator tree, which in turn makes
delete_basic_block loop forever.

Fix by freeing dominance info at the beginning of cleanup_cfg.

Also, since the whole point of this pass is to perform jump threading
(other cleanups are not valuable at this point), skip it completely when
flag_thread_jumps is not set.

gcc/ChangeLog:

2019-11-15  Ilya Leoshkevich  <iii@linux.ibm.com>

Backport from mainline
PR rtl-optimization/92430
* cfgcleanup.c (pass_jump_after_combine::gate): New function.
(pass_jump_after_combine::execute): Free
dominance info at the beginning.

gcc/testsuite/ChangeLog:

2019-11-15  Ilya Leoshkevich  <iii@linux.ibm.com>

Backport from mainline
PR rtl-optimization/92430
* gcc.dg/pr92430.c: New test (from Arseny Solokha).

From-SVN: r278291

5 years agoDaily bump.
GCC Administrator [Fri, 15 Nov 2019 00:16:08 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278271

5 years ago[ARC] Backport from mainline r278056,r278057
Claudiu Zissulescu [Thu, 14 Nov 2019 09:58:19 +0000 (09:58 +0000)] 
[ARC] Backport from mainline r278056,r278057

From-SVN: r278215

5 years agoBackport r278210
Martin Liska [Thu, 14 Nov 2019 09:45:37 +0000 (10:45 +0100)] 
Backport r278210

2019-11-14  Martin Liska  <mliska@suse.cz>

Backport from mainline
2019-11-14  Martin Liska  <mliska@suse.cz>

PR target/92389
* config/i386/i386.h: Add PTA_AVX512VPOPCNTDQ to
PTA_ICELAKE_CLIENT which is later interited by
PTA_ICELAKE_SERVER and PTA_TIGERLAKE.

From-SVN: r278214

5 years agoFix gfortran.dg/ISO_Fortran_binding_17.c using rel. #include
Tobias Burnus [Thu, 14 Nov 2019 08:02:42 +0000 (08:02 +0000)] 
Fix gfortran.dg/ISO_Fortran_binding_17.c using rel. #include

        PR fortran/92470
        PR fortran/92500
        * gfortran.dg/ISO_Fortran_binding_17.c: Include
        ISO_Fortran_binding.h with relative path.

From-SVN: r278201

5 years agoDaily bump.
GCC Administrator [Thu, 14 Nov 2019 00:16:22 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278188

5 years agoSanitize the constant argument for rotr<mode>3
Dragan Mladjenovic [Wed, 13 Nov 2019 19:20:15 +0000 (19:20 +0000)] 
Sanitize the constant argument for rotr<mode>3

This was dormant for quite some time, but it started happening for me
on gcc.c-torture/compile/pr65153.c sometime after r276645 for -mabi=32 linux runs.

The pattern accepts any SMALL_OPERAND constant value while it asserts during the final
that the value is in the mode size range. I this case it happens that combine_and_move_insns
during ira makes a pattern with negative "shift count" which fails at final stage.

This simple fix just truncates the constant operand to mode size the same as shift patterns.

gcc/ChangeLog:

2019-11-13  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

Backport from mainline
* config/mips/mips.md (rotr<mode>3): Sanitize the constant argument
instead of asserting its value.

From-SVN: r278154

5 years agoPR fortran/92470 Fixes for CFI_address
Tobias Burnus [Wed, 13 Nov 2019 15:06:47 +0000 (16:06 +0100)] 
PR fortran/92470 Fixes for CFI_address

        Backport from mainline

        libgfortran/
        2019-11-13  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92470
        * runtime/ISO_Fortran_binding.c (CFI_establish): Set lower_bound to 0
        also for CFI_attribute_other.

        2019-11-12  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92470
        * runtime/ISO_Fortran_binding.c (CFI_address): Handle non-zero
        lower_bound; update error message.
        (CFI_allocate): Fix comment typo.
        (CFI_establish): Fix identation, fix typos, don't check values of 'dv'
        argument.

        gcc/testsuite/
        2019-11-13  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92470
        * gfortran.dg/ISO_Fortran_binding_1.c (establish_c): Add assert for
        lower_bound == 0.

        2019-11-12  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92470
        * gfortran.dg/ISO_Fortran_binding_17.c: New.
        * gfortran.dg/ISO_Fortran_binding_17.f90: New.
        * gfortran.dg/ISO_Fortran_binding_1.c (elemental_mult_c, allocate_c,
        section_c, select_part_c): Update for CFI_{address} changes;
        add asserts.

From-SVN: r278143

5 years agoc-ada-spec.c (get_underlying_decl): Do not look through typedefs.
Eric Botcazou [Wed, 13 Nov 2019 11:59:20 +0000 (11:59 +0000)] 
c-ada-spec.c (get_underlying_decl): Do not look through typedefs.

* c-ada-spec.c (get_underlying_decl): Do not look through typedefs.
(dump_forward_type): Do not generate a declaration for function types.
(dump_nested_type) <ARRAY_TYPE>: Do not generate a nested declaration
of the component type if it is declared in another file.

From-SVN: r278130

5 years agoDaily bump.
GCC Administrator [Wed, 13 Nov 2019 00:16:21 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278110

5 years agoDaily bump.
GCC Administrator [Tue, 12 Nov 2019 00:16:50 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278073

5 years agobackport: re PR tree-optimization/90930 (Excessive memory consumption)
Richard Biener [Mon, 11 Nov 2019 16:07:54 +0000 (16:07 +0000)] 
backport: re PR tree-optimization/90930 (Excessive memory consumption)

2019-11-11  Richard Biener  <rguenther@suse.de>

Backport from mainline
2019-06-25  Richard Biener  <rguenther@suse.de>

PR tree-optimization/90930
* tree-ssa-reassoc.c (reassociate_bb): Only rewrite expression
into parallel form in the last pass instance.

* gcc.dg/tree-ssa/reassoc-24.c: Adjust.
* gcc.dg/tree-ssa/reassoc-25.c: Likewise.

From-SVN: r278059

5 years ago[PR87833] x86: Put -fPIC and -shared the last to create offload image
H.J. Lu [Mon, 11 Nov 2019 08:39:10 +0000 (00:39 -0800)] 
[PR87833] x86: Put -fPIC and -shared the last to create offload image

On x86, since -fPIC and -shared should be used to create offload image,
we put them the last to properly create offload image.

2019-11-11  H.J. Lu  <hjl.tools@gmail.com>

PR target/87833
* config/i386/intelmic-mkoffload.c (prepare_target_image): Put
-fPIC and -shared the last to create offload image.

Backport from trunk r278041.

From-SVN: r278042

5 years agoAssert 'offset2' instead of 'offset' in 'gcc/gimplify.c:gimplify_scan_omp_clauses'
Thomas Schwinge [Mon, 11 Nov 2019 08:19:23 +0000 (09:19 +0100)] 
Assert 'offset2' instead of 'offset' in 'gcc/gimplify.c:gimplify_scan_omp_clauses'

... to fix a long-time typo/copy'n'past-o.

gcc/
* gimplify.c (gimplify_scan_omp_clauses): Assert 'offset2' instead
of 'offset'.

Backport from trunk r278038.

From-SVN: r278039

5 years ago[build] Properly track GCC language configure fragments
Thomas Schwinge [Mon, 11 Nov 2019 08:06:25 +0000 (09:06 +0100)] 
[build] Properly track GCC language configure fragments

The 'gcc/configure' script sources all 'gcc/*/config-lang.in' files, but fails
to emit such dependency information into the build machinery.  That means,
currently, when something gets changed in a 'gcc/*/config-lang.in' file, this
is not noticed, and doesn't propagate through the build machinery.

Handling of configure fragments is modelled in the same way as it already
exists for Makefile fragments.

gcc/
* Makefile.in (LANG_CONFIGUREFRAGS): Define.
(config.status): Use/depend on it.
* configure.ac (all_lang_configurefrags): Track, 'AC_SUBST'.
* configure: Regenerate.

Backport from trunk r278035.

From-SVN: r278036

5 years agoDaily bump.
GCC Administrator [Mon, 11 Nov 2019 00:16:13 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278031

5 years agoPut vtab into RO section, same for __def_init if it contains an initializer.
Thomas Koenig [Sun, 10 Nov 2019 11:19:13 +0000 (11:19 +0000)] 
Put vtab into RO section, same for __def_init if it contains an initializer.

2019-11-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

Backport from trunk
PR fortran/92113
* trans-decl.c (gfc_get_symbol_decl): If __def_init actually
contains a value, put it into  the read-only section.

From-SVN: r278015

5 years agoCommit symbol for external BLAS routine when translating MATMUL to *GEMM.
Thomas Koenig [Sun, 10 Nov 2019 09:34:42 +0000 (09:34 +0000)] 
Commit symbol for external BLAS routine when translating MATMUL to *GEMM.

2019-11-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

Backport from trunk
PR fortran/92321
* frontend-passes.c (call_external_blas): Commit symbol for
external BLAS routine.

2019-11-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

Backport from trunk
PR fortran/92321
* gfortran.dg/matmul_blas_2.f90: New test.

From-SVN: r278014

5 years agoDaily bump.
GCC Administrator [Sun, 10 Nov 2019 00:16:18 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r278012

5 years agobackport: pa.md (memory_barrier): Revise to use ldcw barriers.
John David Anglin [Sat, 9 Nov 2019 14:19:36 +0000 (14:19 +0000)] 
backport: pa.md (memory_barrier): Revise to use ldcw barriers.

Backport from mainline
2019-11-07  John David Anglin  <danglin@gcc.gnu.org>

* config/pa/pa.md (memory_barrier): Revise to use ldcw barriers.
Enhance comment.
(memory_barrier_coherent, memory_barrier_64, memory_barrier_32): New
insn patterns using ldcw instruction.
(memory_barrier): Remove insn pattern using sync instruction.
* config/pa/pa.opt (coherent-ldcw): New option.
(ordered): New option.

From-SVN: r278001

5 years agoDaily bump.
GCC Administrator [Sat, 9 Nov 2019 00:16:15 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r277998

5 years agoPR c++/90998 - ICE with copy elision in init by ctor and -Wconversion.
Marek Polacek [Fri, 8 Nov 2019 21:52:39 +0000 (21:52 +0000)] 
PR c++/90998 - ICE with copy elision in init by ctor and -Wconversion.

* call.c (joust): Don't attempt to warn if ->second_conv is null.

* g++.dg/cpp0x/overload-conv-4.C: New test.

From-SVN: r277992

5 years agore PR middle-end/92384 (Empty class instances have different equal testing result...
Jakub Jelinek [Fri, 8 Nov 2019 19:02:24 +0000 (20:02 +0100)] 
re PR middle-end/92384 (Empty class instances have different equal testing result among GCC versions)

PR c++/92384
* function.c (assign_parm_setup_block, assign_parm_setup_stack): Don't
copy TYPE_EMPTY_P arguments from data->entry_parm to data->stack_parm
slot.
(assign_parms): For TREE_ADDRESSABLE parms with TYPE_EMPTY_P type
force creation of a unique data.stack_parm slot.

* g++.dg/torture/pr92384.C: New test.

From-SVN: r277989

5 years agobackport: re PR c++/92343 ([[likely]]/[[unlikely]] prevent method from being a consta...
Jakub Jelinek [Fri, 8 Nov 2019 19:00:02 +0000 (20:00 +0100)] 
backport: re PR c++/92343 ([[likely]]/[[unlikely]] prevent method from being a constant expression)

Backported from mainline
2019-11-05  Jakub Jelinek  <jakub@redhat.com>

PR c++/92343
* constexpr.c (potential_constant_expression_1): Return true rather
than false for PREDICT_EXPR.

* g++.dg/cpp2a/attr-likely6.C: New test.

From-SVN: r277988

5 years agobackport: re PR preprocessor/92296 (internal compiler error: Segmentation fault ...
Jakub Jelinek [Fri, 8 Nov 2019 18:59:14 +0000 (19:59 +0100)] 
backport: re PR preprocessor/92296 (internal compiler error: Segmentation fault  #pragma push_macro("__LINE__"))

Backported from mainline
2019-10-31  Jakub Jelinek  <jakub@redhat.com>

PR preprocessor/92296
* internal.h (struct def_pragma_macro): Add is_builtin bitfield.
(_cpp_restore_special_builtin): Declare.
* init.c (_cpp_restore_special_builtin): New function.
* directives.c (do_pragma_push_macro): For NT_BUILTIN_MACRO
set is_builtin and don't try to grab definition.
(cpp_pop_definition): Use _cpp_restore_special_builtin to restore
builtin macros.

* c-c++-common/cpp/pr92296-1.c: New test.
* c-c++-common/cpp/pr92296-2.c: New test.

From-SVN: r277987

5 years agobackport: re PR middle-end/92231 (ICE in gimple_fold_stmt_to_constant_1)
Jakub Jelinek [Fri, 8 Nov 2019 18:58:14 +0000 (19:58 +0100)] 
backport: re PR middle-end/92231 (ICE in gimple_fold_stmt_to_constant_1)

Backported from mainline
2019-10-31  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/92231
* tree.h (fndecl_built_in_p): Use fndecl_built_in_p instead of
DECL_BUILT_IN in comment.  Remove redundant ()s around return
argument.
* tree.c (free_lang_data_in_decl): Check if var is FUNCTION_DECL
before calling fndecl_built_in_p.
* gimple-fold.c (gimple_fold_stmt_to_constant_1): Check if
TREE_OPERAND (fn, 0) is a FUNCTION_DECL before calling
fndecl_built_in_p on it.

* lto-lang.c (handle_const_attribute): Don't call fndecl_built_in_p
on *node that is not FUNCTION_DECL.

* gcc.c-torture/compile/pr92231.c: New test.

From-SVN: r277986

5 years agobackport: re PR c++/90947 (Simple lookup table of array of strings is miscompiled)
Jakub Jelinek [Fri, 8 Nov 2019 18:56:42 +0000 (19:56 +0100)] 
backport: re PR c++/90947 (Simple lookup table of array of strings is miscompiled)

Backported from mainline
2019-10-31  Jakub Jelinek  <jakub@redhat.com>

PR c++/90947
* tree.h (type_initializer_zero_p): Remove.
* tree.c (type_initializer_zero_p): Remove.

* cp-tree.h (type_initializer_zero_p): Declare.
* decl.c (reshape_init_array_1): Formatting fix.
* tree.c (type_initializer_zero_p): New function.  Moved from
../tree.c, use next_initializable_field, formatting fix.  Return
false for TYPE_NON_AGGREGATE_CLASS types.

From-SVN: r277985

5 years agobackport: install.texi (--enable-offload-targets): Fix up a typo in the example,...
Jakub Jelinek [Fri, 8 Nov 2019 18:54:39 +0000 (19:54 +0100)] 
backport: install.texi (--enable-offload-targets): Fix up a typo in the example, use actual names of supported offload targets.

Backported from mainline
2019-10-29  Jakub Jelinek  <jakub@redhat.com>

* doc/install.texi (--enable-offload-targets): Fix up a typo in the
example, use actual names of supported offload targets.

From-SVN: r277984

5 years agobackport: locales.c (iso_3166): Add missing comma after "United-States".
Jakub Jelinek [Fri, 8 Nov 2019 18:54:15 +0000 (19:54 +0100)] 
backport: locales.c (iso_3166): Add missing comma after "United-States".

Backported from mainline
2019-10-27  Jakub Jelinek  <jakub@redhat.com>

* locales.c (iso_3166): Add missing comma after "United-States".

From-SVN: r277983

5 years agobackport: re PR tree-optimization/85887 (Missing DW_TAG_lexical_block PC range)
Jakub Jelinek [Fri, 8 Nov 2019 18:53:46 +0000 (19:53 +0100)] 
backport: re PR tree-optimization/85887 (Missing DW_TAG_lexical_block PC range)

Backported from mainline
2019-10-22  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/85887
* decl.c (expand_static_init): Drop ECF_LEAF from __cxa_guard_acquire
and __cxa_guard_release.

From-SVN: r277982

5 years agobackport: re PR sanitizer/92154 (new glibc breaks arm bootstrap due to libsanitizer)
Jakub Jelinek [Fri, 8 Nov 2019 18:53:18 +0000 (19:53 +0100)] 
backport: re PR sanitizer/92154 (new glibc breaks arm bootstrap due to libsanitizer)

Backported from mainline
2019-10-22  Tamar Christina  <tamar.christina@arm.com>

PR sanitizer/92154
* sanitizer_common/sanitizer_platform_limits_posix.cc:
Cherry-pick compiler-rt revision r375220.

From-SVN: r277981

5 years agobackport: re PR c++/92015 (internal compiler error: in cxx_eval_array_reference,...
Jakub Jelinek [Fri, 8 Nov 2019 18:52:44 +0000 (19:52 +0100)] 
backport: re PR c++/92015 (internal compiler error: in cxx_eval_array_reference, at cp/constexpr.c:2568)

Backported from mainline
2019-10-21  Jakub Jelinek  <jakub@redhat.com>

PR c++/92015
* constexpr.c (cxx_eval_component_reference, cxx_eval_bit_field_ref):
Use STRIP_ANY_LOCATION_WRAPPER on CONSTRUCTOR elts.

* g++.dg/cpp0x/constexpr-92015.C: New test.

From-SVN: r277980

5 years agooverflow-1.c: Add -fno-pie to the options.
Eric Botcazou [Fri, 8 Nov 2019 12:45:45 +0000 (12:45 +0000)] 
overflow-1.c: Add -fno-pie to the options.

* gcc.target/sparc/overflow-1.c: Add -fno-pie to the options.
* gcc.target/sparc/overflow-2.c: Likewise.

From-SVN: r277970

5 years agore PR target/92095 (internal error with -O1 -mcpu=niagara2 -fPIE)
Eric Botcazou [Fri, 8 Nov 2019 12:33:48 +0000 (12:33 +0000)] 
re PR target/92095 (internal error with -O1 -mcpu=niagara2 -fPIE)

PR target/92095
* config/sparc/sparc-protos.h (output_load_pcrel_sym): Declare.
* config/sparc/sparc.c (sparc_cannot_force_const_mem): Revert latest
  change.
(got_helper_needed): New static variable.
(output_load_pcrel_sym): New function.
(get_pc_thunk_name): Remove after inlining...
(load_got_register): ...here.  Rework the initialization of the GOT
register and of the GOT helper.
(save_local_or_in_reg_p): Test the REGNO of the GOT register.
(sparc_file_end): Test got_helper_needed to decide whether the GOT
helper must be emitted.  Use output_asm_insn instead of fprintf.
(sparc_init_pic_reg): In PIC mode, always initialize the PIC register
if optimization is enabled.
* config/sparc/sparc.md (load_pcrel_sym<P:mode>): Emit the assembly
by calling output_load_pcrel_sym.

From-SVN: r277967

5 years agoFortran] PR91253 fix continuation-line handling with -pre_include
Tobias Burnus [Fri, 8 Nov 2019 09:25:40 +0000 (10:25 +0100)] 
Fortran] PR91253 fix continuation-line handling with -pre_include

        Backport from mainline
        2019-11-08  Tobias Burnus  <tobias@codesourcery.com

        PR fortran/91253
        * scanner.c (skip_fixed_comments): Move comment
        lines to next if block.
        (gfc_next_char_literal): Fix continue_line setting.
        (get_file): Remove bogus ATTRIBUTE_UNUSED.

From-SVN: r277957

5 years agoDaily bump.
GCC Administrator [Fri, 8 Nov 2019 00:16:13 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r277939

5 years agoDaily bump.
GCC Administrator [Thu, 7 Nov 2019 00:16:16 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r277898

5 years agoS/390: Fix failing RTL check in s390_canonicalize_comparison
Ilya Leoshkevich [Wed, 6 Nov 2019 10:10:04 +0000 (10:10 +0000)] 
S/390: Fix failing RTL check in s390_canonicalize_comparison

The new sigfpe-eh.c fails with

    internal compiler error: RTL check: expected elt 0 type 'e' or 'u', have 'w' (rtx const_int)

This is most likely due to a typo: XEXP (*op1, 0) was used, when
XEXP (*op0, 1) was intended.  This did not cause any user-visible
problems, because reversed_comparison_code_parts ignores the
respective argument, and the release compiler is built without RTL
checks.

gcc/ChangeLog:

2019-11-06  Ilya Leoshkevich  <iii@linux.ibm.com>

* config/s390/s390.c (s390_canonicalize_comparison): Use XEXP
(*op0, 1) instead of XEXP (*op1, 0).

gcc/testsuite/ChangeLog:

2019-11-06  Ilya Leoshkevich  <iii@linux.ibm.com>

* gcc.target/s390/sigfpe-eh.c: New test.

From-SVN: r277874

5 years agoDaily bump.
GCC Administrator [Wed, 6 Nov 2019 00:16:14 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r277869

5 years agobackport "rs6000: Implement [u]avg<mode>3_ceil"
Segher Boessenkool [Tue, 5 Nov 2019 17:34:23 +0000 (18:34 +0100)] 
backport "rs6000: Implement [u]avg<mode>3_ceil"

* config/rs6000/altivec.md (altivec_vavgu<VI_char>): Rename to...
(uavg<mode>3_ceil): ... This.
(altivec_vavgs<VI_char>): Rename to...
(avg<mode>3_ceil): ... This.
* config/rs6000/rs6000-builtin.def (VAVGUB, VAVGSB, VAVGUH, VAVGSH,
VAVGUW, VAVGSW): Adjust.

From-SVN: r277857

5 years agobackport for PR91289
Segher Boessenkool [Tue, 5 Nov 2019 17:17:03 +0000 (18:17 +0100)] 
backport for PR91289

Backport from trunk
2019-10-26  Segher Boessenkool  <segher@kernel.crashing.org>

PR target/91289
* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Don't add an
immediate to r0; use r11 instead.  Save and restore r11 to r0 around
this.

From-SVN: r277855

5 years agoIBM Z: gen-vect-26/28: Vectorizing without peeling is ok for Z
Andreas Krebbel [Tue, 5 Nov 2019 15:27:59 +0000 (15:27 +0000)] 
IBM Z: gen-vect-26/28: Vectorizing without peeling is ok for Z

These tests check if loop peeling has been applied to avoid
having to vectorize unaligned loops.  On Z we do not have any
alignment requirements for vectorization so we also don't need want
the loop peeling here.

2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

Backport from mainline
2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

* gcc.dg/tree-ssa/gen-vect-26.c: Disable loop peeling check for
IBM Z.
* gcc.dg/tree-ssa/gen-vect-28.c: Likewise.

From-SVN: r277844

5 years agoIBM Z: gen-vect-11/32: Set min-vect-loop-bound param back to default
Andreas Krebbel [Tue, 5 Nov 2019 15:26:19 +0000 (15:26 +0000)] 
IBM Z: gen-vect-11/32: Set min-vect-loop-bound param back to default

In the Z backend we still set min-vect-loop-bound to 2 to work around
corner cases where awkward epilogue code gets generated in the
vectorizer.  This has a particular bad impact when vectorizing loops
with a low iteration count.  Due to this we do not vectorize the loop
in gen-vect-11/32 - what actually is a pity.

The patch sets min-vect-loop-bound back to the default value of 0 in
order to enable vectorization.

2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

Backport from mainline
2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

* gcc.dg/tree-ssa/gen-vect-11.c: Add --param min-vect-loop-bound=0
for IBM Z.
* gcc.dg/tree-ssa/gen-vect-11.c: Likewise.

From-SVN: r277843

5 years agoIBM Z: Fix testsuite useable_hw check
Andreas Krebbel [Tue, 5 Nov 2019 15:25:26 +0000 (15:25 +0000)] 
IBM Z: Fix testsuite useable_hw check

This fixes various issues with the useable_hw check in s390.exp.  The
check is supposed to verify whether a testcase can be run on the
current hardware.

- the test never returned true for -m31 because vzero is not available
  in ESA mode and -m31 defaults to -mesa
- the missing v0 clobber on the vzero instruction made the check fail
  if the stack pointer got saved in f0
- the lcbb instruction used for checking whether we are on a z13
  also requires vx.  Replace it with an instruction from the generic
  instruction set extensions.
- no support for z14 and z15 so far

gcc/testsuite/ChangeLog:

2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

Backport from mainline
2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

* gcc.target/s390/s390.exp
(check_effective_target_s390_useable_hw): Add inline asm for z14
and z15. Replace instruction for z13 with lochiz. Add register
clobbers. Check also for __zarch__ when doing the __VX__ test.

From-SVN: r277842

5 years agoIBM Z: Use tree_fits_uhwi_p in vector_alignment hook
Andreas Krebbel [Tue, 5 Nov 2019 15:24:43 +0000 (15:24 +0000)] 
IBM Z: Use tree_fits_uhwi_p in vector_alignment hook

This fixes an ICE in gcc.dg/attr-vector_size.c testcase.

gcc/ChangeLog:

2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

Backport from mainline
2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

* config/s390/s390.c (s390_vector_alignment): Check if the value
fits into uhwi before using it.

From-SVN: r277841

5 years agoPR 92208 + PR 92277 – GCC 9 follow-up fix
Tobias Burnus [Tue, 5 Nov 2019 14:28:07 +0000 (14:28 +0000)] 
PR 92208 + PR 92277 – GCC 9 follow-up fix

        PR fortran/92208
        Backport from mainline
        2019-10-31  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92277
        * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Fix DECL_ARTIFICIAL
        checking.

From-SVN: r277840

5 years agoDaily bump.
GCC Administrator [Tue, 5 Nov 2019 00:16:25 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r277809

5 years ago[objective-c/c++, testsuite] Fix stubify tests for -fnext-runtime.
Iain Sandoe [Mon, 4 Nov 2019 23:06:21 +0000 (23:06 +0000)] 
[objective-c/c++, testsuite] Fix stubify tests for -fnext-runtime.

Fixed to work for x86 as well as powerpc (use the final assembler output
instead of the jump rtl which varies between X86 and PPC).  Amended the
options to reflect this change.

gcc/testsuite/

Backport from mainline.
2019-06-20  Iain Sandoe  <iain@sandoe.co.uk>

* obj-c++.dg/stubify-1.mm: Adjust options and scan-asm checks.
* obj-c++.dg/stubify-2.mm: Likewise.
* objc.dg/stubify-1.m: Likewise.
* objc.dg/stubify-2.m: Likewise.

From-SVN: r277800

5 years agoFortran] PR 92208 don't use function-result dummy variable as actual argument
Tobias Burnus [Mon, 4 Nov 2019 15:07:19 +0000 (15:07 +0000)] 
Fortran] PR 92208 don't use function-result dummy variable as actual argument

        gcc/fortran/
        Backported from mainline
        2019-10-30  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92208
        * trans-array.c (gfc_conv_array_parameter): Only copy
        string-length backend_decl if expression is not a function.

        gcc/testsuite/
        Backported from mainline
        2019-10-30  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92208
        * gfortran.dg/pr92208.f90: New.

From-SVN: r277783

5 years agoBackport Fortran BIND(C) fixes
Tobias Burnus [Mon, 4 Nov 2019 14:14:43 +0000 (14:14 +0000)] 
Backport Fortran BIND(C) fixes

        gcc/fortran/
        Backport from mainline
        2019-10-31  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92284.
        * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Free CFI descriptor
        at the end; partial revised revert of Rev. 277502.

        gcc/testsuite/
        Backport from mainline
        2019-10-31  Jakub Jelinek  <jakub@redhat.com>

        PR fortran/92284
        * gfortran.dg/bind_c_array_params_3_aux.c: Include
        ../../../libgfortran/ISO_Fortran_binding.h rather than
        ISO_Fortran_binding.h.

        2019-10-31  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92284
        * gfortran.dg/bind-c-intent-out.f90: Update expected dump;
        extend comment.
        * gfortran.dg/bind_c_array_params_3.f90: New.
        * gfortran.dg/bind_c_array_params_3_aux.c: New.

        2019-10-31  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92277
        * fortran.dg/pr92277.f90: New.

From-SVN: r277781

5 years agoDaily bump.
GCC Administrator [Mon, 4 Nov 2019 00:16:13 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r277763

5 years agoDaily bump.
GCC Administrator [Sun, 3 Nov 2019 00:16:12 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r277748

5 years agoDaily bump.
GCC Administrator [Sat, 2 Nov 2019 00:16:19 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r277739

5 years agobackport: pa.c (pa_output_call): Remove 64-bit sibcall sequence.
John David Anglin [Fri, 1 Nov 2019 23:35:06 +0000 (23:35 +0000)] 
backport: pa.c (pa_output_call): Remove 64-bit sibcall sequence.

Backport from mainline
2019-10-03  John David Anglin  <danglin@gcc.gnu.org>

* config/pa/pa.c (pa_output_call): Remove 64-bit sibcall sequence.
(pa_attr_length_call): Adjust length for 64-bit plabel sequence.

From-SVN: r277736

5 years agobackport: pa.h (MAX_PCREL17F_OFFSET): Adjust.
John David Anglin [Fri, 1 Nov 2019 23:24:54 +0000 (23:24 +0000)] 
backport: pa.h (MAX_PCREL17F_OFFSET): Adjust.

Backport from mainline
2019-10-03  John David Anglin  <danglin@gcc.gnu.org>

* config/pa/pa.h (MAX_PCREL17F_OFFSET): Adjust.

From-SVN: r277731

5 years agoDaily bump.
GCC Administrator [Fri, 1 Nov 2019 00:16:12 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r277702

5 years agoDaily bump.
GCC Administrator [Thu, 31 Oct 2019 00:16:20 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r277652

5 years ago[testsuite] Make the Wnonnull test independent of system headers.
Iain Sandoe [Wed, 30 Oct 2019 20:54:16 +0000 (20:54 +0000)] 
[testsuite] Make the Wnonnull test independent of system headers.

This backports two patches that fix failure of Wnonnull test on some targets.

277280 To avoid the result of this test depending on the implementation of
the system 'string.h', provide prototypes for the two functions used
in the test.  This generalises the fix from 277202.

277202 was the initial fix for Wnonnull on Darwin.

gcc/testsuite/

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline.
2019-10-22  Iain Sandoe  <iain@sandoe.co.uk>

* gcc.dg/Wnonnull.c: Provide prototypes for strlen and memcpy.
Use __SIZE_TYPE__ instead of size_t.

Backport from mainline.
2019-10-19  Iain Sandoe  <iain@sandoe.co.uk>

* gcc.dg/Wnonnull.c: Add attributed function declarations for
memcpy and strlen for Darwin.

From-SVN: r277647

5 years ago[Darwin, machopic] Back out part of PR71767 fix.
Iain Sandoe [Wed, 30 Oct 2019 20:48:44 +0000 (20:48 +0000)] 
[Darwin, machopic] Back out part of PR71767 fix.

This is part of making our codegen match what the system tools produce.

We applied a conservative, but fairly large, hammer to fix 71767.
However, ideally, we want minimise the number of symbols visible to
ld64 and to match the cases emitted by clang (since that's what ld64
is expecting). Now we've improved the handling of indirections, we
can make the indirection symbols local when they are in the regular
non-lazy symbol pointers section. We will continue to make any
indirections in the data section visible (since right now we have no
way to track if a given symbol follows a weak global).
This change makes no difference to handling of labels for constants
(to be revised in a future patch).

There's a mechanical change to a number of tests (allowing 'l' or 'L'
as the indirection symbol prefix).

gcc/

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline
2019-10-13  Iain Sandoe  <iain@sandoe.co.uk>

* config/darwin.c (machopic_indirection_name): Rework the
function to emit linker-visible symbols only for indirections
in the data section.  Clean up the code and update comments.

gcc/testsuite/

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline.
2019-10-13  Iain Sandoe  <iain@sandoe.co.uk>

* gcc.target/i386/indirect-thunk-1.c: Allow 'l' or 'L' in
indirection label prefix, for Darwin.
* gcc.target/i386/indirect-thunk-2.c: Likewise.
* gcc.target/i386/indirect-thunk-3.c: Likewise.
* gcc.target/i386/indirect-thunk-4.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
* gcc.target/i386/pr32219-2.c: Likewise.
* gcc.target/i386/pr32219-3.c: Likewise.
* gcc.target/i386/pr32219-4.c: Likewise.
* gcc.target/i386/pr32219-7.c: Likewise.
* gcc.target/i386/pr32219-8.c: Likewise.
* gcc.target/i386/ret-thunk-14.c: Likewise.
* gcc.target/i386/ret-thunk-15.c: Likewise.
* gcc.target/i386/ret-thunk-9.c: Likewise.

From-SVN: r277646

5 years ago[Darwin] Fix Objective-C NeXT ABI version check diagnostics.
Iain Sandoe [Wed, 30 Oct 2019 20:42:56 +0000 (20:42 +0000)] 
[Darwin] Fix Objective-C NeXT ABI version check diagnostics.

This fixes build errors when used with newer GCC and corrects a mistake
in the checking of ABI versions.

276768 We were missing a check for the case that user's ABI was > 2 and the
codegen was for 64 bit.

276635 Fix some format-related build warnings.

This fixes two error messages to avoid punctuation and contracted
negations.

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline
2019-10-09  Iain Sandoe  <iain@sandoe.co.uk>

* config/darwin.c (darwin_override_options): Make the check for
Objective-C ABI version more specific for 64bit code.

Backport from mainline
2019-10-06  Iain Sandoe  <iain@sandoe.co.uk>

* config/darwin.c (darwin_override_options): Adjust objective-c
ABI version error messages to avoid punctuation and contracted
negations.

From-SVN: r277645

5 years ago[Darwin] Some TLC for older Darwin versions.
Iain Sandoe [Wed, 30 Oct 2019 20:38:47 +0000 (20:38 +0000)] 
[Darwin] Some TLC for older Darwin versions.

This is part 3 of build fixes for older Darwin versions (and will also
fix testsuite complaints about linkage with objects that are built for
an newer OS version than is being built, when used with a modern linker).

The library handling and some of the options for creating the crts for
the older PPC Darwin versions had bit-rotted somewhat. This adjusts the
build criteria for the crts to avoid newer ld64 versions warnings about
mismatches in build and object versions.

Added to some of the comments that it is documented why the specs are as
they are.

gcc/

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline
2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

* config/darwin.h (REAL_LIBGCC_SPEC): Adjust for earlier Darwin.
(STARTFILE_SPEC): Split crt3 into a separate spec.
(DARWIN_EXTRA_SPECS): Add crt2 and crt3 spec.
(DARWIN_CRT2_SPEC): New.
(DARWIN_CRT3_SPEC): New.
(MIN_LD64_OMIT_STUBS): Revise to 62.1.
* config/rs6000/darwin.h (DARWIN_CRT2_SPEC): Revise conditions.
(DARWIN_CRT3_SPEC): New.

libgcc/

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline.
2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

* config.host (powerpc-*-darwin*,powerpc64-*-darwin*): Revise crt
list.
* config/rs6000/t-darwin: Build crt3_2 for older systems.  Revise
mmacosx-version-min for crts to run across all system versions.
* config/rs6000/t-darwin64 (LIB2ADD): Remove.
* config/t-darwin: Revise mmacosx-version-min for crts to run across
system versions >= 10.4.

From-SVN: r277644

5 years ago[Darwin, PPC] Move the out of line register save/restore to an endfile.
Iain Sandoe [Wed, 30 Oct 2019 20:25:33 +0000 (20:25 +0000)] 
[Darwin, PPC] Move the out of line register save/restore to an endfile.

Part 2 of fixes to build and link conditions for older Darwin versions.

We have been including these endfiles in libgcc, which means that we have to
append -lgcc even when using shared libgcc.  In preparation for revision of
libgcc split this into an endfile.  Build the new version.

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline.
2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>

* config.host: Add libef_ppc.a to the extra files for powerpc-darwin.
* config/rs6000/t-darwin: (PPC_ENDFILE_SRC, PPC_ENDFILE_OBJS): New.
Build objects for the out of line save/restore register functions
so that they can be used for any supported Darwin version.
* config/t-darwin: Default the build Darwin version to Darwin8
(MacOS 10.4).

From-SVN: r277642

5 years ago[Darwin, PPC] Move the out of line register save/restore to an endfile.
Iain Sandoe [Wed, 30 Oct 2019 20:12:17 +0000 (20:12 +0000)] 
[Darwin, PPC] Move the out of line register save/restore to an endfile.

Part 1 of fixes to build and link conditions for older Darwin versions.

We have been including these endfiles in libgcc, which means that we have to
append -lgcc even when using shared libgcc.  In preparation for revision of
libgcc split this into an endfile.

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline
2019-06-27  Iain Sandoe  <iain@sandoe.co.uk>

* config/rs6000/darwin.h (ENDFILE_SPEC): Correct whitespace in the
spec.

Backport from mainline
2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>

* config/rs6000/darwin.h (ENDFILE_SPEC): New.

From-SVN: r277641

5 years ago[Darwin] The need for FDE symbols is dependent on linker used, not OS rev.
Iain Sandoe [Wed, 30 Oct 2019 20:05:32 +0000 (20:05 +0000)] 
[Darwin] The need for FDE symbols is dependent on linker used, not OS rev.

For very old toolchains, the compiler generated extra symbols that mark the
start of each FDE.  We no longer need this (since xcode 3 era) - so, for
compatibility with newer linkers, omit this when it is not required.

Since we have detection of the linker version, we can use that directly to
determine if support is needed.

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline
2019-06-18  Iain Sandoe  <iain@sandoe.co.uk>

* config/darwin.c (darwin_emit_unwind_label): New default to false.
(darwin_override_options): Set darwin_emit_unwind_label as needed.

From-SVN: r277640

5 years ago[Darwin] Use of symbol stubs should depend on the linker in use.
Iain Sandoe [Wed, 30 Oct 2019 19:56:41 +0000 (19:56 +0000)] 
[Darwin] Use of symbol stubs should depend on the linker in use.

This is a combination of two patches that prevents a bootstrap fail when
a modern assembler/linker pair are used that don't support the JBSR reloc
(but don't require it for long calls).

272356 The need for picsym stubs is dependent on linker used, not OS rev.

For very old toolchains, the compiler generated pic symbol stubs that
provide the necessary indirections. We no longer need this (since xcode
3 era) and it's more efficient for the linker to make one stub when it
knows a symbol is needed that for us to emit them speculatively in every
object.

Our current codegen is making the assumption that a specific OS version
uses a specific linker version - and therefore the presence of support
could be based on the target OS rev. Of course, that's way too simplistic
(most likely bogus for cross-toolchains) and we want to make things explict.

Since we have detection of the linker version, we can use that directly
(A config test for support for stub-less linking might also be feasible
but much more involved).

Finally, should the user wish to generate code that caters for export to
use in an environment with an older toolchain, the generation of stubs
can be forced from the command line.

In addition to the points above, branch islanding and a long branch opt
for PowerPC Darwin has become conflated with the emission of these stubs
(which is confusing, and will be rectified in a following patch).

274397 There is no need to distinguish PIC/non-PIC symbol stubs.

So we can use a single flag for both.

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline
2019-08-13 Iain Sandoe <iain@sandoe.co.uk>

* config/darwin.c (machopic_indirect_call_target): Rename symbol stub
flag.
(darwin_override_options): Likewise.
* config/darwin.h: Likewise.
* config/darwin.opt: Likewise.
* config/i386/i386.c (output_pic_addr_const): Likewise.
* config/rs6000/darwin.h: Likewise.
* config/rs6000/rs6000.c (rs6000_call_darwin_1): Likewise.
* config/i386/darwin.h (TARGET_MACHO_PICSYM_STUBS): Rename to ...
... this TARGET_MACHO_SYMBOL_STUBS.
(FUNCTION_PROFILER):Likewise.
* config/i386/i386.h: Likewise.

Backport from mainline
2019-06-16  Iain Sandoe  <iain@sandoe.co.uk>

* config/darwin.c (machopic_indirect_call_target): Use renamed
darwin_picsymbol_stubs to decide on output.
(darwin_override_options): Handle darwin_picsymbol_stubs.
* config/darwin.h (MIN_LD64_OMIT_STUBS): New.
(LD64_VERSION): Revise default.
* config/darwin.opt: (mpic-symbol-stubs): New option.
(darwin_picsymbol_stubs): New variable.
* config/i386/darwin.h (TARGET_MACHO_BRANCH_ISLANDS):
rename to TARGET_MACHO_PICSYM_STUBS.
* config/i386/i386.c (output_pic_addr_const): Likewise.
* config/i386/i386.h Likewise.
* config/rs6000/darwin.h: Likewise.
* config/rs6000/rs6000.c (rs6000_call_darwin_1): Use renamed
darwin_picsymbol_stubs.

From-SVN: r277638

5 years agoBackport fix for PR89245
Dragan Mladjenovic [Wed, 30 Oct 2019 15:12:05 +0000 (15:12 +0000)] 
Backport fix for PR89245

gcc/ChangeLog:

2019-10-30  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

Backport from mainline
2019-07-09  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

* cfgcleanup.c (old_insns_match_p): Check if used hard regs set is equal
for both call instructions.

gcc/testsuite/ChangeLog:

2019-10-30  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

Backport from mainline
2019-07-09  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

* gcc.target/mips/cfgcleanup-jalr1.c: New test.
* gcc.target/mips/cfgcleanup-jalr2.c: New test.
* gcc.target/mips/cfgcleanup-jalr3.c: New test.

From-SVN: r277625

5 years ago[LIBPHOBOS] Fix multi-lib RUNTESTFLAGS handling
Thomas Schwinge [Wed, 30 Oct 2019 11:51:15 +0000 (12:51 +0100)] 
[LIBPHOBOS] Fix multi-lib RUNTESTFLAGS handling

Testing libphobos fails for multi-lib configs:

$ make check-target-libphobos RUNTESTFLAGS="--target_board=unix\{-m32,\}"

fails for every 32bit execution, because the host libgcc_s.so is used which
is not the correct version:

spawn [open ...]
./test_aa.exe: /lib/i386-linux-gnu/libgcc_s.so.1: version `GCC_7.0.0' not found (required by ./test_aa.exe)
FAIL: libphobos.aa/test_aa.d execution test

This can be fixed by adding a few lines from libstdc++/testsuite/lib/libstdc++.exp
to libphobos/testsuite/lib/libphobos.exp

Backport trunk r275332:

libphobos/
2019-09-03  Bernd Edlinger  <bernd.edlinger@hotmail.de>

* testsuite/lib/libphobos.exp (libphobos_init): Add multi-lib libgcc
dirs to the ld_library_path var.

From-SVN: r277611