2017-12-02 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Backport from trunk
PR libgfortran/83225
* io/io.h (is_internal_unit): Use the unit_is_internal bit.
* io/transfer.c (data_transfer_init): Set the bit to true for
internal units. Use that bit for checks for internal unit
initializations.
* io/unit.c (insert_unit): As a precaution, set the
internal_unit_kind to zero when a unit structure is first created.
From-SVN: r255364
The current rs6000 rtx_cost for comparisons against 0 is very high if
TARGET_ISEL && !TARGET_MFCRF, much higher than for reg-reg comparisons,
much higher than a load of 0 and such a reg-reg-comparison. This leads
to infinite recursion in CSE (see PR81288).
This patch removes the too-high cost, also simplifying this code.
PR 81288/target
* config/rs6000/rs6000.c (rs6000_rtx_costs): Do not handle
TARGET_ISEL && !TARGET_MFCRF differently. Simplify code.
From-SVN: r255337
Backport from mainline
2017-11-03 Jonathan Wakely <jwakely@redhat.com>
* include/bits/node_handle.h (_Node_insert_return::get): Remove, as
per P0508R0.
From-SVN: r255322
gcc/
Backport from mainline
2017-11-30 Jim Wilson <jimw@sifive.com>
* doc/invoke.texi (RISC-V Options): Delete nonexistent -mmemcpy and
-mno-memcpy options. For -mplt, -mfdiv, -mdiv, -msave-restore, and
-mstrict-align, add info on default value. Delete redundant lines for
-mabi. Add missing -mexplicit-relocs docs.
Backport from mainline
2017-11-01 Palmer Dabbelt <palmer@dabbelt.com>
* doc/invoke.texi (RISC-V Options): Use "@minus{}2 GB", not "-2 GB".
* doc/invoke.texi (RISC-V Options): Explicitly name the medlow
and medany code models, and describe what they do.
2017-10-27 Palmer Dabbelt <palmer@dabbelt.com>
PR target/82717
* doc/invoke.texi (RISC-V) <-mabi>: Correct and improve.
From-SVN: r255281
2017-11-29 Martin Jambor <mjambor@suse.cz>
PR ipa/82808
* tree.c (expr_type_first_operand_type_p): New function.
* tree.h (expr_type_first_operand_type_p): Declare it.
* ipa-cp.c (ipa_get_jf_pass_through_result): Use it.
testsuite/
* gcc.dg/ipa/pr82808.c: New test.
From-SVN: r255256
Needed for the UT699 errata workaround to function correctly when
compiling with -fPIC.
Backport from mainline
2017-11-29 Daniel Cederman <cederman@gaisler.com>
gcc/
* config/sparc/sparc.c (sparc_do_work_around_errata): Treat the
movsi_pic_gotdata_op instruction as a load for the UT699 errata
workaround.
From-SVN: r255245
The sequence
st
fdivd / fsqrtd
std
was generated in some cases with -mfix-ut699 when there was
a st before the div/sqrt. This sequence could trigger the b2bst errata.
Now the following safe sequence is generated instead:
st
nop
fdivd / fsqrtd
std
Backport from mainline
2017-11-29 Martin Aberg <maberg@gaisler.com>
gcc/
* config/sparc/sparc.md (divdf3_fix): Add NOP and adjust length
to prevent b2bst errata sequence.
(sqrtdf2_fix): Likewise.
From-SVN: r255244
This patch provides a workaround for the errata described in GRLIB-TN-0013.
If the workaround is enabled it will:
* Prevent div and sqrt instructions in the delay slot.
* Insert NOPs to prevent the sequence (div/sqrt) -> (two or three floating
point operations or loads) -> (div/sqrt).
* Not insert NOPs if any of the floating point operations have a dependency
on the destination register of the first (div/sqrt).
* Not insert NOPs if one of the floating point operations is a (div/sqrt).
* Insert NOPs to prevent (div/sqrt) followed by a branch.
It is applicable to GR712RC, UT700, and UT699.
Backport from mainline
2017-11-29 Daniel Cederman <cederman@gaisler.com>
gcc/
* config/sparc/sparc.c (fpop_reg_depend_p): New function.
(div_sqrt_insn_p): New function.
(sparc_do_work_around_errata): Insert NOP instructions to
prevent sequences that could trigger the TN-0013 errata for
certain LEON3 processors.
(pass_work_around_errata::gate): Also test sparc_fix_lost_divsqrt.
(sparc_option_override): Set sparc_fix_lost_divsqrt appropriately.
* config/sparc/sparc.md (fix_lost_divsqrt): New attribute.
(in_branch_delay): Prevent div and sqrt in delay slot if
fix_lost_divsqrt.
* config/sparc/sparc.opt (sparc_fix_lost_divsqrt): New variable.
From-SVN: r255243
This patch provides a workaround for the errata described in GRLIB-TN-0010.
If the workaround is enabled it will:
* Insert a NOP between load instruction and atomic
instruction (swap, ldstub, casa).
* Insert a NOP at branch target if load in delay slot
and atomic instruction at branch target.
It is applicable to UT700.
Backport from mainline
2017-11-29 Daniel Cederman <cederman@gaisler.com>
gcc/
* config/sparc/sparc.c (atomic_insn_p): New function.
(sparc_do_work_around_errata): Insert NOP instructions to
prevent sequences that could trigger the TN-0010 errata for
UT700.
* config/sparc/sync.md (atomic_compare_and_swap_leon3_1): Make
instruction referable in atomic_insns_p.
From-SVN: r255242
This patch provides a workaround for the errata described in GRLIB-TN-0011.
If the workaround is enabled it will:
* Insert .align 16 before atomic instructions (swap, ldstub, casa).
It is applicable to GR712RC.
Backport from mainline
2017-11-29 Daniel Cederman <cederman@gaisler.com>
gcc/
* config/sparc/sync.md (swapsi): 16-byte align if sparc_fix_gr712rc.
(atomic_compare_and_swap_leon3_1): Likewise.
(ldstub): Likewise.
From-SVN: r255241
This patch provides a workaround for the errata described in GRLIB-TN-0012.
If the workaround is enabled it will:
* Prevent any floating-point operation from being placed in the
delay slot of an annulled integer branch.
* Place a NOP at the branch target of an integer branch if it is
a floating-point operation or a floating-point branch.
It is applicable to GR712RC.
Backport from mainline
2017-11-29 Daniel Cederman <cederman@gaisler.com>
gcc/
* config/sparc/sparc.c (fpop_insn_p): New function.
(sparc_do_work_around_errata): Insert NOP instructions to
prevent sequences that could trigger the TN-0012 errata for
GR712RC.
(pass_work_around_errata::gate): Also test sparc_fix_gr712rc.
* config/sparc/sparc.md (fix_gr712rc): New attribute.
(in_branch_annul_delay): Prevent floating-point instructions
in delay slot of annulled integer branch.
From-SVN: r255240
gcc/
Backport from mainline
2017-11-04 Andrew Waterman <andrew@sifive.com>
* config/riscv/riscv.c (riscv_option_override): Conditionally set
TARGET_STRICT_ALIGN based upon -mtune argument.
Backport from mainline
2017-05-04 Andrew Waterman <andrew@sifive.com>
* config/riscv/riscv.opt (mstrict-align): New option.
* config/riscv/riscv.h (STRICT_ALIGNMENT): Use it. Update comment.
(SLOW_UNALIGNED_ACCESS): Define.
(riscv_slow_unaligned_access): Declare.
* config/riscv/riscv.c (riscv_tune_info): Add slow_unaligned_access
field.
(riscv_slow_unaligned_access): New variable.
(rocket_tune_info): Set slow_unaligned_access to true.
(optimize_size_tune_info): Set slow_unaligned_access to false.
(riscv_cpu_info_table): Add entry for optimize_size_tune_info.
(riscv_valid_lo_sum_p): Use TARGET_STRICT_ALIGN.
(riscv_option_override): Set riscv_slow_unaligned_access.
* doc/invoke.texi: Add -mstrict-align to RISC-V.
From-SVN: r255221
gcc/
Backport from mainline
2017-11-07 Michael Clark <michaeljclark@mac.com>
* config/riscv/linux.h (MUSL_ABI_SUFFIX): New define.
(MUSL_DYNAMIC_LINKER): Likewise.
From-SVN: r255216
2017-11-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83021
* resolve.c (resolve_component): Only escape for use assciated
vtypes if the current namespace has no proc_name and is most
particularly block data.
From-SVN: r255205
If we have a PARALLEL of two SETs, and one half is unused, we currently
happily split that into two instructions (albeit the unused one is
useless). Worse, as PR82621 shows, combine will happily merge this
insn into I3 even if some intervening insn sets the same register
again, which is wrong.
This fixes it by not splitting PARALLELs with REG_UNUSED notes. It
all is handled fine by combine in that case; just the "single set
that is unused" case isn't handled properly.
This also results in better code: combine will now actually throw
away the unused SET. (It still won't do that in an I3).
PR rtl-optimization/82621
* combine.c (try_combine): Do not split PARALLELs of two SETs if the
dest of one of those SETs is unused.
From-SVN: r255142
2017-11-23 Paul Thomas <pault@gcc.gnu.org>
Backported from trunk
PR fortran/79072
* trans-expr.c (trans_class_vptr_len_assignment): Set from_len
if the temporary is unlimited polymorphic.
* trans-stmt.c (trans_associate_var): Use the fake result decl
to obtain the 'len' field from an explicit function result when
in that function scope.
2017-11-23 Paul Thomas <pault@gcc.gnu.org>
Backported from trunk
PR fortran/79072
* gfortran.dg/class_result_5.f90: New test.
* gfortran.dg/class_result_6.f90: New test.
From-SVN: r255120
2017-11-21 Paul Thomas <pault@gcc.gnu.org>
Backported from trunk fix for PR82586
PR fortran/78686
* resolve.c (resolve_generic_f): Check usage of derived type by
calling gfc_use_derived.
2017-11-21 Paul Thomas <pault@gcc.gnu.org>
Backported from trunk fix for PR82586
PR fortran/78686
* gfortran.dg/pr78686.f90: New test.
From-SVN: r255029
2017-11-21 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-10-27 Martin Liska <mliska@suse.cz>
PR gcov-profile/82457
* doc/invoke.texi: Document that one needs a non-strict ISO mode
for fork-like functions to be properly instrumented.
From-SVN: r255028
A number of instructions are output in assembler form by
output_return_instruction () when compiling a function with the
cmse_nonsecure_entry attribute for Armv8-M Mainline with hardfloat float
ABI. However, the corresponding thumb2_cmse_entry_return insn pattern
does not account for all these instructions in its computing of the
length of the instruction.
This may lead GCC to use the wrong branching instruction due to
incorrect computation of the offset between the branch instruction's
address and the target address.
This commit fixes the mismatch between what output_return_instruction ()
does and what the pattern think it does and adds a note warning about
mismatch in the affected functions' heading comments to ensure code does
not get out of sync again.
Note: no test is provided because the C testcase is fragile (only works
on GCC 6) and the extracted RTL test fails to compile due to bugs in the
RTL frontend (PR82815 and PR82817)
2017-11-21 Thomas Preud'homme <thomas.preudhomme@arm.com>
Backport from mainline
2017-11-09 Thomas Preud'homme <thomas.preudhomme@arm.com>
gcc/
* config/arm/arm.c (output_return_instruction): Add comments to
indicate requirement for cmse_nonsecure_entry return to account
for the size of clearing instruction output here.
(thumb_exit): Likewise.
* config/arm/thumb2.md (thumb2_cmse_entry_return): Fix length for
return in hardfloat mode.
From-SVN: r255020
2017-11-21 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-11-08 Martin Liska <mliska@suse.cz>
* gimplify.c (expand_FALLTHROUGH_r): Simplify usage
of gimple_call_internal_p.
From-SVN: r255012
2017-11-21 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-10-31 Martin Liska <mliska@suse.cz>
PR gcov-profile/82633
* doc/gcov.texi: Document -fkeep-{static,inline}-functions and
their interaction with GCOV infrastructure.
From-SVN: r255010