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
2017-11-21 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-10-18 Martin Liska <mliska@suse.cz>
PR sanitizer/82545
* asan.c (asan_expand_poison_ifn): Do not put gimple stmt
on an abnormal edge.
2017-11-21 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-10-18 Martin Liska <mliska@suse.cz>
PR sanitizer/82545
* gcc.dg/asan/pr82545.c: New test.
From-SVN: r255008
2017-11-21 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-10-11 Martin Liska <mliska@suse.cz>
* print-rtl.c (print_insn): Move declaration of idbuf
to same scope as name.
From-SVN: r255007
libgo:
Backport from mainline
With the change in the Solaris release model (no more major releases
like Solaris 12 but only minor ones like 11.4), the Solaris 12
references in GCC need to be adapted.
Patch by Rainer Orth.
Reviewed-on: https://go-review.googlesource.com/77490
libgcc:
Backport from mainline
2017-11-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config.host (*-*-solaris2*): Adapt comment for Solaris 12
renaming.
* config/sol2/crtpg.c (__start_crt_compiler): Likewise.
* configure.ac (libgcc_cv_solaris_crts): Likewise.
* configure: Regenerate.
gcc:
Backport from mainline
2017-11-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config.gcc (*-*-solaris2*): Enable default_use_cxa_atexit since
Solaris 11. Update comment.
* configure.ac (gcc_cv_ld_pid): Adapt comment for Solaris 12
renaming.
* config/sol2.h (STARTFILE_SPEC): Likewise.
* configure: Regenerate.
gcc/testsuite:
Backport from mainline
2017-11-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* lib/target-supports.exp (check_effective_target_pie): Adapt
comment for Solaris 12 renaming.
* gcc.dg/torture/pr60092.c: Remove *-*-solaris2.11* dg-xfail-run-if.
From-SVN: r254994
With the 32-bit SVR4 ABI we don't have a red zone, so we have to restore
the callee-saved registers before we restore the stack pointer.
The previous fix for this PR failed in two ways, for huge frames: first,
we use a negative offset from r11 in that case, so the (mem:BLK 11) access
does no good; second, sched does not handle accesses to mem:BLK correctly
in this case (does not make dependencies).
This patch fixes it by doing a store to (mem:BLK (scratch)) instead.
This means no unrelated (not to stack) loads/stores can be moved over the
stack restore either, but so be it.
PR target/77687
* config/rs6000/rs6000.md (stack_restore_tie): Store to a scratch
address instead of to r1 and r11.
gcc/testsuite/
PR target/77687
* gcc.target/powerpc/pr77687.c: New testcase.
From-SVN: r254968
2017-11-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/82985
Backport from mainline
2017-08-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/81790
* tree-ssa-sccvn.c (vn_lookup_simplify_result): Handle both
CONSTRUCTORs from simplifying and VN.
* gcc.dg/torture/pr81790.c: New testcase.
* g++.dg/torture/pr82985.C: Likewise.
From-SVN: r254766
Backport from mainline (r253147):
This patch is an attempt to fix the crash reported in PR82155.
When generating a C++ class method for a class that is itself nested in
a class method, dwarf2out_early_global_decl currently leaves the
existing context DIE as it is if it already exists. However, it is
possible that this call happens at a point where this context DIE is
just a declaration that is itself not located in its own context.
From there, if dwarf2out_early_global_decl is not called on any of the
FUNCTION_DECL in the context chain, DIEs will be left badly scoped and
some (such as the nested method) will be removed by the type pruning
machinery. As a consequence, dwarf2out_abstract_function will will
crash when called on the corresponding DECL because it asserts that the
DECL has a DIE.
This patch fixes this crash making dwarf2out_early_global_decl process
context DIEs the same way we process abstract origins for FUNCTION_DECL:
if the corresponding DIE exists but is only a declaration, call
dwarf2out_decl anyway on it so that it is turned into a more complete
DIE and so that it is relocated in the proper context.
Bootstrapped and regtested on x86_64-linux.
gcc/
PR debug/82155
* dwarf2out.c (dwarf2out_early_global_decl): Call dwarf2out_decl
on the FUNCTION_DECL function context if it has a DIE that is a
declaration.
gcc/testsuite/
* g++.dg/pr82155.C: New testcase.
From-SVN: r254761
2017-11-13 Paul Thomas <pault@gcc.gnu.org>
Backport from trunk
PR fortran/82934
* trans-stmt.c (gfc_trans_allocate): Remove the gcc_assert on
null string length for assumed length typespec and set
expr3_esize to NULL_TREE;
2017-11-13 Paul Thomas <pault@gcc.gnu.org>
Backport from trunk
PR fortran/82934
* gfortran.dg/allocate_assumed_charlen_1.f90: New test.
From-SVN: r254709
2017-11-13 Paul Thomas <pault@gcc.gnu.org>
Backport from trunk
PR fortran/78619
* check.c (same_type_check): Introduce a new argument 'assoc'
with default value false. If this is true, use the symbol type
spec of BT_PROCEDURE expressions.
(gfc_check_associated): Set 'assoc' true in the call to
'same_type_check'.
2017-11-13 Paul Thomas <pault@gcc.gnu.org>
Backport from trunk
PR fortran/78619
* gfortran.dg/pr78619.f90: New test.
From-SVN: r254708
* gcc-interface/utils.c (convert) <RECORD_TYPE>: Add comment and do
not fall through to the next case.
<ARRAY_TYPE>: Deal specially with a dereference from another array
type with the same element type.
From-SVN: r254619
Backport from mainline
2017-11-01 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/64682
PR rtl-optimization/69567
PR rtl-optimization/69737
PR rtl-optimization/82683
* combine.c (distribute_notes) <REG_DEAD>: If the new I2 sets the same
register mentioned in the note, drop the note, unless it came from I3,
in which case it should go to I3 again.
From-SVN: r254564