public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/100661] New: [11/12 Regression] ICE in refs_may_alias_p_2, at tree-ssa-alias.c:2460
@ 2021-05-18 17:48 gscfq@t-online.de
  2021-05-19  8:01 ` [Bug c/100661] [11/12 Regression] ICE in omp-low.c / " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: gscfq@t-online.de @ 2021-05-18 17:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100661
           Summary: [11/12 Regression] ICE in refs_may_alias_p_2, at
                    tree-ssa-alias.c:2460
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Changed between 20201018 and 20201108 :


$ cat z1.c
void f (char **x)
{
  #pragma omp parallel for
  for (int i = 0; i < 16; i++)
    {
      char c[50];
      __builtin_strcpy (c, x[i]);
      int g (char)
      {
        __builtin_strcat (c, "foo");
      }
    }
}


$ gcc-11-20201018 -c z1.c -O2 -fopenmp
z1.c: In function 'g':
z1.c:8:14: error: parameter name omitted
    8 |       int g (char)
      |              ^~~~


$ gcc-12-20210516 -c z1.c -O2 -fopenmp
during GIMPLE pass: fre
z1.c: In function 'f._omp_fn.0':
z1.c:13:1: internal compiler error: in refs_may_alias_p_2, at
tree-ssa-alias.c:2460
   13 | }
      | ^
0xc40fa0 refs_may_alias_p_2
        ../../gcc/tree-ssa-alias.c:2460
0xc40fa0 refs_may_alias_p_1(ao_ref*, ao_ref*, bool)
        ../../gcc/tree-ssa-alias.c:2469
0xc4196d check_fnspec
        ../../gcc/tree-ssa-alias.c:2677
0xc41c30 call_may_clobber_ref_p_1(gcall*, ao_ref*, bool)
        ../../gcc/tree-ssa-alias.c:3051
0xc4293e stmt_may_clobber_ref_p_1(gimple*, ao_ref*, bool)
        ../../gcc/tree-ssa-alias.c:3127
0xc42b66 maybe_skip_until
        ../../gcc/tree-ssa-alias.c:3524
0xc42b66 get_continuation_for_phi(gimple*, ao_ref*, bool, unsigned int&,
bitmap_head**, bool, void* (*)(ao_ref*, tree_node*, void*, translate_flags*),
void*, translate_flags)
        ../../gcc/tree-ssa-alias.c:3601
0xc42f18 walk_non_aliased_vuses(ao_ref*, tree_node*, bool, void* (*)(ao_ref*,
tree_node*, void*), void* (*)(ao_ref*, tree_node*, void*, translate_flags*),
tree_node* (*)(tree_node*), unsigned int&, void*)
        ../../gcc/tree-ssa-alias.c:3690
0xcf4b96 vn_reference_lookup(tree_node*, tree_node*, vn_lookup_kind,
vn_reference_s**, bool, tree_node**, tree_node*)
        ../../gcc/tree-ssa-sccvn.c:3614
0xcfabc4 visit_reference_op_load
        ../../gcc/tree-ssa-sccvn.c:5063
0xcfabc4 visit_stmt
        ../../gcc/tree-ssa-sccvn.c:5503
0xcfb67b process_bb
        ../../gcc/tree-ssa-sccvn.c:7203
0xcfd0b8 do_rpo_vn
        ../../gcc/tree-ssa-sccvn.c:7688
0xcfda5f execute
        ../../gcc/tree-ssa-sccvn.c:7956

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

* [Bug c/100661] [11/12 Regression] ICE in omp-low.c / refs_may_alias_p_2, at tree-ssa-alias.c:2460
  2021-05-18 17:48 [Bug c/100661] New: [11/12 Regression] ICE in refs_may_alias_p_2, at tree-ssa-alias.c:2460 gscfq@t-online.de
@ 2021-05-19  8:01 ` rguenth at gcc dot gnu.org
  2021-05-19 12:15 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-05-19  8:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |openmp
   Target Milestone|---                         |11.2
            Summary|[11/12 Regression] ICE in   |[11/12 Regression] ICE in
                   |refs_may_alias_p_2, at      |omp-low.c /
                   |tree-ssa-alias.c:2460       |refs_may_alias_p_2, at
                   |                            |tree-ssa-alias.c:2460
   Last reconfirmed|                            |2021-05-19
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I get with checking:

#0  fancy_abort (file=0x272ccf0 "/home/rguenther/src/gcc3/gcc/omp-low.c", 
    line=3728, 
    function=0x2730890 <scan_omp_1_op(tree_node**, int*, void*)::__FUNCTION__>
"scan_omp_1_op") at /home/rguenther/src/gcc3/gcc/diagnostic.c:1884
#1  0x0000000001131956 in scan_omp_1_op (tp=0x7ffff66da378, 
    walk_subtrees=0x7fffffffcdf4, data=0x7fffffffd240)
    at /home/rguenther/src/gcc3/gcc/omp-low.c:3728
