Jakub Jelinek [Fri, 30 Aug 2019 12:49:27 +0000 (14:49 +0200)]
backport: re PR target/91150 (wrong code with -O -mavx512vbmi due to wrong writemask)
Backported from mainline
2019-07-30 Jakub Jelinek <jakub@redhat.com>
PR target/91150
* config/i386/i386.c (expand_vec_perm_blend): Change mask type
from unsigned to unsigned HOST_WIDE_INT. For E_V64QImode cast
comparison to unsigned HOST_WIDE_INT before shifting it left.
Jakub Jelinek [Fri, 30 Aug 2019 12:48:57 +0000 (14:48 +0200)]
backport: re PR middle-end/78884 ([7/8] ICE when gimplifying VLA in OpenMP SIMD region)
Backported from mainline
2019-07-04 Jakub Jelinek <jakub@redhat.com>
PR middle-end/78884
* gimplify.c (struct gimplify_omp_ctx): Add add_safelen1 member.
(gimplify_bind_expr): If seeing TREE_ADDRESSABLE VLA inside of simd
loop body, set ctx->add_safelen1 instead of making it GOVD_PRIVATE.
(gimplify_adjust_omp_clauses): Add safelen (1) clause if
ctx->add_safelen1 is set.
Jakub Jelinek [Fri, 30 Aug 2019 12:45:31 +0000 (14:45 +0200)]
backport: re PR libgomp/90585 (libgomp hsa plugin ftbfs in the x32 multilib variant)
Backported from mainline
2019-05-24 Jakub Jelinek <jakub@redhat.com>
PR libgomp/90585
* plugin/plugin-hsa.c (print_kernel_dispatch, run_kernel): Use PRIu64
macro instead of "lu".
(release_kernel_dispatch): Likewise. Cast shadow->debug to uintptr_t
before casting to void *.
Jakub Jelinek [Fri, 30 Aug 2019 12:41:43 +0000 (14:41 +0200)]
backport: re PR fortran/90329 (Incompatibility between gfortran and C lapack calls)
Backported from mainline
2019-05-29 Jakub Jelinek <jakub@redhat.com>
PR fortran/90329
* lto-streamer.h (LTO_minor_version): Bump to 1.
Backported from mainline
2019-05-16 Jakub Jelinek <jakub@redhat.com>
PR fortran/90329
* tree-core.h (struct tree_decl_common): Document
decl_nonshareable_flag for PARM_DECLs.
* tree.h (DECL_HIDDEN_STRING_LENGTH): Define.
* calls.c (expand_call): Don't try tail call if caller
has any DECL_HIDDEN_STRING_LENGTH PARM_DECLs that are or might be
passed on the stack and callee needs to pass any arguments on the
stack.
* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Use
else if instead of series of mutually exclusive ifs. Handle
DECL_HIDDEN_STRING_LENGTH for PARM_DECLs.
* tree-streamer-out.c (pack_ts_decl_common_value_fields): Likewise.
* lang.opt (fbroken-callers): Remove.
(ftail-call-workaround, ftail-call-workaround=): New options.
* gfortran.h (struct gfc_namespace): Add implicit_interface_calls.
* interface.c (gfc_procedure_use): Set implicit_interface_calls
for calls to implicit interface procedures.
* trans-decl.c (create_function_arglist): Use flag_tail_call_workaround
instead of flag_broken_callers. If it is not 2, also require
sym->ns->implicit_interface_calls.
* invoke.texi (fbroken-callers): Remove documentation.
(ftail-call-workaround, ftail-call-workaround=): Document.
2019-05-19 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/90329
* invoke.texi: Document -fbroken-callers.
* lang.opt: Add -fbroken-callers.
* trans-decl.c (create_function_arglist): Only set
DECL_HIDDEN_STRING_LENGTH if flag_broken_callers is set.
2019-05-16 Jakub Jelinek <jakub@redhat.com>
PR fortran/90329
* trans-decl.c (create_function_arglist): Set
DECL_HIDDEN_STRING_LENGTH on hidden string length PARM_DECLs if
len is constant.
Jakub Jelinek [Fri, 30 Aug 2019 12:38:31 +0000 (14:38 +0200)]
backport: re PR c++/90108 (ICE: Segmentation fault (in c_tree_chain_next))
Backported from mainline
2019-04-19 Jakub Jelinek <jakub@redhat.com>
PR c++/90108
* c-decl.c (merge_decls): If remove is main variant and
DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
variant that has newdecl as TYPE_NAME if any.
* decl.c (duplicate_decls): If remove is main variant and
DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
variant that has newdecl as TYPE_NAME if any.
Jakub Jelinek [Fri, 30 Aug 2019 12:36:05 +0000 (14:36 +0200)]
backport: re PR c/89933 (ICE in merge_decls, at c/c-decl.c:2517)
Backported from mainline
2019-04-12 Jakub Jelinek <jakub@redhat.com>
PR c/89933
* c-decl.c (merge_decls): When newdecl's type is its main variant,
don't try to remove it from the variant list, but instead assert
it has no variants.
* decl.c (duplicate_decls): When newdecl's type is its main variant,
don't try to remove it from the variant list, but instead assert
it has no variants.
Jakub Jelinek [Fri, 30 Aug 2019 12:35:05 +0000 (14:35 +0200)]
backport: re PR middle-end/89998 (ICE: verify_gimple failed in printf-return-value)
Backported from mainline
2019-04-09 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/89998
* gimple-ssa-sprintf.c (try_substitute_return_value): Use lhs type
instead of integer_type_node if possible, don't add ranges if return
type is not compatible with int.
* gimple-fold.c (gimple_fold_builtin_sprintf,
gimple_fold_builtin_snprintf): Use lhs type instead of hardcoded
integer_type_node.
* gcc.c-torture/compile/pr89998-1.c: New test.
* gcc.c-torture/compile/pr89998-2.c: New test.
Jakub Jelinek [Fri, 30 Aug 2019 12:34:19 +0000 (14:34 +0200)]
backport: re PR sanitizer/89869 (-fsanitize=undefined miscompilation)
Backported from mainline
2019-03-29 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/89869
* typeck.c: Include gimplify.h.
(cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
for second time. Formatting fixes.
Jakub Jelinek [Fri, 30 Aug 2019 12:30:48 +0000 (14:30 +0200)]
backport: re PR c++/60702 (thread_local initialization)
Backported from mainline
2019-03-22 Jakub Jelinek <jakub@redhat.com>
PR c++/60702
* cp-tree.h (get_tls_wrapper_fn): Remove declaration.
(maybe_get_tls_wrapper_call): Declare.
* decl2.c (get_tls_wrapper_fn): Make static.
(maybe_get_tls_wrapper_call): New function.
* typeck.c (build_class_member_access_expr): Handle accesses to TLS
variables.
* semantics.c (finish_qualified_id_expr): Likewise.
(finish_id_expression_1): Use maybe_get_tls_wrapper_call.
* pt.c (tsubst_copy_and_build): Likewise.
* g++.dg/tls/thread_local11.C: New test.
* g++.dg/tls/thread_local11.h: New test.
* g++.dg/tls/thread_local12a.C: New test.
* g++.dg/tls/thread_local12b.C: New test.
* g++.dg/tls/thread_local12c.C: New test.
* g++.dg/tls/thread_local12d.C: New test.
* g++.dg/tls/thread_local12e.C: New test.
* g++.dg/tls/thread_local12f.C: New test.
* g++.dg/tls/thread_local12g.C: New test.
* g++.dg/tls/thread_local12h.C: New test.
* g++.dg/tls/thread_local12i.C: New test.
* g++.dg/tls/thread_local12j.C: New test.
* g++.dg/tls/thread_local12k.C: New test.
* g++.dg/tls/thread_local12l.C: New test.
Jakub Jelinek [Fri, 30 Aug 2019 12:29:13 +0000 (14:29 +0200)]
backport: re PR c++/89767 (ICE with tuple and optimization)
Backported from mainline
2019-03-21 Jakub Jelinek <jakub@redhat.com>
PR c++/89767
* parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
variables, check for duplicates in this function.
* lambda.c (add_capture): Don't check for duplicates nor use
IDENTIFIER_MARKED.
(register_capture_members): Don't clear IDENTIFIER_MARKED here.
* g++.dg/cpp1y/lambda-init18.C: New test.
* g++.dg/cpp1y/lambda-init19.C: New test.
* g++.dg/cpp1y/pr89767.C: New test.
Jakub Jelinek [Fri, 30 Aug 2019 12:27:21 +0000 (14:27 +0200)]
backport: re PR target/89752 (ICE in emit_move_insn, at expr.c:3723)
Backported from mainline
2019-03-19 Jakub Jelinek <jakub@redhat.com>
PR target/89752
* gimplify.c (gimplify_asm_expr): For output argument with
TREE_ADDRESSABLE type, clear allows_reg if it allows memory, otherwise
diagnose error.
* g++.dg/ext/asm15.C: Check for particular diagnostic wording.
* g++.dg/ext/asm16.C: Likewise.
* g++.dg/ext/asm17.C: New test.
Jakub Jelinek [Fri, 30 Aug 2019 12:26:30 +0000 (14:26 +0200)]
backport: re PR target/89726 (Incorrect inlined version of 'ceil' for 32bit)
Backported from mainline
2019-03-19 Jakub Jelinek <jakub@redhat.com>
PR target/89726
* config/i386/i386.c (ix86_expand_floorceildf_32): In ceil
compensation use x2 += 1 instead of x2 -= -1 and when honoring
signed zeros, do another copysign after the compensation.
* gcc.target/i386/fpprec-1.c (x): Add 6 new constants.
(expect_round, expect_rint, expect_floor, expect_ceil, expect_trunc):
Add expected results for them.
Jakub Jelinek [Fri, 30 Aug 2019 12:18:54 +0000 (14:18 +0200)]
backport: re PR tree-optimization/89703 (ICE in compare_values_warnv, at tree-vrp.c:997)
Backported from mainline
2019-03-14 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/89703
* tree-ssa-strlen.c (valid_builtin_call): Punt if stmt call types
aren't compatible also with builtin_decl_explicit. Check pure
or non-pure status of BUILT_IN_STR{{,N}CMP,N{LEN,{CAT,CPY}{,_CHK}}}
and BUILT_IN_STPNCPY{,_CHK}.
* gcc.c-torture/compile/pr89703-1.c: New test.
* gcc.c-torture/compile/pr89703-2.c: New test.
Jakub Jelinek [Fri, 30 Aug 2019 12:15:50 +0000 (14:15 +0200)]
backport: re PR fortran/89651 (OpenMP private array uninitialized warning with -O flag)
Backported from mainline
2019-03-11 Jakub Jelinek <jakub@redhat.com>
PR fortran/89651
* trans-openmp.c (gfc_omp_clause_default_ctor): Set TREE_NO_WARNING
on decl if adding COND_EXPR for allocatable.
(gfc_omp_clause_copy_ctor): Set TREE_NO_WARNING on dest.
Jakub Jelinek [Fri, 30 Aug 2019 12:11:06 +0000 (14:11 +0200)]
backport: re PR c/89520 (ICE tree check: accessed operand 4 of call_expr with 3 operands in convert_to_integer_1, at convert.c:668)
Backported from mainline
2019-02-28 Jakub Jelinek <jakub@redhat.com>
PR c/89520
* convert.c (convert_to_real_1, convert_to_integer_1): Punt for
builtins if they don't have a single scalar floating point argument.
Formatting fixes.
* gcc.dg/pr89520-1.c: New test.
* gcc.dg/pr89520-2.c: New test.
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.