public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/110585] New: ICE in gfc_compare_expr for findloc with complex literal array
@ 2023-07-07 9:36 zed.three at gmail dot com
2023-07-07 10:03 ` [Bug fortran/110585] " anlauf at gcc dot gnu.org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: zed.three at gmail dot com @ 2023-07-07 9:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110585
Bug ID: 110585
Summary: ICE in gfc_compare_expr for findloc with complex
literal array
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: zed.three at gmail dot com
Target Milestone: ---
Created attachment 55497
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55497&action=edit
MVCE for findloc ICE with complex literal array
The following MVCE gives an ICE in gfortran 9-13 and trunk:
program mvce
implicit none
print*,findloc([(1.0,0.0), (2.0,1.0)], (2.0,0.0))
end program mvce
Backtrace on trunk:
f951: internal compiler error: gfc_compare_expr(): Bad basic type
0xa1a997 gfc_internal_error(char const*, ...)
???:0
0x9e0cff gfc_compare_expr(gfc_expr*, gfc_expr*, gfc_intrinsic_op)
???:0
0xaba5a9 gfc_simplify_findloc(gfc_expr*, gfc_expr*, gfc_expr*, gfc_expr*,
gfc_expr*, gfc_expr*)
???:0
0xa3ab0a gfc_intrinsic_func_interface(gfc_expr*, int)
???:0
0xa9be0b gfc_resolve_code(gfc_code*, gfc_namespace*)
???:0
0xa9a9ab gfc_resolve_blocks(gfc_code*, gfc_namespace*)
???:0
0xa9ac97 gfc_resolve_code(gfc_code*, gfc_namespace*)
???:0
0xa84f30 gfc_parse_file()
???:0
Compiler Explorer reproducer: https://godbolt.org/z/bdsehGfxc
Changing the first argument to a variable (that is, not a literal array), or
changing the type of the elements and needle to real or integer works fine.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/110585] ICE in gfc_compare_expr for findloc with complex literal array
2023-07-07 9:36 [Bug fortran/110585] New: ICE in gfc_compare_expr for findloc with complex literal array zed.three at gmail dot com
@ 2023-07-07 10:03 ` anlauf at gcc dot gnu.org
2023-07-07 18:33 ` anlauf at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-07-07 10:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110585
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |anlauf at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
CC| |anlauf at gcc dot gnu.org
Last reconfirmed| |2023-07-07
--- Comment #1 from anlauf at gcc dot gnu.org ---
Confirmed. Complex seems to have been forgotten in simplification...
Obvious fix:
@@ -1120,6 +1130,10 @@ gfc_compare_expr (gfc_expr *op1, gfc_expr *op2,
gfc_intrinsic_op op)
|| (op1->value.logical && !op2->value.logical));
break;
+ case BT_COMPLEX:
+ rc = mpc_cmp (op1->value.complex, op2->value.complex);
+ break;
+
default:
gfc_internal_error ("gfc_compare_expr(): Bad basic type");
}
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/110585] ICE in gfc_compare_expr for findloc with complex literal array
2023-07-07 9:36 [Bug fortran/110585] New: ICE in gfc_compare_expr for findloc with complex literal array zed.three at gmail dot com
2023-07-07 10:03 ` [Bug fortran/110585] " anlauf at gcc dot gnu.org
@ 2023-07-07 18:33 ` anlauf at gcc dot gnu.org
2023-07-08 14:15 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-07-07 18:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110585
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
--- Comment #2 from anlauf at gcc dot gnu.org ---
Submitted: https://gcc.gnu.org/pipermail/fortran/2023-July/059566.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/110585] ICE in gfc_compare_expr for findloc with complex literal array
2023-07-07 9:36 [Bug fortran/110585] New: ICE in gfc_compare_expr for findloc with complex literal array zed.three at gmail dot com
2023-07-07 10:03 ` [Bug fortran/110585] " anlauf at gcc dot gnu.org
2023-07-07 18:33 ` anlauf at gcc dot gnu.org
@ 2023-07-08 14:15 ` cvs-commit at gcc dot gnu.org
2023-07-08 18:44 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-07-08 14:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110585
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:7ac1581d066a6f3a0d4acf1042a74634258b4966
commit r14-2394-g7ac1581d066a6f3a0d4acf1042a74634258b4966
Author: Harald Anlauf <anlauf@gmx.de>
Date: Fri Jul 7 20:25:06 2023 +0200
Fortran: simplification of FINDLOC for constant complex arguments
[PR110585]
gcc/fortran/ChangeLog:
PR fortran/110585
* arith.cc (gfc_compare_expr): Handle equality comparison of
constant
complex gfc_expr arguments.
gcc/testsuite/ChangeLog:
PR fortran/110585
* gfortran.dg/findloc_9.f90: New test.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/110585] ICE in gfc_compare_expr for findloc with complex literal array
2023-07-07 9:36 [Bug fortran/110585] New: ICE in gfc_compare_expr for findloc with complex literal array zed.three at gmail dot com
` (2 preceding siblings ...)
2023-07-08 14:15 ` cvs-commit at gcc dot gnu.org
@ 2023-07-08 18:44 ` cvs-commit at gcc dot gnu.org
2023-07-08 18:49 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-07-08 18:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110585
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:d00a7d22c68aae583fa37236d894a220028dd0c8
commit r13-7550-gd00a7d22c68aae583fa37236d894a220028dd0c8
Author: Harald Anlauf <anlauf@gmx.de>
Date: Fri Jul 7 20:25:06 2023 +0200
Fortran: simplification of FINDLOC for constant complex arguments
[PR110585]
gcc/fortran/ChangeLog:
PR fortran/110585
* arith.cc (gfc_compare_expr): Handle equality comparison of
constant
complex gfc_expr arguments.
gcc/testsuite/ChangeLog:
PR fortran/110585
* gfortran.dg/findloc_9.f90: New test.
(cherry picked from commit 7ac1581d066a6f3a0d4acf1042a74634258b4966)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/110585] ICE in gfc_compare_expr for findloc with complex literal array
2023-07-07 9:36 [Bug fortran/110585] New: ICE in gfc_compare_expr for findloc with complex literal array zed.three at gmail dot com
` (3 preceding siblings ...)
2023-07-08 18:44 ` cvs-commit at gcc dot gnu.org
@ 2023-07-08 18:49 ` cvs-commit at gcc dot gnu.org
2023-07-08 18:59 ` cvs-commit at gcc dot gnu.org
2023-07-08 19:01 ` anlauf at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-07-08 18:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110585
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:2d416f352be898c408fd3db402719d6625f26720
commit r12-9762-g2d416f352be898c408fd3db402719d6625f26720
Author: Harald Anlauf <anlauf@gmx.de>
Date: Fri Jul 7 20:25:06 2023 +0200
Fortran: simplification of FINDLOC for constant complex arguments
[PR110585]
gcc/fortran/ChangeLog:
PR fortran/110585
* arith.cc (gfc_compare_expr): Handle equality comparison of
constant
complex gfc_expr arguments.
gcc/testsuite/ChangeLog:
PR fortran/110585
* gfortran.dg/findloc_9.f90: New test.
(cherry picked from commit 7ac1581d066a6f3a0d4acf1042a74634258b4966)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/110585] ICE in gfc_compare_expr for findloc with complex literal array
2023-07-07 9:36 [Bug fortran/110585] New: ICE in gfc_compare_expr for findloc with complex literal array zed.three at gmail dot com
` (4 preceding siblings ...)
2023-07-08 18:49 ` cvs-commit at gcc dot gnu.org
@ 2023-07-08 18:59 ` cvs-commit at gcc dot gnu.org
2023-07-08 19:01 ` anlauf at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-07-08 18:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110585
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:8e365976ddc856a4c08aa52f90799330baed599a
commit r11-10900-g8e365976ddc856a4c08aa52f90799330baed599a
Author: Harald Anlauf <anlauf@gmx.de>
Date: Fri Jul 7 20:25:06 2023 +0200
Fortran: simplification of FINDLOC for constant complex arguments
[PR110585]
gcc/fortran/ChangeLog:
PR fortran/110585
* arith.c (gfc_compare_expr): Handle equality comparison of
constant
complex gfc_expr arguments.
gcc/testsuite/ChangeLog:
PR fortran/110585
* gfortran.dg/findloc_9.f90: New test.
(cherry picked from commit 7ac1581d066a6f3a0d4acf1042a74634258b4966)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/110585] ICE in gfc_compare_expr for findloc with complex literal array
2023-07-07 9:36 [Bug fortran/110585] New: ICE in gfc_compare_expr for findloc with complex literal array zed.three at gmail dot com
` (5 preceding siblings ...)
2023-07-08 18:59 ` cvs-commit at gcc dot gnu.org
@ 2023-07-08 19:01 ` anlauf at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-07-08 19:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110585
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Target Milestone|--- |11.5
Status|ASSIGNED |RESOLVED
--- Comment #7 from anlauf at gcc dot gnu.org ---
Fixed on mainline for gcc-14, and on all open branches. Closing.
Thanks for the report!
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-07-08 19:01 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-07 9:36 [Bug fortran/110585] New: ICE in gfc_compare_expr for findloc with complex literal array zed.three at gmail dot com
2023-07-07 10:03 ` [Bug fortran/110585] " anlauf at gcc dot gnu.org
2023-07-07 18:33 ` anlauf at gcc dot gnu.org
2023-07-08 14:15 ` cvs-commit at gcc dot gnu.org
2023-07-08 18:44 ` cvs-commit at gcc dot gnu.org
2023-07-08 18:49 ` cvs-commit at gcc dot gnu.org
2023-07-08 18:59 ` cvs-commit at gcc dot gnu.org
2023-07-08 19:01 ` anlauf 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).