public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/102310] New: ICE in visit_ref_for_mod_analysis with OpenACC
@ 2021-09-13 17:06 ygribov at gcc dot gnu.org
  2021-09-14  6:54 ` [Bug ipa/102310] [11/12 Regression] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ygribov at gcc dot gnu.org @ 2021-09-13 17:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102310
           Summary: ICE in visit_ref_for_mod_analysis with OpenACC
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ygribov at gcc dot gnu.org
  Target Milestone: ---

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

Attached code crashes with
kernel.f90:30:11: internal compiler error: in visit_ref_for_mod_analysis, at
ipa-prop.c:2846
   30 | END PROGRAM
      |           ^
0xa2ea60 visit_ref_for_mod_analysis
        /home/y.gribov/src/gcc-11/gcc/ipa-prop.c:2846
0xa2ea60 visit_ref_for_mod_analysis
        /home/y.gribov/src/gcc-11/gcc/ipa-prop.c:2837
0x992861 walk_stmt_load_store_addr_ops(gimple*, void*, bool (*)(gimple*,
tree_node*, tree_node*, void*), bool (*)(gimple*, tree_node*, tree_node*,
void*), bool (*)(gimple*, tree_node*, tree_node*, void*))
        /home/y.gribov/src/gcc-11/gcc/gimple-walk.c:806
0xa3c1a2 ipa_analyze_params_uses_in_bb
        /home/y.gribov/src/gcc-11/gcc/ipa-prop.c:2870
0xa3c1a2 analysis_dom_walker::before_dom_children(basic_block_def*)
        /home/y.gribov/src/gcc-11/gcc/ipa-prop.c:2953
0x14eb815 dom_walker::walk(basic_block_def*)
        /home/y.gribov/src/gcc-11/gcc/domwalk.c:309
0xa3786d ipa_analyze_node(cgraph_node*)
        /home/y.gribov/src/gcc-11/gcc/ipa-prop.c:3024
0x156d357 ipcp_generate_summary
        /home/y.gribov/src/gcc-11/gcc/ipa-cp.c:6001
0xb45f6c execute_ipa_summary_passes(ipa_opt_pass_d*)
        /home/y.gribov/src/gcc-11/gcc/passes.c:2248
0x83b68b ipa_passes
        /home/y.gribov/src/gcc-11/gcc/cgraphunit.c:2181
0x83b68b symbol_table::compile()
        /home/y.gribov/src/gcc-11/gcc/cgraphunit.c:2291
0x83d91b symbol_table::compile()
        /home/y.gribov/src/gcc-11/gcc/cgraphunit.c:2271
0x83d91b symbol_table::finalize_compilation_unit()
        /home/y.gribov/src/gcc-11/gcc/cgraphunit.c:2539

when compiled with OpenACC-accelerated toolchain targeting GCN. It crashes on
master and releases/gcc-11 branches.

Compile flags:
  gfortran -ffree-form -ffree-line-length-none -O2 -fopenacc kernel.f90

Target compiler has been built with
  configure --target=amdgcn-amdhsa --enable-languages=c,lto,fortran
--disable-sjlj-exceptions --with-newlib
--enable-as-accelerator-for=x86_64-pc-linux-gnu
--with-build-time-tools=/home/y.gribov/install/amdgcn-amdhsa-9.0/bin
--disable-libquadmath

Host compiler has been build with
  configure --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu
--enable-offload-targets=amdgcn-amdhsa=/home/y.gribov/install/gcc-master/usr/local
--disable-bootstrap --disable-multilib

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

* [Bug ipa/102310] [11/12 Regression] ICE in visit_ref_for_mod_analysis with OpenACC
  2021-09-13 17:06 [Bug middle-end/102310] New: ICE in visit_ref_for_mod_analysis with OpenACC ygribov at gcc dot gnu.org
@ 2021-09-14  6:54 ` rguenth at gcc dot gnu.org
  2021-09-14  7:19 ` marxin at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-09-14  6:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |ipa
   Target Milestone|---                         |11.3
                 CC|                            |hubicka at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
           Keywords|                            |ice-on-valid-code
            Summary|ICE in                      |[11/12 Regression] ICE in
                   |visit_ref_for_mod_analysis  |visit_ref_for_mod_analysis
                   |with OpenACC                |with OpenACC
           Priority|P3                          |P2

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Honza, can you check please?

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

* [Bug ipa/102310] [11/12 Regression] ICE in visit_ref_for_mod_analysis with OpenACC
  2021-09-13 17:06 [Bug middle-end/102310] New: ICE in visit_ref_for_mod_analysis with OpenACC ygribov at gcc dot gnu.org
  2021-09-14  6:54 ` [Bug ipa/102310] [11/12 Regression] " rguenth at gcc dot gnu.org
@ 2021-09-14  7:19 ` marxin at gcc dot gnu.org
  2021-09-14  7:35 ` tschwinge at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-09-14  7:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-09-14
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |julian at codesourcery dot com

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed. Well, I'm not sure it's about IPA modref, the test-case fails even
w/o any optimization level:

