Jakub Jelinek [Fri, 30 Aug 2019 12:08:04 +0000 (14:08 +0200)]
backport: re PR middle-end/89091 (ICE: Segmentation fault (in tree_class_check))
Backported from mainline
2019-02-20 Jakub Jelinek <jakub@redhat.com>
David Malcolm <dmalcolm@redhat.com>
PR middle-end/89091
* fold-const.c (decode_field_reference): Return NULL_TREE if
lang_hooks.types.type_for_size returns NULL. Check it before
overwriting *exp_. Use return NULL_TREE instead of return 0.
Jakub Jelinek [Fri, 30 Aug 2019 12:05:07 +0000 (14:05 +0200)]
backport: re PR target/89361 (s390 broken without S390_USE_TARGET_ATTRIBUTE, likely since r257489)
Backported from mainline
2019-02-18 Jakub Jelinek <jakub@redhat.com>
PR target/89361
* config/s390/s390.c (s390_indirect_branch_attrvalue,
s390_indirect_branch_settings): Define unconditionally.
(s390_set_current_function): Likewise, but guard the whole body except
the s390_indirect_branch_settings call with
#if S390_USE_TARGET_ATTRIBUTE.
(TARGET_SET_CURRENT_FUNCTION): Redefine unconditionally.
Jakub Jelinek [Fri, 30 Aug 2019 12:02:02 +0000 (14:02 +0200)]
backport: re PR tree-optimization/89278 (ICE in gimplify_modify_expr, at gimplify.c:5821)
Backported from mainline
2019-02-15 Richard Biener <rguenther@suse.de>
Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/89278
* tree-loop-distribution.c: Include tree-eh.h.
(generate_memset_builtin, generate_memcpy_builtin): Call
rewrite_to_non_trapping_overflow on builtin->size before passing it
to force_gimple_operand_gsi.
Jakub Jelinek [Fri, 30 Aug 2019 11:51:36 +0000 (13:51 +0200)]
backport: re PR middle-end/89303 (memory leak with shared_ptr and enable_shared_from_this)
Backported from mainline
2019-02-13 Jakub Jelinek <jakub@redhat.com>
PR middle-end/89303
* tree-ssa-structalias.c (set_uids_in_ptset): Or in vi->is_heap_var
into pt->vars_contains_escaped_heap instead of setting
pt->vars_contains_escaped_heap to it.
2019-02-13 Jonathan Wakely <jwakely@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR middle-end/89303
* g++.dg/torture/pr89303.C: New test.
Jakub Jelinek [Fri, 30 Aug 2019 11:50:35 +0000 (13:50 +0200)]
backport: re PR middle-end/89281 (gcc/optabs.c:3901:30: runtime error: shift exponent 32 is too large for 32-bit type 'int')
Backported from mainline
2019-02-13 Jakub Jelinek <jakub@redhat.com>
PR middle-end/89281
* optabs.c (prepare_cmp_insn): Use UINTVAL (size) instead of
INTVAL (size), compare it to GET_MODE_MASK instead of
1 << GET_MODE_BITSIZE.
Jakub Jelinek [Fri, 30 Aug 2019 11:50:04 +0000 (13:50 +0200)]
backport: re PR middle-end/89246 (LTO produces references to cloned symbols which the compiler failed to clone)
Backported from mainline
2019-02-09 Jakub Jelinek <jakub@redhat.com>
PR middle-end/89246
* config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
If !node->definition and TYPE_ARG_TYPES is non-NULL, use
TYPE_ARG_TYPES instead of DECL_ARGUMENTS.
* gcc.dg/gomp/pr89246-1.c: New test.
* gcc.dg/gomp/pr89246-2.c: New test.
Jakub Jelinek [Fri, 30 Aug 2019 11:49:11 +0000 (13:49 +0200)]
backport: re PR target/88861 (ICE in calc_dfs_tree, at dominance.c:458)
Backported from mainline
2019-01-16 David Malcolm <dmalcolm@redhat.com>
PR target/88861
* combine.c (delete_noop_moves): Convert to "bool" return,
returning true if any edges are eliminated.
(combine_instructions): Also return true if delete_noop_moves
returns true.
* g++.dg/opt/pr89188.C: Include ../torture/pr88861.C.
2019-01-16 David Malcolm <dmalcolm@redhat.com>
PR target/88861
* g++.dg/torture/pr88861.C: New test.
Jakub Jelinek [Fri, 30 Aug 2019 11:46:29 +0000 (13:46 +0200)]
backport: re PR rtl-optimization/89234 (ICE in get_eh_region_and_lp_from_rtx at gcc/except.c:1824)
Backported from mainline
2019-02-08 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/89234
* except.c (copy_reg_eh_region_note_forward): Return if note_or_insn
is a NOTE, CODE_LABEL etc. - rtx_insn * other than INSN_P.
(copy_reg_eh_region_note_backward): Likewise.
Jakub Jelinek [Fri, 30 Aug 2019 11:42:17 +0000 (13:42 +0200)]
backport: re PR target/89188 (ICE in pre_and_rev_post_order_compute, at cfganal.c:1055)
Backported from mainline
2019-02-05 Jakub Jelinek <jakub@redhat.com>
PR target/89188
* dce.c (delete_unmarked_insns): Don't remove no-op moves if they
can throw, non-call exceptions are enabled and we can't delete
dead exceptions or alter cfg. Set must_clean if
delete_insn_and_edges returns true, don't set it blindly for calls.
Jakub Jelinek [Fri, 30 Aug 2019 11:36:58 +0000 (13:36 +0200)]
backport: re PR middle-end/87887 (ICE in make_ssa_name_fn, at tree-ssanames.c:269)
Backported from mainline
2019-02-02 Jakub Jelinek <jakub@redhat.com>
PR middle-end/87887
* config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
Punt with warning on aggregate return or argument types. Ignore
type/mode checking for uniform arguments.
* gcc.dg/gomp/pr87887-1.c: New test.
* gcc.dg/gomp/pr87887-2.c: New test.
Jakub Jelinek [Fri, 30 Aug 2019 11:36:10 +0000 (13:36 +0200)]
backport: re PR fortran/83246 (internal compiler error or loader problem might be related to a PARAMETER statement being in a BLOCK)
Backported from mainline
2019-02-01 Jakub Jelinek <jakub@redhat.com>
PR fortran/83246
PR fortran/89084
* trans-decl.c (generate_local_decl): Add referenced FL_PARAMETERs
if sym->ns->construct_entities rather than if
sym->ns->parent->code->op == EXEC_BLOCK.
* gfortran.dg/pr89084.f90: New test.
* gfortran.dg/lto/pr89084_0.f90: New test.
* gfortran.dg/pr83246.f90: New test.
Jakub Jelinek [Fri, 30 Aug 2019 11:35:08 +0000 (13:35 +0200)]
backport: re PR tree-optimization/88107 (ICE in find_outermost_region_in_block, at tree-cfg.c:7157)
Backported from mainline
2019-02-01 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/88107
* tree-cfg.c (find_outermost_region_in_block): Add ALL argument,
instead of assertion that eh_region_outermost is non-NULL, if it
is NULL, set *ALL to true and return NULL.
(move_sese_region_to_fn): Adjust caller, if all is set, call
duplicate_eh_regions with NULL region.
Jakub Jelinek [Fri, 30 Aug 2019 11:33:12 +0000 (13:33 +0200)]
backport: re PR middle-end/89002 (ICE in scan_omp_1_op, at omp-low.c:3166)
Backported from mainline
2019-01-28 Jakub Jelinek <jakub@redhat.com>
PR middle-end/89002
* gimplify.c (gimplify_omp_for): When adding OMP_CLAUSE_*_GIMPLE_SEQ
for lastprivate/linear IV, push gimplify context around gimplify_assign
and, if it needed any temporaries, pop it into a gimple bind around the
sequence.
Jakub Jelinek [Fri, 30 Aug 2019 11:32:15 +0000 (13:32 +0200)]
backport: re PR target/87214 (r263772 miscompiled 520.omnetpp_r in SPEC CPU 2017)
Backported from mainline
2019-01-27 Jakub Jelinek <jakub@redhat.com>
PR target/87214
* config/i386/sse.md
(<mask_codefor>avx512dq_shuf_<shuffletype>64x2_1<mask_name>,
avx512f_shuf_<shuffletype>64x2_1<mask_name>): Ensure the
first constants in pairs are multiples of 2. Formatting fixes.
(avx512vl_shuf_<shuffletype>32x4_1<mask_name>,
avx512vl_shuf_<shuffletype>32x4_1<mask_name>): Ensure the
first constants in each quadruple are multiples of 4. Formatting fixes.
* gcc.target/i386/avx512vl-pr87214-1.c: New test.
* gcc.target/i386/avx512vl-pr87214-2.c: New test.
Jakub Jelinek [Fri, 30 Aug 2019 11:31:02 +0000 (13:31 +0200)]
backport: re PR c++/88976 (ICE in fold_convert_loc, at fold-const.c:2552)
Backported from mainline
2019-01-24 Jakub Jelinek <jakub@redhat.com>
PR c++/88976
* semantics.c (finish_omp_cancel): Use maybe_convert_cond when not in
template or build_x_binary_op otherwise.
* c-c++-common/gomp/cancel-2.c: New test.
* gcc.dg/gomp/cancel-1.c: New test.
* g++.dg/gomp/cancel-1.C: New test.
* g++.dg/gomp/cancel-2.C: New test.
* g++.dg/gomp/cancel-3.C: New test.
Jakub Jelinek [Fri, 30 Aug 2019 11:27:33 +0000 (13:27 +0200)]
backport: re PR rtl-optimization/88870 (ICE: Segmentation fault (in df_worklist_propagate_backward))
Backported from mainline
2019-01-17 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/88870
* dce.c (deletable_insn_p): Never delete const/pure calls that can
throw if we can't alter the cfg or delete dead exceptions.
(mark_insn): Don't call find_call_stack_args for such calls.
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>