public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/102596] New: [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713
@ 2021-10-04 18:42 gscfq@t-online.de
  2021-10-04 20:58 ` [Bug fortran/102596] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gscfq@t-online.de @ 2021-10-04 18:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102596
           Summary: [11/12 Regression] ICE in gfc_omp_clause_default_ctor,
                    at fortran/trans-openmp.c:713
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Changed between 20201108 and 20201115 :
(ICEs with an allocatable)


$ cat z1.f90
program p
   integer, allocatable :: r
   r = 0
   !$omp target parallel reduction(task, +:r)
   r = r + 1
   !$omp end target parallel
end


$ gfortran-12-20211003 -c z1.f90 -fopenmp
during GIMPLE pass: omplower
z1.f90:5:12:

    5 |    r = r + 1
      |            ^
internal compiler error: in gfc_omp_clause_default_ctor, at
fortran/trans-openmp.c:713
0x8af41b gfc_omp_clause_default_ctor(tree_node*, tree_node*, tree_node*)
        ../../gcc/fortran/trans-openmp.c:713
0xc1fc2e lower_rec_input_clauses
        ../../gcc/omp-low.c:6460
0xc239a6 lower_omp_taskreg
        ../../gcc/omp-low.c:12407
0xc14f21 lower_omp_1
        ../../gcc/omp-low.c:14086
0xc14f21 lower_omp
        ../../gcc/omp-low.c:14287
0xc18a44 lower_omp_target
        ../../gcc/omp-low.c:12834
0xc18a44 lower_omp_1
        ../../gcc/omp-low.c:14148
0xc18a44 lower_omp
        ../../gcc/omp-low.c:14287
0xc152e8 lower_omp_1
        ../../gcc/omp-low.c:14064
0xc152e8 lower_omp
        ../../gcc/omp-low.c:14287
0xc153bd lower_omp_1
        ../../gcc/omp-low.c:14077
0xc153bd lower_omp
        ../../gcc/omp-low.c:14287
0xc1c511 execute_lower_omp
        ../../gcc/omp-low.c:14326
0xc1c511 execute
        ../../gcc/omp-low.c:14374

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

* [Bug fortran/102596] [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713
  2021-10-04 18:42 [Bug fortran/102596] New: [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 gscfq@t-online.de
@ 2021-10-04 20:58 ` pinskia at gcc dot gnu.org
  2021-10-11  8:19 ` [Bug fortran/102596] [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 since r11-4883-ge929ef532ad52cde marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-04 20:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug fortran/102596] [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 since r11-4883-ge929ef532ad52cde
  2021-10-04 18:42 [Bug fortran/102596] New: [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 gscfq@t-online.de
  2021-10-04 20:58 ` [Bug fortran/102596] " pinskia at gcc dot gnu.org
@ 2021-10-11  8:19 ` marxin at gcc dot gnu.org
  2022-01-20  9:24 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-10-11  8:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2021-10-11
     Ever confirmed|0                           |1
            Summary|[11/12 Regression] ICE in   |[11/12 Regression] ICE in
                   |gfc_omp_clause_default_ctor |gfc_omp_clause_default_ctor
                   |, at                        |, at
                   |fortran/trans-openmp.c:713  |fortran/trans-openmp.c:713
                   |                            |since
                   |                            |r11-4883-ge929ef532ad52cde
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r11-4883-ge929ef532ad52cde.

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

* [Bug fortran/102596] [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 since r11-4883-ge929ef532ad52cde
  2021-10-04 18:42 [Bug fortran/102596] New: [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 gscfq@t-online.de
  2021-10-04 20:58 ` [Bug fortran/102596] " pinskia at gcc dot gnu.org
  2021-10-11  8:19 ` [Bug fortran/102596] [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 since r11-4883-ge929ef532ad52cde marxin at gcc dot gnu.org
@ 2022-01-20  9:24 ` rguenth at gcc dot gnu.org
  2022-02-07 14:55 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-20  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4

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

* [Bug fortran/102596] [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 since r11-4883-ge929ef532ad52cde
  2021-10-04 18:42 [Bug fortran/102596] New: [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2022-01-20  9:24 ` rguenth at gcc dot gnu.org
@ 2022-02-07 14:55 ` burnus at gcc dot gnu.org
  2022-04-21  7:50 ` rguenth at gcc dot gnu.org
  2023-05-29 10:05 ` [Bug fortran/102596] [11/12/13/14 " jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2022-02-07 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
           Keywords|                            |ice-on-valid-code

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
The problem is that gfc_omp_clause_default_ctor requires outer != NULL_TREE
(gcc_assert). 

(C++ does ignore the last argument and C uses the hook_tree_tree_tree_tree_null
fallback.)

That is used in Fortran for:
  /* Allocatable arrays and scalars in PRIVATE clauses need to be set to
     "not currently allocated" allocation status if outer
     array is "not currently allocated", otherwise should be allocated.  */

But omp-low.cc has:
                  x = lang_hooks.decls.omp_clause_default_ctor
                                (c, unshare_expr (new_var),
                                 cond ? NULL_TREE
                                 : build_outer_var_ref (var, ctx));
Note the NULL_TREE.


My impression is that NULL_TREE is fine for reduction - and there is also code
like:


  /* Reduction clause requires allocated ALLOCATABLE.  */
  if (OMP_CLAUSE_CODE (clause) != OMP_CLAUSE_REDUCTION
      && OMP_CLAUSE_CODE (clause) != OMP_CLAUSE_IN_REDUCTION
      && OMP_CLAUSE_CODE (clause) != OMP_CLAUSE_TASK_REDUCTION)
    {
      gfc_init_block (&cond_block);
...
      tree tem = fold_convert (pvoid_type_node,
                               GFC_DESCRIPTOR_TYPE_P (type)
                               ? gfc_conv_descriptor_data_get (outer) :
outer);/*...*/
      cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
                              tem, null_pointer_node);


However - there is other code which uses 'outer' like:
      tree tem = gfc_walk_alloc_comps (outer, decl,
or 
      gfc_add_modify (&cond_block, decl, outer);
and those make use of 'outer'.

I don't quickly see whether outer is always required or it can be deduced in
this case. 
(Does using OMP_CLAUSE_REDUCTION_PLACEHOLDER() make sense here?) — Or whether
some is-always-used case (→ 'cond' case) is needed as additional flag or
encoded in outer.


PS: I don't think it is a real regression as 'reduction(task:' wasn't supported
before.

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

* [Bug fortran/102596] [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 since r11-4883-ge929ef532ad52cde
  2021-10-04 18:42 [Bug fortran/102596] New: [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2022-02-07 14:55 ` burnus at gcc dot gnu.org
@ 2022-04-21  7:50 ` rguenth at gcc dot gnu.org
  2023-05-29 10:05 ` [Bug fortran/102596] [11/12/13/14 " jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ 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=102596

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

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

--- Comment #3 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] 7+ messages in thread

* [Bug fortran/102596] [11/12/13/14 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 since r11-4883-ge929ef532ad52cde
  2021-10-04 18:42 [Bug fortran/102596] New: [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2022-04-21  7:50 ` rguenth at gcc dot gnu.org
@ 2023-05-29 10:05 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ 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=102596

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

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

--- Comment #4 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] 7+ messages in thread

end of thread, other threads:[~2023-05-29 10:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-04 18:42 [Bug fortran/102596] New: [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 gscfq@t-online.de
2021-10-04 20:58 ` [Bug fortran/102596] " pinskia at gcc dot gnu.org
2021-10-11  8:19 ` [Bug fortran/102596] [11/12 Regression] ICE in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:713 since r11-4883-ge929ef532ad52cde marxin at gcc dot gnu.org
2022-01-20  9:24 ` rguenth at gcc dot gnu.org
2022-02-07 14:55 ` burnus at gcc dot gnu.org
2022-04-21  7:50 ` rguenth at gcc dot gnu.org
2023-05-29 10:05 ` [Bug fortran/102596] [11/12/13/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).