$ gcc pr102310.f90 -c -fopenacc
during RTL pass: expand
pr102310.f90:22:41:

   22 |                 K = IDX(I) + ABC * BB%Y%X
      |                                         ^
internal compiler error: in expand_expr_real_1, at expr.c:10599
0x6be64a expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /home/marxin/Programming/gcc/gcc/expr.c:10599
0xbd7ac6 store_expr(tree_node*, rtx_def*, int, bool, bool)
        /home/marxin/Programming/gcc/gcc/expr.c:6103
0xbd933d expand_assignment(tree_node*, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/expr.c:5835
0xa9a75a expand_gimple_stmt_1
        /home/marxin/Programming/gcc/gcc/cfgexpand.c:3942
0xa9a75a expand_gimple_stmt
        /home/marxin/Programming/gcc/gcc/cfgexpand.c:4040
0xaa1070 expand_gimple_basic_block
        /home/marxin/Programming/gcc/gcc/cfgexpand.c:6082
0xaa2fb7 execute
        /home/marxin/Programming/gcc/gcc/cfgexpand.c:6808
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Is it really a valid test-case? Happens since r10-5597-g549188ea10757060.

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

* [Bug ipa/102310] [11/12 Regression] ICE in visit_ref_for_mod_analysis with OpenACC
  2021-09-13 17:06 [Bug middle-end/102310] New: ICE in visit_ref_for_mod_analysis with OpenACC ygribov at gcc dot gnu.org
  2021-09-14  6:54 ` [Bug ipa/102310] [11/12 Regression] " rguenth at gcc dot gnu.org
  2021-09-14  7:19 ` marxin at gcc dot gnu.org
@ 2021-09-14  7:35 ` tschwinge at gcc dot gnu.org
  2021-09-14  8:48 ` tetra2005 at gmail dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2021-09-14  7:35 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |openacc
                 CC|                            |jules at gcc dot gnu.org
             Target|gcn                         |

--- Comment #3 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
Both ICEs confirmed.  Does need '-fopenacc' to reproduce, but doesn't need an
actual GCC offloading configuration; ICEs in host compilation.


Julian, please have a look at the test case: should GCC be able to handle that
one fine, or is "something" missing in GCC/OpenACC; ICE of course is not the
correct answer in any case.  ;-)

Also, note that the "w/o any optimization level" ICE looks like what I recently
also ran into (still un-fixed), when working on reference data type things --
which I suppose is relevant here, as these are Fortran dummy arguments to a
'SUBROUTINE'.

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

* [Bug ipa/102310] [11/12 Regression] ICE in visit_ref_for_mod_analysis with OpenACC
  2021-09-13 17:06 [Bug middle-end/102310] New: ICE in visit_ref_for_mod_analysis with OpenACC ygribov at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-09-14  7:35 ` tschwinge at gcc dot gnu.org
@ 2021-09-14  8:48 ` tetra2005 at gmail dot com
  2021-10-07 15:54 ` hubicka at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tetra2005 at gmail dot com @ 2021-09-14  8:48 UTC (permalink / raw)
  To: gcc-bugs

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

Yuri Gribov <tetra2005 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tetra2005 at gmail dot com

--- Comment #4 from Yuri Gribov <tetra2005 at gmail dot com> ---
Thanks a lot for the support.  A related question: which branch should I use
when working on OpenACC code: master, releases/gcc-11 or devel/omp/gcc-11?

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

* [Bug ipa/102310] [11/12 Regression] ICE in visit_ref_for_mod_analysis with OpenACC
  2021-09-13 17:06 [Bug middle-end/102310] New: ICE in visit_ref_for_mod_analysis with OpenACC ygribov at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-09-14  8:48 ` tetra2005 at gmail dot com
@ 2021-10-07 15:54 ` hubicka at gcc dot gnu.org
  2021-10-08  9:07 ` jamborm at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-10-07 15:54 UTC (permalink / raw)
  To: gcc-bugs

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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mjambor at suse dot cz

--- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Adding Martin Jambor to CC since it is ipa-prop ICE.

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

* [Bug ipa/102310] [11/12 Regression] ICE in visit_ref_for_mod_analysis with OpenACC
  2021-09-13 17:06 [Bug middle-end/102310] New: ICE in visit_ref_for_mod_analysis with OpenACC ygribov at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-10-07 15:54 ` hubicka at gcc dot gnu.org
@ 2021-10-08  9:07 ` jamborm at gcc dot gnu.org
  2022-04-21  7:50 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jamborm at gcc dot gnu.org @ 2021-10-08  9:07 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

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

--- Comment #6 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Both the ICE in visit_ref_for_mod_analysis and the ICE in
expand_expr_real_1 happen when there the IL includes a PARM_DECL of a
different function.  So I suspect that OpenACC outlining or something
carried over a PARM_DECL from one function to another, forgetting to
properly copy it.

