public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98383] New: internal compiler error: in make_decl_rtl, at varasm.c:1342
@ 2020-12-18 21:27 cebtenzzre at gmail dot com
  2020-12-19  9:08 ` [Bug c++/98383] " jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: cebtenzzre at gmail dot com @ 2020-12-18 21:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98383
           Summary: internal compiler error: in make_decl_rtl, at
                    varasm.c:1342
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cebtenzzre at gmail dot com
  Target Milestone: ---

Created attachment 49803
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49803&action=edit
Preprocessed source that triggers the error

g++ crashes with an internal compiler error while compiling a version of oneDNN
used by ideep. Specifically, ref_shuffle.cpp at commit
7aed236906b1f7a05c0917e5257a1af05e9ff683
(https://github.com/oneapi-src/oneDNN/blob/7aed236906b1f7a05c0917e5257a1af05e9ff683/src/cpu/ref_shuffle.cpp).
I have not attempted to compile the latest version of this file. Preprocessed
source is gzipped and attached as ref_shuffle.ii.gz.

-fopenmp is necessary to reproduce the crash. It occurs with -O1 (but not -O0,
-O2, or -O3), with -fsanitize=address -O1 (same line in the error message), and
with -fsanitize=address and either -O2 or -O3 (different line in the error
message).

Output:
$ g++ -c ref_shuffle.ii -fopenmp -O1
during RTL pass: expand
../third_party/ideep/mkl-dnn/src/cpu/ref_shuffle.cpp: In function
‘_ZNK4dnnl4impl3cpu13ref_shuffle_tILi4EE8execute_IL17dnnl_format_tag_t112EEEvRKNS0_10exec_ctx_tE._omp_fn.0’:
../third_party/ideep/mkl-dnn/src/cpu/ref_shuffle.cpp:69:9: internal compiler
error: in make_decl_rtl, at varasm.c:1342
   69 | #pragma omp parallel for collapse(3) schedule(static)
      |         ^~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.

$ g++ -c ref_shuffle.ii -fopenmp -fsanitize=address -O2
during RTL pass: expand
../third_party/ideep/mkl-dnn/src/cpu/ref_shuffle.cpp: In function
‘_ZNK4dnnl4impl3cpu13ref_shuffle_tILi4EE8execute_IL17dnnl_format_tag_t112EEEvRKNS0_10exec_ctx_tE._omp_fn.0’:
../third_party/ideep/mkl-dnn/src/cpu/ref_shuffle.cpp:76:56: internal compiler
error: in make_decl_rtl, at varasm.c:1342
   76 |             for (int cc = 0; cc < nstl::min(blksize, C - cb); ++cc) {
      |                                                      ~~^~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl
--with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit
--enable-cet=auto --enable-checking=release --enable-clocale=gnu
--enable-default-pie --enable-default-ssp --enable-gnu-indirect-function
--enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id
--enable-lto --enable-multilib --enable-plugin --enable-shared
--enable-threads=posix --disable-libssp --disable-libstdcxx-pch
--disable-libunwind-exceptions --disable-werror
gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (GCC)

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

* [Bug c++/98383] internal compiler error: in make_decl_rtl, at varasm.c:1342
  2020-12-18 21:27 [Bug c++/98383] New: internal compiler error: in make_decl_rtl, at varasm.c:1342 cebtenzzre at gmail dot com
@ 2020-12-19  9:08 ` jakub at gcc dot gnu.org
  2020-12-20 20:11 ` cebtenzzre at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-12-19  9:08 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Reduced testcase:
int bar (const int &);

void
foo ()
{
#pragma omp simd
  for (int i = 0; i < bar (8); ++i)
    ;
}

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

* [Bug c++/98383] internal compiler error: in make_decl_rtl, at varasm.c:1342
  2020-12-18 21:27 [Bug c++/98383] New: internal compiler error: in make_decl_rtl, at varasm.c:1342 cebtenzzre at gmail dot com
  2020-12-19  9:08 ` [Bug c++/98383] " jakub at gcc dot gnu.org
@ 2020-12-20 20:11 ` cebtenzzre at gmail dot com
  2020-12-21  8:02 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cebtenzzre at gmail dot com @ 2020-12-20 20:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Cebtenzzre <cebtenzzre at gmail dot com> ---
I tried GCC 9.3.0 in Godbolt and there was no ICE, so I ran a git bisect. It
turns out this issue is a regression caused by commit
d81ab49d0586fca0f3ee2f49c4581dd02508fcca ("tree.h
(OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV): Rename to ...").

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

* [Bug c++/98383] internal compiler error: in make_decl_rtl, at varasm.c:1342
  2020-12-18 21:27 [Bug c++/98383] New: internal compiler error: in make_decl_rtl, at varasm.c:1342 cebtenzzre at gmail dot com
  2020-12-19  9:08 ` [Bug c++/98383] " jakub at gcc dot gnu.org
  2020-12-20 20:11 ` cebtenzzre at gmail dot com
@ 2020-12-21  8:02 ` cvs-commit at gcc dot gnu.org
  2020-12-21  9:35 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-21  8:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:b6237343e78ae115d09618efc1443bdf2fd6c09b

commit r11-6280-gb6237343e78ae115d09618efc1443bdf2fd6c09b
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Dec 21 08:59:05 2020 +0100

    openmp: Fix up handling of addressable temporaries in simd lb, b and incr
expressions [PR98383]

    For simd, we have code to artificially add locally defined variables into
    private clauses if they are addressable, so that omplower turns them into
    "omp simd array" variables.  As the testcase shows, this is undesirable if
    those temporaries only show in the lb, b or incr expressions and nowhere
else,
    if it is just used there, we really want normal scalar temporaries.

    This patch implements that by making sure we don't set for those