#2  0x0000000001762779 in walk_tree_1 (tp=0x7ffff66da378, 
    func=0x11318a9 <scan_omp_1_op(tree*, int*, void*)>, data=0x7fffffffd240, 
    pset=0x0, lh=0x0) at /home/rguenther/src/gcc3/gcc/tree.c:10966
#3  0x0000000001763f16 in walk_tree_1 (tp=0x7ffff66a4bd8, 
    func=0x11318a9 <scan_omp_1_op(tree*, int*, void*)>, data=0x7fffffffd240, 
    pset=0x0, lh=0x0) at /home/rguenther/src/gcc3/gcc/tree.c:11314
#4  0x0000000000f0a876 in walk_gimple_op (stmt=<gimple_call 0x7ffff7ff5ea0>, 
    callback_op=0x11318a9 <scan_omp_1_op(tree*, int*, void*)>, 
    wi=0x7fffffffd240) at /home/rguenther/src/gcc3/gcc/gimple-walk.c:253
#5  0x0000000000f0b7d3 in walk_gimple_stmt (gsi=0x7fffffffd060, 
    callback_stmt=0x1131e42 <scan_omp_1_stmt(gimple_stmt_iterator*, bool*,
walk_stmt_info*)>, callback_op=0x11318a9 <scan_omp_1_op(tree*, int*, void*)>, 
    wi=0x7fffffffd240) at /home/rguenther/src/gcc3/gcc/gimple-walk.c:596
#6  0x0000000000f09eb5 in walk_gimple_seq_mod (pseq=0x7ffff6577418, 
    callback_stmt=0x1131e42 <scan_omp_1_stmt(gimple_stmt_iterator*, bool*,
walk_

in omplower

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

* [Bug c/100661] [11/12 Regression] ICE in omp-low.c / refs_may_alias_p_2, at tree-ssa-alias.c:2460
  2021-05-18 17:48 [Bug c/100661] New: [11/12 Regression] ICE in refs_may_alias_p_2, at tree-ssa-alias.c:2460 gscfq@t-online.de
  2021-05-19  8:01 ` [Bug c/100661] [11/12 Regression] ICE in omp-low.c / " rguenth at gcc dot gnu.org
@ 2021-05-19 12:15 ` marxin at gcc dot gnu.org
  2021-05-20 16:33 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-05-19 12:15 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
It seems it started with r6-6362-gb2b40051500c944e.

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

* [Bug c/100661] [11/12 Regression] ICE in omp-low.c / refs_may_alias_p_2, at tree-ssa-alias.c:2460
  2021-05-18 17:48 [Bug c/100661] New: [11/12 Regression] ICE in refs_may_alias_p_2, at tree-ssa-alias.c:2460 gscfq@t-online.de
  2021-05-19  8:01 ` [Bug c/100661] [11/12 Regression] ICE in omp-low.c / " rguenth at gcc dot gnu.org
  2021-05-19 12:15 ` marxin at gcc dot gnu.org
@ 2021-05-20 16:33 ` jakub at gcc dot gnu.org
  2021-07-28  7:07 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-05-20 16:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Slightly better testcase:
void
foo (char **x)
{
  #pragma omp parallel for
  for (int i = 0; i < 16; i++)
    {
      char c[50];
      __builtin_strcpy (c, x[i]);
      void bar (void)
      {
        __builtin_strcat (c, "foo");
      }
    }
}

This ICEs all the way back to GCC 4.2/4.3.  And I'm not sure what can be done
about it.  Nested functions are implemented by adding all the variables that
can be accessed from nested functions into a single large frame structure whose
address is passed in the chain argument to the nested function.
But, in the above case, the c array is such a variable, but each thread is
supposed to have a private copy of that variable.

For C, this is a GNU extension and we can do whatever we want, including sorry.
For Fortran, nested functions can be only defined outside of BLOCK and when one
explicitly privatizes some variable, access to them from the nested functions
could be considered UB (like would be e.g. if in C/C++ one privatizes a
variable, but passes (shared or firstprivate or in some global variable)
address of the variable before being privatized and accesses that var through
the pointer).

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

* [Bug c/100661] [11/12 Regression] ICE in omp-low.c / refs_may_alias_p_2, at tree-ssa-alias.c:2460
  2021-05-18 17:48 [Bug c/100661] New: [11/12 Regression] ICE in refs_may_alias_p_2, at tree-ssa-alias.c:2460 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-05-20 16:33 ` jakub at gcc dot gnu.org
@ 2021-07-28  7:07 ` rguenth at gcc dot gnu.org
  2022-01-20 13:41 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-28  7:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.2                        |11.3

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 11.2 is being released, retargeting bugs to GCC 11.3

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

* [Bug c/100661] [11/12 Regression] ICE in omp-low.c / refs_may_alias_p_2, at tree-ssa-alias.c:2460
  2021-05-18 17:48 [Bug c/100661] New: [11/12 Regression] ICE in refs_may_alias_p_2, at tree-ssa-alias.c:2460 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-07-28  7:07 ` rguenth at gcc dot gnu.org
@ 2022-01-20 13:41 ` rguenth at gcc dot gnu.org
  2022-01-20 13:43 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-20 13:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Can lambdas appear inside #pragma omp in C++?  The following is accepted but
each thread seems to get the global 'c', but at least we don't ICE (possibly
because frame lowering is done in the FE).

void
foo (char **x)
{
  #pragma omp parallel for
  for (int i = 0; i < 16; i++)
    {
      char c[50];
      __builtin_strcpy (c, x[i]);
      auto x = [&] () { __builtin_strcat (c, "foo"); };
      x();
    }
}

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

* [Bug c/100661] [11/12 Regression] ICE in omp-low.c / refs_may_alias_p_2, at tree-ssa-alias.c:2460
  2021-05-18 17:48 [Bug c/100661] New: [11/12 Regression] ICE in refs_may_alias_p_2, at tree-ssa-alias.c:2460 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2022-01-20 13:41 ` rguenth at gcc dot gnu.org
@ 2022-01-20 13:43 ` rguenth at gcc dot gnu.org
  2022-01-20 13:48 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-20 13:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ah, no, for the C++ example c[50] is local to _Z3fooPPc._omp_fn.0 and thus
likely fine.

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

* [Bug c/100661] [11/12 Regression] ICE in omp-low.c / refs_may_alias_p_2, at tree-ssa-alias.c:2460
  2021-05-18 17:48 [Bug c/100661] New: [11/12 Regression] ICE in refs_may_alias_p_2, at tree-ssa-alias.c:2460 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2022-01-20 13:43 ` rguenth at gcc dot gnu.org
@ 2022-01-20 13:48 ` jakub at gcc dot gnu.org
  2022-03-23  8:36 ` [Bug c/100661] ICE in omp-low.c / refs_may_alias_p_2, at tree-ssa-alias.c:2460 with nested function in OMP region rguenth at gcc dot gnu.org
  2024-04-02  5:47 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-20 13:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #5)
> Can lambdas appear inside #pragma omp in C++?

Since OpenMP 5.0 yes.  Well, they could appear before as well, but OpenMP 4.5
didn't support C++11, so it wasn't really defined how it behaves.
But I think lambdas are fine.

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

* [Bug c/100661] ICE in omp-low.c / refs_may_alias_p_2, at tree-ssa-alias.c:2460 with nested function in OMP region
  2021-05-18 17:48 [Bug c/100661] New: [11/12 Regression] ICE in refs_may_alias_p_2, at tree-ssa-alias.c:2460 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2022-01-20 13:48 ` jakub at gcc dot gnu.org
@ 2022-03-23  8:36 ` rguenth at gcc dot gnu.org
  2024-04-02  5:47 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-03-23  8:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11/12 Regression] ICE in   |ICE in omp-low.c /
                   |omp-low.c /                 |refs_may_alias_p_2, at
                   |refs_may_alias_p_2, at      |tree-ssa-alias.c:2460 with
                   |tree-ssa-alias.c:2460       |nested function in OMP
                   |                            |region
           Keywords|                            |accepts-invalid
   Target Milestone|11.3                        |---

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
I wonder if it's possible to reject nested functions in OMP regions in the
frontend?  Not really a regression as comment#3 explains.  I'd declare it
accepts-invalid.

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

