* [Bug fortran/108450] [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380
2023-01-18 18:23 [Bug fortran/108450] New: [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 gscfq@t-online.de
@ 2023-01-19 7:47 ` rguenth at gcc dot gnu.org
2023-01-19 14:16 ` [Bug fortran/108450] [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 since r12-5793-g689407ef916503b2 marxin at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-19 7:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108450
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |12.3
Priority|P3 |P4
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/108450] [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 since r12-5793-g689407ef916503b2
2023-01-18 18:23 [Bug fortran/108450] New: [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 gscfq@t-online.de
2023-01-19 7:47 ` [Bug fortran/108450] " rguenth at gcc dot gnu.org
@ 2023-01-19 14:16 ` marxin at gcc dot gnu.org
2023-01-20 18:03 ` burnus at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-01-19 14:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108450
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2023-01-19
Summary|[12/13 Regression] ICE in |[12/13 Regression] ICE in
|sort_actual, at |sort_actual, at
|fortran/intrinsic.cc:4380 |fortran/intrinsic.cc:4380
| |since
| |r12-5793-g689407ef916503b2
CC| |burnus at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-5793-g689407ef916503b2.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/108450] [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 since r12-5793-g689407ef916503b2
2023-01-18 18:23 [Bug fortran/108450] New: [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 gscfq@t-online.de
2023-01-19 7:47 ` [Bug fortran/108450] " rguenth at gcc dot gnu.org
2023-01-19 14:16 ` [Bug fortran/108450] [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 since r12-5793-g689407ef916503b2 marxin at gcc dot gnu.org
@ 2023-01-20 18:03 ` burnus at gcc dot gnu.org
2023-01-29 19:47 ` mikael at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2023-01-20 18:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108450
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Interestingly, it is resolved twice. First for:
(gdb) p gfc_debug_expr(e)
maxloc[((p:a) (mask = p:l))]
via
resolve_all_program_units → gfc_resolve → gfc_resolve → resolve_codes →
gfc_resolve_code → gfc_resolve_blocks → gfc_resolve_code → gfc_resolve_expr
And then via:
... → resolve_omp_atomic → gfc_resolve_expr
The problem is that in the latter case, the 'e' is now:
maxloc[((p:a(FULL)) (mask = p:l) (.false.))]
and the unprefixed .false. seems to cause the problems.
The intrinsic uses:
RESULT = MAXLOC(ARRAY, DIM [, MASK] [,KIND] [,BACK])
RESULT = MAXLOC(ARRAY [, MASK] [,KIND] [,BACK])
During the first call to check_specific,
maxloc[((p:a(FULL)) (mask = p:l))]
is turned into
maxloc[((p:a(FULL)) ((arg not-present)) (mask = p:l) ((arg not-present))
((arg not-present)))]
via
4774 if (!sort_actual (specific->name, ap, specific->formal,
&expr->where))
The null-args are later removed via 'remove_nullargs (ap);'
* * *
Thus, it looks as if resolving the RHS expression twice is wrong.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/108450] [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 since r12-5793-g689407ef916503b2
2023-01-18 18:23 [Bug fortran/108450] New: [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 gscfq@t-online.de
` (2 preceding siblings ...)
2023-01-20 18:03 ` burnus at gcc dot gnu.org
@ 2023-01-29 19:47 ` mikael at gcc dot gnu.org
2023-01-29 20:57 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: mikael at gcc dot gnu.org @ 2023-01-29 19:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108450
Mikael Morin <mikael at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |mikael at gcc dot gnu.org
Status|NEW |ASSIGNED
CC| |mikael at gcc dot gnu.org
--- Comment #3 from Mikael Morin <mikael at gcc dot gnu.org> ---
Taking, patch submitted:
https://gcc.gnu.org/pipermail/gcc-patches/2023-January/610834.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/108450] [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 since r12-5793-g689407ef916503b2
2023-01-18 18:23 [Bug fortran/108450] New: [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 gscfq@t-online.de
` (3 preceding siblings ...)
2023-01-29 19:47 ` mikael at gcc dot gnu.org
@ 2023-01-29 20:57 ` cvs-commit at gcc dot gnu.org
2023-02-05 21:53 ` cvs-commit at gcc dot gnu.org
2023-02-05 22:22 ` mikael at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-29 20:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108450
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Mikael Morin <mikael@gcc.gnu.org>:
https://gcc.gnu.org/g:2e32a12c04c72f692a7bd119fd3e4e5b74392c9d
commit r13-5486-g2e32a12c04c72f692a7bd119fd3e4e5b74392c9d
Author: Mikael Morin <mikael@gcc.gnu.org>
Date: Sun Jan 29 21:57:24 2023 +0100
fortran: Set name for *LOC default BACK argument [PR108450]
This change fixes an ICE caused by the double resolution of MINLOC,
MAXLOC and FINDLOC expressions which get a default value for the BACK
argument at resolution time. That argument is added without name,
and argument reordering code is not prepared to handle unnamed arguments
coming after named ones, so the second resolution causes a NULL pointer
dereference.
The problem is fixed by explicitly setting the argument name.
PR fortran/108450
gcc/fortran/ChangeLog:
* check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
(gfc_check_findloc): Ditto.
gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/minmaxloc_1.f90: New test.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/108450] [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 since r12-5793-g689407ef916503b2
2023-01-18 18:23 [Bug fortran/108450] New: [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 gscfq@t-online.de
` (4 preceding siblings ...)
2023-01-29 20:57 ` cvs-commit at gcc dot gnu.org
@ 2023-02-05 21:53 ` cvs-commit at gcc dot gnu.org
2023-02-05 22:22 ` mikael at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-02-05 21:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108450
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Mikael Morin
<mikael@gcc.gnu.org>:
https://gcc.gnu.org/g:32502d82a5b54ca5b8e524df9fcad851727dc54a
commit r12-9108-g32502d82a5b54ca5b8e524df9fcad851727dc54a
Author: Mikael Morin <mikael@gcc.gnu.org>
Date: Sun Jan 29 21:57:24 2023 +0100
fortran: Set name for *LOC default BACK argument [PR108450]
This change fixes an ICE caused by the double resolution of MINLOC,
MAXLOC and FINDLOC expressions which get a default value for the BACK
argument at resolution time. That argument is added without name,
and argument reordering code is not prepared to handle unnamed arguments
coming after named ones, so the second resolution causes a NULL pointer
dereference.
The problem is fixed by explicitly setting the argument name.
PR fortran/108450
gcc/fortran/ChangeLog:
* check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
(gfc_check_findloc): Ditto.
gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/minmaxloc_1.f90: New test.
(cherry picked from commit 2e32a12c04c72f692a7bd119fd3e4e5b74392c9d)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/108450] [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 since r12-5793-g689407ef916503b2
2023-01-18 18:23 [Bug fortran/108450] New: [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380 gscfq@t-online.de
` (5 preceding siblings ...)
2023-02-05 21:53 ` cvs-commit at gcc dot gnu.org
@ 2023-02-05 22:22 ` mikael at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: mikael at gcc dot gnu.org @ 2023-02-05 22:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108450
Mikael Morin <mikael at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #6 from Mikael Morin <mikael at gcc dot gnu.org> ---
Fixed for gcc-13.1 and gcc-12.3.
Closing.
^ permalink raw reply [flat|nested] 8+ messages in thread