public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/93553] ICE in scan_omp_1_op, at omp-low.c:3485
       [not found] <bug-93553-4@http.gcc.gnu.org/bugzilla/>
@ 2020-07-17 11:02 ` burnus at gcc dot gnu.org
  2020-07-17 17:05 ` burnus at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2020-07-17 11:02 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

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

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Slightly simplified one can use a scalar 'c' instead of an array. One gets
(-fdump-tree-gimple):

  #pragma omp parallel reduction(+:x) shared(c)
    {
      integer(kind=8) D.3933;
      integer(kind=8) D.3934;

      #pragma omp for nowait private(i)
      for (i = 1; i <= 8; i = i + 1)
          {
            D.3933 = (integer(kind=8)) i;
            D.3934 = D.3933 + -1;
            (*x)[D.3934] = c;

During omp-lowering, one has:
…
D.3924 = S.0 + -1;
D.3940 = x;
(*D.3940)[D.3924] = 0;

The "D.3940 = x;" is processed and the "D.3940" ends up as "tp" argument to
"scan_omp_1_op" which calls then in turn:
  tree repl = remap_decl (t, &ctx->cb)
The latter then calls
  omp_copy_decl
and returns error_mark_node → this gives then the gcc_assert in scan_omp1_op.

By contrast, "S.0" appears in ctx->cb->decl_map and, hence, omp_copy_decl is
not called for it.

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

* [Bug fortran/93553] ICE in scan_omp_1_op, at omp-low.c:3485
       [not found] <bug-93553-4@http.gcc.gnu.org/bugzilla/>
  2020-07-17 11:02 ` [Bug fortran/93553] ICE in scan_omp_1_op, at omp-low.c:3485 burnus at gcc dot gnu.org
@ 2020-07-17 17:05 ` burnus at gcc dot gnu.org
  2020-07-20 18:41 ` burnus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2020-07-17 17:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> ---
The variable ("D.3940") is produced via the following route.

Contrary to variables processed in gimplify.c, which use
  /* When within an OMP context, notice uses of variables.  */
  if (gimplify_omp_ctxp && omp_notice_variable (gimplify_omp_ctxp, decl, true))
    ...
This variable does not get recorded – and, hence, it fails as shown in
the previous comment 6.

#0  create_tmp_var_raw (type=type@entry=0x7ffff78c5d20,
prefix=prefix@entry=0x0) at ../../repos/gcc/gcc/gimple-expr.c:449
#1  0x0000000000f274f6 in create_tmp_var_for (info=info@entry=0x266f870,
type=0x7ffff78c5d20, prefix=prefix@entry=0x0) at
../../repos/gcc/gcc/tree-nested.c:160
#2  0x0000000000f2828d in init_tmp_var (info=info@entry=0x266f870,
exp=exp@entry=0x7ffff78d45a0, gsi=gsi@entry=0x7fffffffd540)
    at ../../repos/gcc/gcc/tree-nested.c:462
#3  0x0000000000f2f1d4 in convert_nonlocal_reference_op
(tp=tp@entry=0x7ffff78cc608, walk_subtrees=walk_subtrees@entry=0x7fffffffd134, 
    data=data@entry=0x7fffffffd540) at ../../repos/gcc/gcc/tree-nested.c:1081
#4  0x000000000114e262 in walk_tree_1 (tp=0x7ffff78cc608,
func=func@entry=0xf2ee90 <convert_nonlocal_reference_op(tree*, int*, void*)>, 
    data=data@entry=0x7fffffffd540, pset=pset@entry=0x0, lh=lh@entry=0x0) at
../../repos/gcc/gcc/tree.c:11960
#5  0x000000000114f942 in walk_tree_1 (tp=tp@entry=0x7ffff7700478,
func=func@entry=0xf2ee90 <convert_nonlocal_reference_op(tree*, int*, void*)>, 
    data=data@entry=0x7fffffffd540, pset=pset@entry=0x0, lh=lh@entry=0x0) at
../../repos/gcc/gcc/tree.c:12296
#6  0x0000000000f2f4fd in convert_nonlocal_reference_op (tp=0x7ffff7700478,
tp@entry=0x7ffff78cd130, walk_subtrees=walk_subtrees@entry=0x7fffffffd354, 
    data=data@entry=0x7fffffffd540) at ../../repos/gcc/gcc/tree-nested.c:1156
#7  0x000000000114e262 in walk_tree_1 (tp=0x7ffff78cd130,
func=func@entry=0xf2ee90 <convert_nonlocal_reference_op(tree*, int*, void*)>, 
    data=data@entry=0x7fffffffd540, pset=pset@entry=0x0, lh=lh@entry=0x0) at
../../repos/gcc/gcc/tree.c:11960
#8  0x0000000000b7981a in walk_gimple_op (stmt=0x7ffff78cd0f0,
callback_op=0xf2ee90 <convert_nonlocal_reference_op(tree*, int*, void*)>,
wi=0x7fffffffd540)
    at ../../repos/gcc/gcc/gimple.h:2492
#9  0x0000000000b79a6d in walk_gimple_stmt (gsi=0x7fffffffd460, 
    callback_stmt=0xf30aa0
<convert_nonlocal_reference_stmt(gimple_stmt_iterator*, bool*,
walk_stmt_info*)>, 
    callback_op=0xf2ee90 <convert_nonlocal_reference_op(tree*, int*, void*)>,
wi=0x7fffffffd540) at ../../repos/gcc/gcc/gimple-walk.c:596
#10 0x0000000000b79c01 in walk_gimple_seq_mod (pseq=<optimized out>, 
    callback_stmt=0xf30aa0
<convert_nonlocal_reference_stmt(gimple_stmt_iterator*, bool*,
walk_stmt_info*)>, 
    callback_op=0xf2ee90 <convert_nonlocal_reference_op(tree*, int*, void*)>,
wi=0x7fffffffd540) at ../../repos/gcc/gcc/gimple-walk.c:51
#11 0x0000000000b79af2 in walk_gimple_stmt (gsi=0x7fffffffd4e0, 
    callback_stmt=0xf30aa0
<convert_nonlocal_reference_stmt(gimple_stmt_iterator*, bool*,
walk_stmt_info*)>, 
    callback_op=0xf2ee90 <convert_nonlocal_reference_op(tree*, int*, void*)>,
wi=0x7fffffffd540) at ../../repos/gcc/gcc/gimple.h:4382
#12 0x0000000000b79c01 in walk_gimple_seq_mod (pseq=pseq@entry=0x7ffff78cb028, 
    callback_stmt=callback_stmt@entry=0xf30aa0
<convert_nonlocal_reference_stmt(gimple_stmt_iterator*, bool*,
walk_stmt_info*)>, 
    callback_op=callback_op@entry=0xf2ee90
<convert_nonlocal_reference_op(tree*, int*, void*)>,
wi=wi@entry=0x7fffffffd540) at ../../repos/gcc/gcc/gimple-walk.c:51
#13 0x0000000000f28868 in walk_body (callback_stmt=callback_stmt@entry=0xf30aa0
<convert_nonlocal_reference_stmt(gimple_stmt_iterator*, bool*,
walk_stmt_info*)>, 
    callback_op=callback_op@entry=0xf2ee90
<convert_nonlocal_reference_op(tree*, int*, void*)>, info=info@entry=0x266f870,
pseq=0x7ffff78cb028)
    at ../../repos/gcc/gcc/tree-nested.c:712
#14 0x0000000000f30490 in convert_nonlocal_omp_clauses
(pclauses=0x7ffff76fe6a8, wi=wi@entry=0x7fffffffd7d0) at
../../repos/gcc/gcc/tree-nested.c:1424

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

* [Bug fortran/93553] ICE in scan_omp_1_op, at omp-low.c:3485
       [not found] <bug-93553-4@http.gcc.gnu.org/bugzilla/>
  2020-07-17 11:02 ` [Bug fortran/93553] ICE in scan_omp_1_op, at omp-low.c:3485 burnus at gcc dot gnu.org
  2020-07-17 17:05 ` burnus at gcc dot gnu.org
@ 2020-07-20 18:41 ` burnus at gcc dot gnu.org
  2020-08-08  9:12 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2020-07-20 18:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Patch: https://gcc.gnu.org/pipermail/gcc-patches/2020-July/550317.html

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

* [Bug fortran/93553] ICE in scan_omp_1_op, at omp-low.c:3485
       [not found] <bug-93553-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-07-20 18:41 ` burnus at gcc dot gnu.org
@ 2020-08-08  9:12 ` cvs-commit at gcc dot gnu.org
  2020-08-25 17:45 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-08  9:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 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:676b5525e8333005bdc1c596ed086f1da27a450f

commit r11-2615-g676b5525e8333005bdc1c596ed086f1da27a450f
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Aug 8 11:10:30 2020 +0200

    openmp: Handle clauses with gimple sequences in
convert_nonlocal_omp_clauses properly

    If the walk_body on the various sequences of reduction, lastprivate and/or
linear
    clauses needs to create a temporary variable, we should declare that
variable
    in that sequence rather than outside, where it would need to be privatized
inside of
    the construct.

    2020-08-08  Jakub Jelinek  <jakub@redhat.com>

            PR fortran/93553
            * tree-nested.c (convert_nonlocal_omp_clauses): For
            OMP_CLAUSE_REDUCTION, OMP_CLAUSE_LASTPRIVATE and OMP_CLAUSE_LINEAR
            save info->new_local_var_chain around walks of the clause gimple
            sequences and declare_vars if needed into the sequence.

    2020-08-08  Tobias Burnus  <tobias@codesourcery.com>

            PR fortran/93553
            * testsuite/libgomp.fortran/pr93553.f90: New test.

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

* [Bug fortran/93553] ICE in scan_omp_1_op, at omp-low.c:3485
       [not found] <bug-93553-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2020-08-08  9:12 ` cvs-commit at gcc dot gnu.org
@ 2020-08-25 17:45 ` cvs-commit at gcc dot gnu.org
  2020-09-16 19:22 ` cvs-commit at gcc dot gnu.org
  2020-09-17 17:14 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-25 17:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 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:cbde60ab63e7b94a664fb8fef8640d0d6a63b13c

commit r10-8663-gcbde60ab63e7b94a664fb8fef8640d0d6a63b13c
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Aug 8 11:10:30 2020 +0200

    openmp: Handle clauses with gimple sequences in
convert_nonlocal_omp_clauses properly

    If the walk_body on the various sequences of reduction, lastprivate and/or
linear
    clauses needs to create a temporary variable, we should declare that
variable
    in that sequence rather than outside, where it would need to be privatized
inside of
    the construct.

    2020-08-08  Jakub Jelinek  <jakub@redhat.com>

            PR fortran/93553
            * tree-nested.c (convert_nonlocal_omp_clauses): For
            OMP_CLAUSE_REDUCTION, OMP_CLAUSE_LASTPRIVATE and OMP_CLAUSE_LINEAR
            save info->new_local_var_chain around walks of the clause gimple
            sequences and declare_vars if needed into the sequence.

    2020-08-08  Tobias Burnus  <tobias@codesourcery.com>

            PR fortran/93553
            * testsuite/libgomp.fortran/pr93553.f90: New test.

    (cherry picked from commit 676b5525e8333005bdc1c596ed086f1da27a450f)

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

* [Bug fortran/93553] ICE in scan_omp_1_op, at omp-low.c:3485
       [not found] <bug-93553-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2020-08-25 17:45 ` cvs-commit at gcc dot gnu.org
@ 2020-09-16 19:22 ` cvs-commit at gcc dot gnu.org
  2020-09-17 17:14 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-16 19:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r9-8907-gcdc1ed0ceaf7e520164c262358ea6bfe89ff027c
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Aug 8 11:10:30 2020 +0200

    openmp: Handle clauses with gimple sequences in
convert_nonlocal_omp_clauses properly

    If the walk_body on the various sequences of reduction, lastprivate and/or
linear
    clauses needs to create a temporary variable, we should declare that
variable
    in that sequence rather than outside, where it would need to be privatized
inside of
    the construct.

    2020-08-08  Jakub Jelinek  <jakub@redhat.com>

            PR fortran/93553
            * tree-nested.c (convert_nonlocal_omp_clauses): For
            OMP_CLAUSE_REDUCTION, OMP_CLAUSE_LASTPRIVATE and OMP_CLAUSE_LINEAR
            save info->new_local_var_chain around walks of the clause gimple
            sequences and declare_vars if needed into the sequence.

    2020-08-08  Tobias Burnus  <tobias@codesourcery.com>

            PR fortran/93553
            * testsuite/libgomp.fortran/pr93553.f90: New test.

    (cherry picked from commit 676b5525e8333005bdc1c596ed086f1da27a450f)

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

* [Bug fortran/93553] ICE in scan_omp_1_op, at omp-low.c:3485
       [not found] <bug-93553-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2020-09-16 19:22 ` cvs-commit at gcc dot gnu.org
@ 2020-09-17 17:14 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-09-17 17:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 8.5 in r8-10510-g6b326d90d2195f00eb37dbf1be963ee3880af3b9 , and by
above commits for 9.4+, 10.3+ and 11.1+.

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

end of thread, other threads:[~2020-09-17 17:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-93553-4@http.gcc.gnu.org/bugzilla/>
2020-07-17 11:02 ` [Bug fortran/93553] ICE in scan_omp_1_op, at omp-low.c:3485 burnus at gcc dot gnu.org
2020-07-17 17:05 ` burnus at gcc dot gnu.org
2020-07-20 18:41 ` burnus at gcc dot gnu.org
2020-08-08  9:12 ` cvs-commit at gcc dot gnu.org
2020-08-25 17:45 ` cvs-commit at gcc dot gnu.org
2020-09-16 19:22 ` cvs-commit at gcc dot gnu.org
2020-09-17 17: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).