From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3048F3858D34; Mon, 15 Apr 2024 09:06:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3048F3858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713171988; bh=Y0XNSoe9qZ7u1L3JEmhKu0tJGbjOaSZU1dw94NMsRHI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=o9/x2rroB9RMjeNz6RAk/EByOzG7Stzh6qCT2J8A3oDm+LVPP+qEsjLDuaybKS7E1 M46Q4DpqdJ7XAmI/DgMP+ASdgd0GeznWyHw+/Hprm+j6ZM4pfPNqK8v6LaPQpvxrV+ FYwZOvjzH61s0z6dfF1fVNPhk6wr9sPhDv/dKKK8= From: "kugan at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114635] OpenMP reductions fail dependency analysis Date: Mon, 15 Apr 2024 09:06:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization, openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: kugan at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114635 --- Comment #18 from kugan at gcc dot gnu.org --- Also, can we set INT_MAX when there is no explicit safelen specified in OMP. Something like: --- a/gcc/omp-low.cc +++ b/gcc/omp-low.cc @@ -6975,14 +6975,11 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, { tree c =3D omp_find_clause (gimple_omp_for_clauses (ctx->stmt), OMP_CLAUSE_SAFELEN); - poly_uint64 safe_len; - if (c =3D=3D NULL_TREE - || (poly_int_tree_p (OMP_CLAUSE_SAFELEN_EXPR (c), &safe_len) - && maybe_gt (safe_len, sctx.max_vf))) + if (c =3D=3D NULL_TREE) { c =3D build_omp_clause (UNKNOWN_LOCATION, OMP_CLAUSE_SAFELEN); OMP_CLAUSE_SAFELEN_EXPR (c) =3D build_int_cst (integer_type_node, - sctx.max_vf); + INT_MAX); OMP_CLAUSE_CHAIN (c) =3D gimple_omp_for_clauses (ctx->stmt); gimple_omp_for_set_clauses (ctx->stmt, c); }=