public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/101262] New: GCC11 OpenMP optimization causes sigsegv on aligned constant array in darktable
@ 2021-06-29 17:21 johnnybit at gmail dot com
  2021-06-29 17:54 ` [Bug middle-end/101262] " jakub at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: johnnybit at gmail dot com @ 2021-06-29 17:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101262
           Summary: GCC11 OpenMP optimization causes sigsegv on aligned
                    constant array in darktable
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: johnnybit at gmail dot com
  Target Milestone: ---

A loop with constant length arrays with openmp and simd optimization crashes
with sigsegv when compilled with GCC11. Same code works with previous versions
and with various Clang versions

the code in question looks like

#define PIXEL_CHAN 8

static const float centers_ops[PIXEL_CHAN] DT_ALIGNED_ARRAY = {-56.0f / 7.0f,
// = -8.0f
                                                               -48.0f / 7.0f,
                                                               -40.0f / 7.0f,
                                                               -32.0f / 7.0f,
                                                               -24.0f / 7.0f,
                                                               -16.0f / 7.0f,
                                                                -8.0f / 7.0f,
                                                                 0.0f / 7.0f};

#pragma omp simd aligned(centers_ops, factors:64) safelen(PIXEL_CHAN)
reduction(+:result)
  for(int i = 0; i < PIXEL_CHAN; ++i)
    result += gaussian_func(expo - centers_ops[i], gauss_denom) * factors[i];


centers_ops is static const float [PIXEL_CHAN]
factors is const float *const restric factors (which is PIXEL_CHAN length)

the crash is on

result += gaussian_func(expo - centers_ops[i], gauss_denom) * factors[i];

line.

The reports in darktable are 
https://github.com/darktable-org/darktable/issues/9340
https://github.com/darktable-org/darktable/issues/9002

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

end of thread, other threads:[~2023-05-29 10:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29 17:21 [Bug c/101262] New: GCC11 OpenMP optimization causes sigsegv on aligned constant array in darktable johnnybit at gmail dot com
2021-06-29 17:54 ` [Bug middle-end/101262] " jakub at gcc dot gnu.org
2021-06-29 19:06 ` johnnybit at gmail dot com
2021-06-29 22:45 ` jakub at gcc dot gnu.org
2021-06-30  4:22 ` johnnybit at gmail dot com
2021-06-30  4:42 ` marxin at gcc dot gnu.org
2021-06-30  6:36 ` [Bug middle-end/101262] [11/12 Regression] " rguenth at gcc dot gnu.org
2021-07-28  7:07 ` rguenth at gcc dot gnu.org
2022-04-21  7:49 ` rguenth at gcc dot gnu.org
2023-05-29 10:05 ` [Bug middle-end/101262] [11/12/13/14 " 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).