GOVD_LOCAL-ish
    temporaries turned into GOVD_PRIVATE the GOVD_SEEN flag during
gimplification
    of the lb, b and incr expressions, which means that the private clause
isn't
    added for those.

    2020-12-21  Jakub Jelinek  <jakub@redhat.com>

            PR c++/98383
            * gimplify.c (struct gimplify_omp_ctx): Add in_for_exprs flag.
            (gimple_add_tmp_var): For addressable temporaries appearing in
            simd lb, b or incr expressions, don't add a private clause unless
            it is seen also outside of those expressions in the simd body.
            (omp_notice_variable): Likewise.
            (gimplify_omp_for): Set and reset in_for_exprs around
gimplification
            of lb, b or incr expressions.

            * g++.dg/gomp/pr98383.C: New test.

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

* [Bug c++/98383] internal compiler error: in make_decl_rtl, at varasm.c:1342
  2020-12-18 21:27 [Bug c++/98383] New: internal compiler error: in make_decl_rtl, at varasm.c:1342 cebtenzzre at gmail dot com
                   ` (2 preceding siblings ...)
  2020-12-21  8:02 ` cvs-commit at gcc dot gnu.org
@ 2020-12-21  9:35 ` jakub at gcc dot gnu.org
  2021-01-05  9:09 ` [Bug c++/98383] [10 Regression] " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-12-21  9:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for gcc 11 so far, queued for backporting.

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

* [Bug c++/98383] [10 Regression] internal compiler error: in make_decl_rtl, at varasm.c:1342
  2020-12-18 21:27 [Bug c++/98383] New: internal compiler error: in make_decl_rtl, at varasm.c:1342 cebtenzzre at gmail dot com
                   ` (3 preceding siblings ...)
  2020-12-21  9:35 ` jakub at gcc dot gnu.org
@ 2021-01-05  9:09 ` rguenth at gcc dot gnu.org
  2021-01-06  9:40 ` cvs-commit at gcc dot gnu.org
  2021-01-06  9:46 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-05  9:09 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|internal compiler error: in |[10 Regression] internal
                   |make_decl_rtl, at           |compiler error: in
                   |varasm.c:1342               |make_decl_rtl, at
                   |                            |varasm.c:1342
           Priority|P3                          |P2
   Target Milestone|---                         |10.3
      Known to work|                            |11.0

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

* [Bug c++/98383] [10 Regression] internal compiler error: in make_decl_rtl, at varasm.c:1342
  2020-12-18 21:27 [Bug c++/98383] New: internal compiler error: in make_decl_rtl, at varasm.c:1342 cebtenzzre at gmail dot com
                   ` (4 preceding siblings ...)
  2021-01-05  9:09 ` [Bug c++/98383] [10 Regression] " rguenth at gcc dot gnu.org
@ 2021-01-06  9:40 ` cvs-commit at gcc dot gnu.org
  2021-01-06  9:46 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-06  9:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:03fd9caa6a2515aafe9edda3c5325b5e4e039bde

commit r10-9222-g03fd9caa6a2515aafe9edda3c5325b5e4e039bde
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Dec 21 08:59:05 2020 +0100

    openmp: Fix up handling of addressable temporaries in simd lb, b and incr
expressions [PR98383]

    For simd, we have code to artificially add locally defined variables into
    private clauses if they are addressable, so that omplower turns them into
    "omp simd array" variables.  As the testcase shows, this is undesirable if
    those temporaries only show in the lb, b or incr expressions and nowhere
else,
    if it is just used there, we really want normal scalar temporaries.

    This patch implements that by making sure we don't set for those
GOVD_LOCAL-ish
    temporaries turned into GOVD_PRIVATE the GOVD_SEEN flag during
gimplification
    of the lb, b and incr expressions, which means that the private clause
isn't
    added for those.

    2020-12-21  Jakub Jelinek  <jakub@redhat.com>

            PR c++/98383
            * gimplify.c (struct gimplify_omp_ctx): Add in_for_exprs flag.
            (gimple_add_tmp_var): For addressable temporaries appearing in
            simd lb, b or incr expressions, don't add a private clause unless
            it is seen also outside of those expressions in the simd body.
            (omp_notice_variable): Likewise.
            (gimplify_omp_for): Set and reset in_for_exprs around
gimplification
            of lb, b or incr expressions.

            * g++.dg/gomp/pr98383.C: New test.

    (cherry picked from commit b6237343e78ae115d09618efc1443bdf2fd6c09b)

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

* [Bug c++/98383] [10 Regression] internal compiler error: in make_decl_rtl, at varasm.c:1342
  2020-12-18 21:27 [Bug c++/98383] New: internal compiler error: in make_decl_rtl, at varasm.c:1342 cebtenzzre at gmail dot com
                   ` (5 preceding siblings ...)
  2021-01-06  9:40 ` cvs-commit at gcc dot gnu.org
@ 2021-01-06  9:46 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-06  9:46 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 10.3+ too.

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

end of thread, other threads:[~2021-01-06  9:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18 21:27 [Bug c++/98383] New: internal compiler error: in make_decl_rtl, at varasm.c:1342 cebtenzzre at gmail dot com
2020-12-19  9:08 ` [Bug c++/98383] " jakub at gcc dot gnu.org
2020-12-20 20:11 ` cebtenzzre at gmail dot com
2020-12-21  8:02 ` cvs-commit at gcc dot gnu.org
2020-12-21  9:35 ` jakub at gcc dot gnu.org
2021-01-05  9:09 ` [Bug c++/98383] [10 Regression] " rguenth at gcc dot gnu.org
2021-01-06  9:40 ` cvs-commit at gcc dot gnu.org
2021-01-06  9:46 ` 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).