From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4B7993895FFC; Wed, 12 Oct 2022 13:47:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B7993895FFC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665582444; bh=iUTLIMxac0cgPAEz/CtAT0WiOMtitXvbplhjr0SSReQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uzpkjKOWEvB//We9VrKFR8SaIRqrdC6Xkgt2VEwEHoeHPCZAIFDyXNcLe4FPnQoil uRT3c+NX01VVUkCHjKFiIKWEtJSB9WyE7gjkor3M9ixI3EjzmDky7TV+YVRDme+5Hf a7CED6jA/GyuqCS9SGE/fMVdpNbuxGC4JL2F2CeQ= From: "burnus 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: Wed, 12 Oct 2022 13:47:24 +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: burnus 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 #1 from Tobias Burnus --- The problem seems to be that: execute_omp_device_lower () ... tree lhs =3D gimple_call_lhs (stmt), rhs =3D NULL_TREE; tree type =3D lhs ? TREE_TYPE (lhs) : integer_type_node; switch (gimple_call_internal_fn (stmt)) { case IFN_GOMP_TARGET_REV: is never reached. Thus, IFN_GOMP_TARGET_REV remains - and the assert that IFN_GOMP_TARGET_REV= has been removed fails, leading to the ICE. It seems as if pass_omp_device_lower::gate(...) wrongly skips the generated nested function for parallel. The current check is: return (!(fun->curr_properties & PROP_gimple_lomp_dev) || (flag_openmp && cgraph_node::get (fun->decl)->calls_declare_variant_al= t));=