From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CC4543887025; Thu, 8 Oct 2020 12:57:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC4543887025 From: "vries at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/97203] [nvptx] 'illegal memory access was encountered' with 'omp simd'/SIMT and cexpf call Date: Thu, 08 Oct 2020 12:57:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: openmp, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: vries 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 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: Thu, 08 Oct 2020 12:57:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97203 --- Comment #3 from Tom de Vries --- [ Note, this is with GOMP_NVPTX_JIT=3D-O0. ] In sinf, we have: ... 45: return -__kernel_cosf(y[0],y[1]); ... which translates to: ... .loc 1 45 12 ld.f32 %r67,[%frame+4]; ld.f32 %r65,[%frame]; { .param .f32 %value_in; .param .f32 %out_arg1; st.param.f32 [%out_arg1],%r65; .param .f32 %out_arg2; st.param.f32 [%out_arg2],%r67; call (%value_in),__kernel_cosf,(%out_arg1,%out_arg2); ld.param.f32 %r68,[%value_in]; } .loc 1 45 11 neg.f32 %r37,%r68; ... If I place (using GOMP_NVPTX_PTXRW) a trap before the first load: ... .loc 1 45 12 +trap ld.f32 %r67,[%frame+4]; ... I get: ... libgomp: cuCtxSynchronize error: an illegal instruction was encountered ... If I place it after the first load, I get: ... libgomp: cuCtxSynchronize error: an illegal memory access was encountered ...=