From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4B2B6385840B; Thu, 13 Jan 2022 11:41:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B2B6385840B From: "gilles.gouaillardet at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/104005] New: Regression on arm+sve with -O2 -fPIC Date: Thu, 13 Jan 2022 11:41:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gilles.gouaillardet at gmail dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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, 13 Jan 2022 11:41:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104005 Bug ID: 104005 Summary: Regression on arm+sve with -O2 -fPIC Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: gilles.gouaillardet at gmail dot com Target Milestone: --- The GROMACS (2021.3) non regression test suite now hangs with the latest tr= unk when shared libraries are used from -O2 when two or more thread-MPI are use= d. I only tried 512 bit SVE vectors. I ran a git bisect and it pointed to the following commit: commit 526e1639aa76b0a8496b0dc3a3ff2c450229544e (refs/bisect/bad) Author: Richard Sandiford Date: Fri Nov 12 17:33:00 2021 +0000 aarch64: Detect more consecutive MEMs When investigating this issue, I found out that rebuilding the src/gromacs/domdec/redistribute.cpp file **without** -fPIC is enough to avo= id the issue (a crash or a hang depending on the test cases). FWIW, thread-MPI is a "fake" MPI implementation that used threads instead processes. In this case, that means two threads. Then each thread enter its= own #pragma omp parallel section (and each thread-MPI thread has a unique OpenMP thread) The attached tarball includes preprocessed source (redistribute.cpp.i) and assembly with -fPIC (redistribute.cpp.PIC.s) and without -fPIC (redistribute.cpp.noPIC.s) for the commit mentioned above and the commit ri= ght before. Please let me know if this is enough for you to make sense of this bug, otherwise I will provide instructions on how to build GROMACS from sources = and manually workaround the issue by "removing" the -fPIC flags for the redistribute.cpp file.=