public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/114509] New: Infinite loop with openmp
@ 2024-03-28  6:39 gccbugs at dima dot secretsauce.net
  2024-03-28  7:03 ` [Bug middle-end/114509] [11/12/13/14 Regression] an infinite loop with openmp after errors in some cases pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gccbugs at dima dot secretsauce.net @ 2024-03-28  6:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114509
           Summary: Infinite loop with openmp
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gccbugs at dima dot secretsauce.net
  Target Milestone: ---

Created attachment 57827
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57827&action=edit
Reduced reproducer

I git a bug in gcc 13.2 where an openmp loop causes he compiler to spin the
cpu, and never finish. I used creduce to minimize the test case, and the
reduced source is attached.

I'm running Debian GNU/Linux with gcc=4:13.2.0-1. I get an infinite loop with

  gcc-13 -fopenmp -c -o /dev/null /tmp/infinite-openmp.c

I happen to also have gcc-10 and gcc-11 installed, and they both produce an
infinite loop with that input as well.

Thanks

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

* [Bug middle-end/114509] [11/12/13/14 Regression] an infinite loop with openmp after errors in some cases
  2024-03-28  6:39 [Bug c/114509] New: Infinite loop with openmp gccbugs at dima dot secretsauce.net
@ 2024-03-28  7:03 ` pinskia at gcc dot gnu.org
  2024-03-29 23:48 ` [Bug middle-end/114509] [11/12/13/14 Regression] an infinite loop or ICE " law at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28  7:03 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-03-28
           Keywords|                            |openmp
            Summary|Infinite loop with openmp   |[11/12/13/14 Regression] an
                   |                            |infinite loop with openmp
                   |                            |after errors in some cases
   Target Milestone|---                         |11.5
             Status|UNCONFIRMED                 |NEW
      Known to fail|                            |7.5.0, 9.1.0
          Component|c                           |middle-end
      Known to work|                            |7.2.0, 7.4.0

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
With checking enabled we get:
```
during GIMPLE pass: omplower
t5665.c:11:9: internal compiler error: tree check: expected tree that contains
‘decl minimal’ structure, have ‘error_mark’ in remap_type_1, at
tree-inline.cc:563
   11 | #pragma omp parallel for
      |         ^~~
0x880d2a tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
        ../../gcc/tree.cc:9129
0x829211 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        ../../gcc/tree.h:3766
0x829211 remap_type_1
        ../../gcc/tree-inline.cc:563
0x10e3c92 remap_type(tree_node*, copy_body_data*)
        ../../gcc/tree-inline.cc:713
0x10e38ba remap_type_1
        ../../gcc/tree-inline.cc:425
0x10e3c92 remap_type(tree_node*, copy_body_data*)
        ../../gcc/tree-inline.cc:713
0xec7178 fixup_remapped_decl
        ../../gcc/omp-low.cc:905
0xecb9f2 scan_sharing_clauses
        ../../gcc/omp-low.cc:1833
0xecfccb scan_omp_parallel
        ../../gcc/omp-low.cc:2345
0xecfccb scan_omp_1_stmt
        ../../gcc/omp-low.cc:4148
0xd138ea walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
        ../../gcc/gimple-walk.cc:618
0xd13ac5 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
        ../../gcc/gimple-walk.cc:51
0xd139e1 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
        ../../gcc/gimple-walk.cc:681
0xd13ac5 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
        ../../gcc/gimple-walk.cc:51
0xd139a1 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
        ../../gcc/gimple-walk.cc:735
0xd13ac5 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
        ../../gcc/gimple-walk.cc:51
0xedc43a scan_omp
        ../../gcc/omp-low.cc:4284
0xedc43a execute_lower_omp
        ../../gcc/omp-low.cc:14619
0xedc43a execute
        ../../gcc/omp-low.cc:14683
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
```

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

* [Bug middle-end/114509] [11/12/13/14 Regression] an infinite loop or ICE with openmp after errors in some cases
  2024-03-28  6:39 [Bug c/114509] New: Infinite loop with openmp gccbugs at dima dot secretsauce.net
  2024-03-28  7:03 ` [Bug middle-end/114509] [11/12/13/14 Regression] an infinite loop with openmp after errors in some cases pinskia at gcc dot gnu.org
@ 2024-03-29 23:48 ` law at gcc dot gnu.org
  2024-04-02  8:01 ` rguenth at gcc dot gnu.org
  2024-04-17 14:42 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-29 23:48 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
                 CC|                            |law at gcc dot gnu.org

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

* [Bug middle-end/114509] [11/12/13/14 Regression] an infinite loop or ICE with openmp after errors in some cases
  2024-03-28  6:39 [Bug c/114509] New: Infinite loop with openmp gccbugs at dima dot secretsauce.net
  2024-03-28  7:03 ` [Bug middle-end/114509] [11/12/13/14 Regression] an infinite loop with openmp after errors in some cases pinskia at gcc dot gnu.org
  2024-03-29 23:48 ` [Bug middle-end/114509] [11/12/13/14 Regression] an infinite loop or ICE " law at gcc dot gnu.org
@ 2024-04-02  8:01 ` rguenth at gcc dot gnu.org
  2024-04-17 14:42 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-02  8:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2

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

* [Bug middle-end/114509] [11/12/13/14 Regression] an infinite loop or ICE with openmp after errors in some cases
  2024-03-28  6:39 [Bug c/114509] New: Infinite loop with openmp gccbugs at dima dot secretsauce.net
                   ` (2 preceding siblings ...)
  2024-04-02  8:01 ` rguenth at gcc dot gnu.org
@ 2024-04-17 14:42 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-04-17 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Reduced testcase:
void bar (void *);

void
foo (int x)
{
  struct S { int a[x]; int b; } s;
#pragma omp parallel for
  for (int i = 0; i < 10; i++)
    bar (&s);
}

We don't really support variable length structures/unions in OpenMP/OpenACC
lowering/expansion, and I don't see why we should spend time on that, variable
length structures/unions just shouldn't be used in C (they are already invalid
in C++ and not present in Fortran either), I think that extension exists just
because Ada needs to support that.  Though Ada on the other side doesn't
support OpenMP/OpenACC.
So, I think we should just sorry if something attempts to privatize/map
variable length structure/union; making it shared should be fine.

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

end of thread, other threads:[~2024-04-17 14:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28  6:39 [Bug c/114509] New: Infinite loop with openmp gccbugs at dima dot secretsauce.net
2024-03-28  7:03 ` [Bug middle-end/114509] [11/12/13/14 Regression] an infinite loop with openmp after errors in some cases pinskia at gcc dot gnu.org
2024-03-29 23:48 ` [Bug middle-end/114509] [11/12/13/14 Regression] an infinite loop or ICE " law at gcc dot gnu.org
2024-04-02  8:01 ` rguenth at gcc dot gnu.org
2024-04-17 14:42 ` 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).