Jakub Jelinek [Fri, 30 Aug 2019 11:26:01 +0000 (13:26 +0200)]
backport: re PR middle-end/82564 (ICE at -O1 and above: in assign_stack_temp_for_type, at function.c:783)
Backported from mainline
2019-01-05 Jakub Jelinek <jakub@redhat.com>
PR middle-end/82564
PR target/88620
* expr.c (expand_assignment): For calls returning VLA structures
if to_rtx is not a MEM, force it into a stack temporary.
* gcc.dg/nested-func-12.c: New test.
* gcc.c-torture/compile/pr82564.c: New test.
Jakub Jelinek [Fri, 30 Aug 2019 11:23:16 +0000 (13:23 +0200)]
backport: re PR middle-end/85594 (ICE during expand when compiling with -fwrapv -fopenmp)
Backported from mainline
2018-12-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/85594
PR middle-end/88553
* omp-expand.c (extract_omp_for_update_vars): Regimplify the condition
if needed.
(expand_omp_for_generic): Don't clobber t temporary for ordered loops.
* gcc.dg/gomp/pr85594.c: New test.
* gcc.dg/gomp/pr88553.c: New test.
Jakub Jelinek [Fri, 30 Aug 2019 11:22:27 +0000 (13:22 +0200)]
backport: re PR rtl-optimization/88563 (wrong code with -O2 -fno-code-hoisting -fno-tree-ccp -fno-tree-dominator-opts -fno-tree-forwprop -fno-tree-fre -fno-tree-pre -fno-tree-vrp)
Backported from mainline
2018-12-21 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/88563
* expr.c (expand_expr_real_2) <case WIDEN_MULT_EXPR>: Swap innermode
and mode arguments to convert_modes. Likewise swap mode and word_mode
arguments. Handle both arguments with VOIDmode before convert_modes
of one of them. Formatting fixes.
Jakub Jelinek [Fri, 30 Aug 2019 11:21:45 +0000 (13:21 +0200)]
backport: re PR rtl-optimization/88470 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2354)
Backported from mainline
2018-12-13 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/88470
* cfgcleanup.c (outgoing_edges_match): If the function is
shrink-wrapped and bb1 ends with a JUMP_INSN with a single fake
edge to EXIT, return false.
Jakub Jelinek [Fri, 30 Aug 2019 11:18:41 +0000 (13:18 +0200)]
backport: re PR fortran/88377 (ICE in gfc_omp_clause_copy_ctor, at fortran/trans-openmp.c:614)
Backported from mainline
2018-12-07 Jakub Jelinek <jakub@redhat.com>
PR fortran/88377
* trans-openmp.c (gfc_omp_clause_default_ctor,
gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op,
gfc_omp_clause_linear_ctor, gfc_omp_clause_dtor): Only consider
GFC_DECL_GET_SCALAR_ALLOCATABLE vars as scalar allocatables if they
have pointer type.
Jakub Jelinek [Fri, 30 Aug 2019 11:12:23 +0000 (13:12 +0200)]
backport: re PR tree-optimization/87895 (ICE in purge_dead_edges, at cfgrtl.c:3246)
Backported from mainline
2018-11-20 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/87895
* omp-simd-clone.c (ipa_simd_modify_function_body): When removing
or replacing GIMPLE_RETURN, set EDGE_FALLTHRU on the edge to EXIT.
(simd_clone_adjust): Don't set EDGE_FALLTHRU here. In a loop that
redirects edges to EXIT to edges to incr_bb, iterate while EXIT
has any preds and always use EDGE_PRED (, 0).
* gcc.dg/gomp/pr87895-1.c: New test.
* gcc.dg/gomp/pr87895-2.c: New test.
* gcc.dg/gomp/pr87895-3.c: New test.
Jakub Jelinek [Fri, 30 Aug 2019 11:09:22 +0000 (13:09 +0200)]
backport: re PR fortran/87725 (OpenMP 4.5 clause schedule(simd,monotonic:static) not understood)
Backported from mainline
2018-10-25 Jakub Jelinek <jakub@redhat.com>
PR fortran/87725
* openmp.c (gfc_match_omp_clauses): Parse simd, monotonic and
nonmonotonic modifiers regardless of if they have been parsed
already or if the opposite one has. Fix up check whether
comma after modifier should be parsed.
(resolve_omp_clauses): Diagnose schedule modifier restrictions.
* c-c++-common/gomp/schedule-modifiers-1.c (bar): Separate modifier
from kind with a colon rather than comma.
* gfortran.dg/gomp/schedule-modifiers-1.f90: New test.
* gfortran.dg/gomp/schedule-modifiers-2.f90: New test.
Jakub Jelinek [Fri, 30 Aug 2019 11:07:22 +0000 (13:07 +0200)]
backport: re PR middle-end/85488 (segmentation fault when compiling code using the ordered(n) clause in OpenMP 4.5)
Backported from mainline
2018-10-19 Jakub Jelinek <jakub@redhat.com>
PR middle-end/85488
PR middle-end/87649
* omp-low.c (check_omp_nesting_restrictions): Diagnose ordered without
depend closely nested inside of loop with ordered clause with
a parameter.
* c-c++-common/gomp/doacross-2.c: New test.
* c-c++-common/gomp/sink-3.c: Expect another error during error
recovery.
Uros Bizjak [Sun, 25 Aug 2019 19:51:45 +0000 (21:51 +0200)]
re PR target/91533 (abs pattern generates MMX instructions but fails to call EMMS)
PR target/91533
Backport from mainline
2019-06-30 Uroš Bizjak <ubizjak@gmail.com>
* config/i386/sse.md (ssse3_abs<mode>2): Rename from abs<mode>2.
* config/i386/i386-builtin.def (__builtin_ia32_pabsb):
Use CODE_FOR_ssse3_absv8qi2.
(__builtin_ia32_pabsw): Use CODE_FOR_ssse3_absv4hi2.
(__builtin_ia32_pabsd): Use CODE_FOR_ssse3_absv2si2.
Richard Biener [Wed, 21 Aug 2019 13:44:45 +0000 (13:44 +0000)]
re PR tree-optimization/91510 (r253207 fixed a wrong-code bug)
2019-08-21 Richard Biener <rguenther@suse.de>
PR tree-optimization/91510
Backport from mainline
2017-09-26 Martin Jambor <mjambor@suse.cz>
* tree-sra.c (compare_access_positions): Put integral types first,
stabilize sorting of integral types, remove conditions putting
non-full-precision integers last.
(sort_and_splice_var_accesses): Disable scalarization if a
non-integert would be represented by a non-full-precision integer.
Thomas Koenig [Sat, 3 Aug 2019 11:50:39 +0000 (11:50 +0000)]
backport: re PR fortran/90786 (ICE on procedure pointer assignment to function with class pointer result)
2019-08-03 Thomas Koenig <tkoenig@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
Backport from trunk
PR fortran/90786
PR fortran/90813
* trans-expr.c (pointer_assignment_is_proc_pointer) Remove as
it is very simple and only called from one place.
(gfc_trans_pointer_assignment): Rename non_proc_pointer_assign
as non_proc_ptr_assign. Assign to it directly, rather than call
to above, deleted function and use gfc_expr_attr instead of
only checking the reference chain.
* trans-decl.c (sym_identifier): New function.
(mangled_identifier): New function, doing most of the work
of gfc_sym_mangled_identifier.
(gfc_sym_mangled_identifier): Use mangled_identifier. Add mangled
identifier to global symbol table.
(get_proc_pointer_decl): Use backend decl from global identifier
if present.
2019-08-03 Thomas Koenig <tkoenig@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
Backport from trunk
PR fortran/90786
PR fortran/90813
* gfortran.dg/proc_ptr_51.f90: New test.
Co-Authored-By: Paul Thomas <pault@gcc.gnu.org>
From-SVN: r274038
Martin Liska [Mon, 22 Jul 2019 09:38:26 +0000 (11:38 +0200)]
Backport r273660
2019-07-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2019-07-22 Martin Liska <mliska@suse.cz>
PR driver/91172
* opts-common.c (decode_cmdline_option): Decode
argument of -Werror and check it for a wrong language.
* opts-global.c (complain_wrong_lang): Remove such case.
2019-07-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2019-07-22 Martin Liska <mliska@suse.cz>
The GCC optimizer can generate symbols with non-zero offset from simple
if-statements. Bit zero is used for the Arm/Thumb state bit, so relocations
with offsets fail if it changes bit zero and the relocation forces bit zero
to true. The fix is to disable offsets on function pointer symbols.
gcc/
PR target/89222
* config/arm/arm.md (movsi): Use targetm.cannot_force_const_mem
to decide when to split off a non-zero offset from a symbol.
* config/arm/arm.c (arm_cannot_force_const_mem): Disallow offsets
in function symbols.
testsuite/
PR target/89222
* gcc.target/arm/pr89222.c: Add new test.
Andreas Krebbel [Mon, 15 Jul 2019 14:31:37 +0000 (14:31 +0000)]
S/390: Fix vector shift count operand
We currently use subst definitions to handle the different variants of shift
count operands. Unfortunately, in the vector shift pattern the shift count
operand is used directly. Without it being adjusted for the 'subst' variants the
displacement value is omitted resulting in a wrong shift count being applied.
This patch needs to be applied to older branches as well.
gcc/ChangeLog:
2019-07-15 Andreas Krebbel <krebbel@linux.ibm.com>
Backport from mainline
2019-07-01 Andreas Krebbel <krebbel@linux.ibm.com>
The gcc.c-torture/execute/builtins/lib directory contains a reimplementation
of many C library string functions, which causes non-trivial register allocation
bugs with LTO and static linked libraries. To fix this long-standing test issue,
turn off ipa-ra which avoids the register corruption across calls. All builtin
torture tests now pass on aarch64-none-elf. Committed as obvious.
See PR78529 for more details.
Eric Botcazou [Fri, 12 Jul 2019 10:17:42 +0000 (10:17 +0000)]
re PR rtl-optimization/91136 (incorrect move of instruction to delay slot causes application crash in exception handling)
PR rtl-optimization/91136
* df-core.c (ACCESSING REFS): Fix typos in comment.
* resource.c (mark_target_live_reg): Add artificial defs that occur at
the beginning of the block to the initial set of live registers.
Eric Botcazou [Sat, 29 Jun 2019 07:32:09 +0000 (07:32 +0000)]
decl.c (set_nonaliased_component_on_array_type): Add missing guard for the presence of TYPE_CANONICAL.
* gcc-interface/decl.c (set_nonaliased_component_on_array_type): Add
missing guard for the presence of TYPE_CANONICAL.
(set_reverse_storage_order_on_array_type): Likewise.