From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DB49C3858000; Mon, 24 Oct 2022 13:20:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB49C3858000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666617638; bh=YfK17gJvfaKDFMe1JQTeE7vR1zUQCyuefUt6hCEe8Ik=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YgaTYd0NXVPRKNXdwjzmJqc3lA4gMRurHsUV+YD0QP+5PLDin/N668lio/o+3N1F6 o8zvRKsq0GQuQpLv9/BHyO9Rwb3CcRQV0uNB+Oek8354NutB3AQR4DLFCUrlcsQeK4 aNUXjyDZenmY7enuJ9w6WCDghEhSbnbehCHOmYK4= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/107236] [OpenMP] ICE for reverse offload: in expand_GOMP_TARGET_REV, at internal-fn.cc:376 Date: Mon, 24 Oct 2022 13:20:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code, openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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=3D107236 --- Comment #2 from CVS Commits --- The master branch has been updated by Tobias Burnus : https://gcc.gnu.org/g:178ac530fe67e4f2fc439cc4ce89bc19d571ca31 commit r13-3455-g178ac530fe67e4f2fc439cc4ce89bc19d571ca31 Author: Tobias Burnus Date: Mon Oct 24 15:19:00 2022 +0200 OpenMP: Fix reverse offload GOMP_TARGET_REV IFN corner cases [PR107236] For 'target parallel' and similarly nested directives, cgraph_node's calls_declare_variant_alt was not set in the parent region node but in cfun->decl. Hence, pass_omp_device_lower did not process handle the internal function GOMP_TARGET_REV. - Solution is to set it to the DECL_CONTEXT, which is set in adjust_context_and_scope. The cgraph_node::create_clone issue is exposed with -O2 for the existing libgomp.fortran/reverse-offload-1.f90. PR middle-end/107236 gcc/ChangeLog: * omp-expand.cc (expand_omp_target): Set calls_declare_variant_= alt in DECL_CONTEXT and not to cfun->decl. * cgraphclones.cc (cgraph_node::create_clone): Copy also the node's calls_declare_variant_alt value. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/target-device-ancestor-6.f90: New test.=