public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/106467] New: [OpenMP] Wrong code with collapse – tree sharing issue.
@ 2022-07-28 16:08 burnus at gcc dot gnu.org
  2022-07-28 16:44 ` [Bug middle-end/106467] " burnus at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2022-07-28 16:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106467

            Bug ID: 106467
           Summary: [OpenMP] Wrong code with collapse – tree sharing
                    issue.
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, openmp
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: burnus at gcc dot gnu.org, jakub at gcc dot gnu.org,
                    sandra at gcc dot gnu.org
        Depends on: 106449
  Target Milestone: ---

Created attachment 53375
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53375&action=edit
Testcase, modified version of libgomp.c-c++-common/pr106449.c from attachment
53370 to PR 106449

+++ This bug was initially created as a clone of Bug #106449 +++

(In reply to Jakub Jelinek from bug 106449 comment #9)
> Created attachment 53370 [details]
> gcc13-pr106449-2.patch
> 
> Updated fix for this PR which fixes even the runtime case (it was caused by
> missing unsharing and regimplification clobbering a shared tree).

My potentially wrong impression is that the unshare_tree issue also exists
with a bare collapse.

At least, when converting the testcase from the patch to one which uses 'FOR'
instead of '(FOR) SIMD', it fails for BAR in a similar way as the SIMD version
with the initial version of the patch.

Namely, the result it the __builtin_abort call for i = 24 in bar (n=64, m=128):

33        for (i = 0; i < 32768; i++)
34          if (b[2 * i] != &a[i / 64] || b[2 * i + 1] != &a[(i / 64) + 64 + (i
% 64)])
35            __builtin_abort ();

The LHS of the is false (sub-LHS/sub-RHS are idential) but the RHS, i.e.
  b[2 * i + 1] != &a[(i / 64) + 64 + (i % 64)]
fails as 
  b[2 * i + 1] = 0x7fffffffd588
while
  &a[(i / 64) + 64 + (i % 64)] = 0x7fffffffd490


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106449
[Bug 106449] ICE in #pragma omp parallel for simd since
r6-4544-ge01d41e553aae245

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-03 14:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-28 16:08 [Bug middle-end/106467] New: [OpenMP] Wrong code with collapse – tree sharing issue burnus at gcc dot gnu.org
2022-07-28 16:44 ` [Bug middle-end/106467] " burnus at gcc dot gnu.org
2022-07-28 16:45 ` burnus at gcc dot gnu.org
2022-07-28 17:14 ` jakub at gcc dot gnu.org
2022-07-29 10:42 ` burnus at gcc dot gnu.org
2022-11-03 14:10 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).