From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 74BC53874C32; Wed, 24 Feb 2021 19:16:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 74BC53874C32 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/99226] [11 Regression] ICE in expand_expr_real_1, at expr.c:10279 Date: Wed, 24 Feb 2021 19:16:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: accepts-invalid, openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2021 19:16:01 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99226 --- Comment #6 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:9d2a69106beb346be1c511a9c1a61a256b697868 commit r11-7375-g9d2a69106beb346be1c511a9c1a61a256b697868 Author: Jakub Jelinek Date: Wed Feb 24 20:11:11 2021 +0100 openmp: Diagnose invalid teams nested in target construct [PR99226] The OpenMP standard says: "A teams region can only be strictly nested within the implicit parallel region or a target region. If a teams construct is nested within a target construct, that target construct must contain no statements, declarations or directives outside of the teams construct." We weren't diagnosing that restriction, because we need to allow e.g. #pragma omp target {{{{{{ #pragma omp teams ; }}}}}} and as target doesn't need to have teams nested in it, using some speci= al parser of the target body didn't feel right. And after the parsing, the question is if e.g. already parsing of the clauses doesn't add some statements before the teams statement (gimplification certainly will). As we now have a bugreport where we ICE on the invalid code, this just diagnoses a subset of the invalid programs, in particular those where nest to the teams strictly nested in targets the target region contains some other OpenMP construct. 2021-02-24 Jakub Jelinek PR fortran/99226 * omp-low.c (struct omp_context): Add teams_nested_p and nonteams_nested_p members. (scan_omp_target): Diagnose teams nested inside of target with other directives strictly nested inside of the same target. (check_omp_nesting_restrictions): Set ctx->teams_nested_p or ctx->nonteams_nested_p as needed. * c-c++-common/gomp/pr99226.c: New test. * gfortran.dg/gomp/pr99226.f90: New test.=