In my experience, using dumps with UIDs (i.g. with
-fdump-tree-all-uid) helps tremendously when debugging these.

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

* [Bug ipa/102310] [11/12 Regression] ICE in visit_ref_for_mod_analysis with OpenACC
  2021-09-13 17:06 [Bug middle-end/102310] New: ICE in visit_ref_for_mod_analysis with OpenACC ygribov at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-10-08  9:07 ` jamborm at gcc dot gnu.org
@ 2022-04-21  7:50 ` rguenth at gcc dot gnu.org
  2022-09-23 15:23 ` [Bug ipa/102310] [11/12/13 " tschwinge at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-21  7:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug ipa/102310] [11/12/13 Regression] ICE in visit_ref_for_mod_analysis with OpenACC
  2021-09-13 17:06 [Bug middle-end/102310] New: ICE in visit_ref_for_mod_analysis with OpenACC ygribov at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2022-04-21  7:50 ` rguenth at gcc dot gnu.org
@ 2022-09-23 15:23 ` tschwinge at gcc dot gnu.org
  2023-05-29 10:05 ` [Bug ipa/102310] [11/12/13/14 " jakub at gcc dot gnu.org
  2024-04-30 13:04 ` [Bug ipa/102310] [11/12 " jamborm at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2022-09-23 15:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
I found that the '-O2' ICE 'during IPA pass: cp' originally reported here as
well as the '-O0' ICE 'during RTL pass: expand' do disappear with Julian's
recent r13-2665-g23baa717c991d77f206a9358ce2c04960ccf9eea "OpenMP/OpenACC
struct sibling list gimplification extension and rework".

I can't tell if Julian's commit indeed does fix the underlying problem, or if
it just hides it.  However:

(In reply to Martin Jambor from comment #6)
> [...] IL includes a PARM_DECL of a different function.  So I suspect [...]

From a quick before/after 'diff' of the 'gimple' dump, indeed I do see changes
re 'PARM_DECL's, but also changes in the 'map' clauses.  It seems as if the
latter may be mandating the former, but I've not looked in detail.

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

* [Bug ipa/102310] [11/12/13/14 Regression] ICE in visit_ref_for_mod_analysis with OpenACC
  2021-09-13 17:06 [Bug middle-end/102310] New: ICE in visit_ref_for_mod_analysis with OpenACC ygribov at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2022-09-23 15:23 ` [Bug ipa/102310] [11/12/13 " tschwinge at gcc dot gnu.org
@ 2023-05-29 10:05 ` jakub at gcc dot gnu.org
  2024-04-30 13:04 ` [Bug ipa/102310] [11/12 " jamborm at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-29 10:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.4                        |11.5

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 11.4 is being released, retargeting bugs to GCC 11.5.

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

* [Bug ipa/102310] [11/12 Regression] ICE in visit_ref_for_mod_analysis with OpenACC
  2021-09-13 17:06 [Bug middle-end/102310] New: ICE in visit_ref_for_mod_analysis with OpenACC ygribov at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-05-29 10:05 ` [Bug ipa/102310] [11/12/13/14 " jakub at gcc dot gnu.org
@ 2024-04-30 13:04 ` jamborm at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jamborm at gcc dot gnu.org @ 2024-04-30 13:04 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |13.1.0
            Summary|[11/12/13/14/15 Regression] |[11/12 Regression] ICE in
                   |ICE in                      |visit_ref_for_mod_analysis
                   |visit_ref_for_mod_analysis  |with OpenACC
                   |with OpenACC                |

--- Comment #10 from Martin Jambor <jamborm at gcc dot gnu.org> ---
This has been fixed in GCC 13 by r13-2665-g23baa717c991d7 (Julian Brown:
OpenMP/OpenACC struct sibling list gimplification extension and rework).

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

end of thread, other threads:[~2024-04-30 13:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13 17:06 [Bug middle-end/102310] New: ICE in visit_ref_for_mod_analysis with OpenACC ygribov at gcc dot gnu.org
2021-09-14  6:54 ` [Bug ipa/102310] [11/12 Regression] " rguenth at gcc dot gnu.org
2021-09-14  7:19 ` marxin at gcc dot gnu.org
2021-09-14  7:35 ` tschwinge at gcc dot gnu.org
2021-09-14  8:48 ` tetra2005 at gmail dot com
2021-10-07 15:54 ` hubicka at gcc dot gnu.org
2021-10-08  9:07 ` jamborm at gcc dot gnu.org
2022-04-21  7:50 ` rguenth at gcc dot gnu.org
2022-09-23 15:23 ` [Bug ipa/102310] [11/12/13 " tschwinge at gcc dot gnu.org
2023-05-29 10:05 ` [Bug ipa/102310] [11/12/13/14 " jakub at gcc dot gnu.org
2024-04-30 13:04 ` [Bug ipa/102310] [11/12 " jamborm 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).