From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 735633851C1F; Thu, 29 Apr 2021 06:24:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 735633851C1F From: "vries at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/100321] [OpenMP][nvptx, SIMT] (Con't) Reduction fails with optimization and 'loop'/'for simd' but not with 'for' Date: Thu, 29 Apr 2021 06:24:33 +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: short_desc 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, 29 Apr 2021 06:24:33 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100321 Tom de Vries changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[OpenMP][nvptx] (Con't) |[OpenMP][nvptx, SIMT] |Reduction fails with |(Con't) Reduction fails |optimization and |with optimization and |'loop'/'for simd' but not |'loop'/'for simd' but not |with 'for' |with 'for' --- Comment #2 from Tom de Vries --- FTR, example minimized to: ... // { dg-additional-options "-foffload=3D-latomic" } #include #include #include #include using std::complex; #pragma omp declare reduction(+: complex: omp_out +=3D omp_in) int main (void) { const int N0 { 32768 }; const complex expected_value { N0, 0 }; complex counter_N0 { 0, 0 }; #pragma omp target #pragma omp for simd reduction(+: counter_N0) for (int i0 =3D 0 ; i0 < N0 ; i0++ ) counter_N0 +=3D complex { 1, 0 }; std::cerr << "Expected: " << expected_value << std::endl; std::cerr << "Got : " << counter_N0 << std::endl; return 0; } ...=