Bug 100001 - [GCN offloading] Occasional 'libgomp.oacc-c-c++-common/static-variable-1.c' execution failure
Summary: [GCN offloading] Occasional 'libgomp.oacc-c-c++-common/static-variable-1.c' e...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 11.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: openacc
Depends on:
Blocks:
 
Reported: 2021-04-09 15:46 UTC by Thomas Schwinge
Modified: 2023-03-14 09:25 UTC (History)
2 users (show)

See Also:
Host:
Target: gcn
Build:
Known to work:
Known to fail:
Last reconfirmed: 2023-03-14 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Schwinge 2021-04-09 15:46:28 UTC
My recent commit ffa0ae6eeef3ad15d3f288283e4c477193052f1a "Add 'libgomp.oacc-c-c++-common/static-variable-1.c' [PR84991, PR84992, PR90779]" for 'libgomp.oacc-c' -- so far ;-) -- never but for 'libgomp.oacc-c++' occasionally/"randomly" fails with GCN offloading, for '-O0' and/or '-O2'.  It's certainly possible that something's wrong with my verification logic, but in quite some testing why has the failure ever only shown up for the C++ but never the C variant?  On the other hand, why is C++ behaving different from C at all?  (I haven't spent any time on understanding that.)

A few examples of failures with GCN offloading:

    static-variable-1.exe: [...]/libgomp/testsuite/libgomp.oacc-c++/../libgomp.oacc-c-c++-common/static-variable-1.c:355: void t2(): Assertion `result_1_ == (((var_init_1 + num_gangs_actual_1 * (1 + i)) * (1 + var_init_1 + num_gangs_actual_1 * (1 + i)) / 2) - ((var_init_1 + num_gangs_actual_1 * (0 + i)) * (1 + var_init_1 + num_gangs_actual_1 * (0 + i)) / 2))' failed.

    static-variable-1.exe: [...]/libgomp/testsuite/libgomp.oacc-c++/../libgomp.oacc-c-c++-common/static-variable-1.c:368: void t2(): Assertion `result_2_ == (((t2_var_init_2 + num_gangs_actual_2 * (1 + i)) * (1 + t2_var_init_2 + num_gangs_actual_2 * (1 + i)) / 2) - ((t2_var_init_2 + num_gangs_actual_2 * (0 + i)) * (1 + t2_var_init_2 + num_gangs_actual_2 * (0 + i)) / 2))' failed.

    static-variable-1.exe: [...]/libgomp/testsuite/libgomp.oacc-c++/../libgomp.oacc-c-c++-common/static-variable-1.c:381: void t2(): Assertion `result_3_ == (((var_init_3 + num_gangs_actual_3 * (1 + i)) * (1 + var_init_3 + num_gangs_actual_3 * (1 + i)) / 2) - ((var_init_3 + num_gangs_actual_3 * (0 + i)) * (1 + var_init_3 + num_gangs_actual_3 * (0 + i)) / 2))' failed.

I've -- so far ;-) -- not seen any failures with nvptx offloading.
Comment 1 Thomas Schwinge 2023-03-14 09:23:05 UTC
At some point, the 'libgomp.oacc-c-c++-common/static-variable-1.c' execution test also started FAILing for C, not just C++, as initially noted above.
Comment 2 Thomas Schwinge 2023-03-14 09:25:30 UTC
With my recent commit r13-6590-gf8332e52a498df480f72303de32ad0751ad899fe "Use 'GOMP_MAP_VARS_TARGET' for OpenACC compute constructs [PR90596]", the frequency of those FAILs has increased to (almost) always.