public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/102492] New: [12 Regression] ICE in scan_sharing_clauses, at omp-low.c:1205
@ 2021-09-26 14:53 asolokha at gmx dot com
  2021-09-27  8:40 ` [Bug tree-optimization/102492] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: asolokha at gmx dot com @ 2021-09-26 14:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102492
           Summary: [12 Regression] ICE in scan_sharing_clauses, at
                    omp-low.c:1205
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, openmp
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

Created attachment 51510
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51510&action=edit
Testcase

g++-12.0.0-alpha20210919 snapshot (g:32731fa5b0abf092029b8e2be64319b978bda514)
ICEs when compiling the attached testcase, partially reduced from
libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/reduce.cc, w/ -fopenmp:

% g++-12.0.0 -fopenmp -c vksbmhow.cc
vksbmhow.cc: In function 'void __simd_transform_reduce(_Size, _Tp,
_BinaryOperation) [with _Size = int; _Tp = Number; _BinaryOperation = int]':
vksbmhow.cc:25:9: error: no matching function for call to 'Number::Number()'
   25 | #pragma omp simd
      |         ^~~
vksbmhow.cc:2:3: note: candidate: 'Number::Number(int)'
    2 |   Number(int);
      |   ^~~~~~
vksbmhow.cc:2:3: note:   candidate expects 1 argument, 0 provided
vksbmhow.cc:1:8: note: candidate: 'constexpr Number::Number(const Number&)'
    1 | struct Number {
      |        ^~~~~~
vksbmhow.cc:1:8: note:   candidate expects 1 argument, 0 provided
vksbmhow.cc:1:8: note: candidate: 'constexpr Number::Number(Number&&)'
vksbmhow.cc:1:8: note:   candidate expects 1 argument, 0 provided
during GIMPLE pass: omplower
vksbmhow.cc:25:9: internal compiler error: in scan_sharing_clauses, at
omp-low.c:1205
   25 | #pragma omp simd
      |         ^~~
0x7c90d0 scan_sharing_clauses
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/omp-low.c:1205
0x1014514 scan_omp_for
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/omp-low.c:2820
0x1015c00 scan_omp_1_stmt
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/omp-low.c:4137
0xe7deea walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimple-walk.c:602
0xe7e120 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimple-walk.c:51
0xe7dfd5 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimple-walk.c:711
0xe7e120 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimple-walk.c:51
0xe7dfd5 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimple-walk.c:711
0xe7e120 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimple-walk.c:51
0x10213e5 scan_omp
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/omp-low.c:4241
0x10213e5 execute_lower_omp
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/omp-low.c:14292
0x10213e5 execute
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/omp-low.c:14350

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

* [Bug tree-optimization/102492] [12 Regression] ICE in scan_sharing_clauses, at omp-low.c:1205
  2021-09-26 14:53 [Bug tree-optimization/102492] New: [12 Regression] ICE in scan_sharing_clauses, at omp-low.c:1205 asolokha at gmx dot com
@ 2021-09-27  8:40 ` rguenth at gcc dot gnu.org
  2021-09-27 13:33 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-09-27  8:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug tree-optimization/102492] [12 Regression] ICE in scan_sharing_clauses, at omp-low.c:1205
  2021-09-26 14:53 [Bug tree-optimization/102492] New: [12 Regression] ICE in scan_sharing_clauses, at omp-low.c:1205 asolokha at gmx dot com
  2021-09-27  8:40 ` [Bug tree-optimization/102492] " rguenth at gcc dot gnu.org
@ 2021-09-27 13:33 ` jakub at gcc dot gnu.org
  2021-09-28  9:42 ` [Bug middle-end/102492] " cvs-commit at gcc dot gnu.org
  2021-10-16  6:35 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-09-27 13:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
It started with my r12-3654-ge5597f2ad55219092929dc12ea15e1edba06df18 then.
Shorter testcase:
struct S { S (int); };
void bar (S &);

void
foo ()
{
  #pragma omp simd
  for (int i = 0; i < 64; i++)
    {
      S s = 26;
      bar (s);
    }
}

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

* [Bug middle-end/102492] [12 Regression] ICE in scan_sharing_clauses,  at omp-low.c:1205
  2021-09-26 14:53 [Bug tree-optimization/102492] New: [12 Regression] ICE in scan_sharing_clauses, at omp-low.c:1205 asolokha at gmx dot com
  2021-09-27  8:40 ` [Bug tree-optimization/102492] " rguenth at gcc dot gnu.org
  2021-09-27 13:33 ` jakub at gcc dot gnu.org
@ 2021-09-28  9:42 ` cvs-commit at gcc dot gnu.org
  2021-10-16  6:35 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-28  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 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:4f07769057c45ec9e751ab1c23e0fe4750102840

commit r12-3917-g4f07769057c45ec9e751ab1c23e0fe4750102840
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Sep 28 11:38:03 2021 +0200

    openmp: Don't call omp_finish_clause on implicitly added private clauses on
simd [PR102492]

    The gimplifier adds implicit private clauses on SIMD constructs for local
    variables in the SIMD body if they are addressable to make sure they use
    the magic arrays with "omp simd array" attribute (such that each SIMD lane
    has its own copy), but we actually don't need to default privatize etc.
those,
    the construction for them is done in the SIMD body and so is destruction.
    omp_finish_clause for C++ now requires default constructor (and dtor) for
private,
    so that OpenMP 5.1 default(private) works, but that will never be needed on
    SIMD.  So, this patch just doesn't call omp_finish_clause for private on
simd.
    The C and Fortran langhooks don't do anything for private.

    2021-09-28  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/102492
            * gimplify.c (gimplify_adjust_omp_clauses_1): Don't call the
            omp_finish_clause langhook on implicitly added OMP_CLAUSE_PRIVATE
            clauses on SIMD constructs.

            * g++.dg/gomp/simd-3.C: New test.

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

* [Bug middle-end/102492] [12 Regression] ICE in scan_sharing_clauses,  at omp-low.c:1205
  2021-09-26 14:53 [Bug tree-optimization/102492] New: [12 Regression] ICE in scan_sharing_clauses, at omp-low.c:1205 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2021-09-28  9:42 ` [Bug middle-end/102492] " cvs-commit at gcc dot gnu.org
@ 2021-10-16  6:35 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-10-16  6:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should be fixed now.

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

end of thread, other threads:[~2021-10-16  6:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-26 14:53 [Bug tree-optimization/102492] New: [12 Regression] ICE in scan_sharing_clauses, at omp-low.c:1205 asolokha at gmx dot com
2021-09-27  8:40 ` [Bug tree-optimization/102492] " rguenth at gcc dot gnu.org
2021-09-27 13:33 ` jakub at gcc dot gnu.org
2021-09-28  9:42 ` [Bug middle-end/102492] " cvs-commit at gcc dot gnu.org
2021-10-16  6:35 ` 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).