* [Bug c/100661] ICE in omp-low.c / refs_may_alias_p_2, at tree-ssa-alias.c:2460 with nested function in OMP region
  2021-05-18 17:48 [Bug c/100661] New: [11/12 Regression] ICE in refs_may_alias_p_2, at tree-ssa-alias.c:2460 gscfq@t-online.de
                   ` (7 preceding siblings ...)
  2022-03-23  8:36 ` [Bug c/100661] ICE in omp-low.c / refs_may_alias_p_2, at tree-ssa-alias.c:2460 with nested function in OMP region rguenth at gcc dot gnu.org
@ 2024-04-02  5:47 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-02  5:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup.

*** This bug has been marked as a duplicate of bug 85000 ***

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

end of thread, other threads:[~2024-04-02  5:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 17:48 [Bug c/100661] New: [11/12 Regression] ICE in refs_may_alias_p_2, at tree-ssa-alias.c:2460 gscfq@t-online.de
2021-05-19  8:01 ` [Bug c/100661] [11/12 Regression] ICE in omp-low.c / " rguenth at gcc dot gnu.org
2021-05-19 12:15 ` marxin at gcc dot gnu.org
2021-05-20 16:33 ` jakub at gcc dot gnu.org
2021-07-28  7:07 ` rguenth at gcc dot gnu.org
2022-01-20 13:41 ` rguenth at gcc dot gnu.org
2022-01-20 13:43 ` rguenth at gcc dot gnu.org
2022-01-20 13:48 ` jakub at gcc dot gnu.org
2022-03-23  8:36 ` [Bug c/100661] ICE in omp-low.c / refs_may_alias_p_2, at tree-ssa-alias.c:2460 with nested function in OMP region rguenth at gcc dot gnu.org
2024-04-02  5:47 ` pinskia 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).