[Bug fortran/107000] ICE in gfc_real2complex, at fortran/arith.cc:2243
anlauf at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Sep 21 18:58:23 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107000
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2022-09-21
--- Comment #2 from anlauf at gcc dot gnu.org ---
Confirmed.
Comment#0 is fixed by e.g.
diff --git a/gcc/fortran/arith.cc b/gcc/fortran/arith.cc
index d57059a375f..1f290050189 100644
--- a/gcc/fortran/arith.cc
+++ b/gcc/fortran/arith.cc
@@ -2238,6 +2238,9 @@ gfc_real2complex (gfc_expr *src, int kind)
arith rc;
bool did_warn = false;
+ if (src->ts.type != BT_REAL)
+ return NULL;
+
result = gfc_get_constant_expr (BT_COMPLEX, kind, &src->where);
mpc_set_fr (result->value.complex, src->value.real, GFC_MPC_RND_MODE);
but comment#1 has a different stack trace, as it hits an assert.
More information about the Gcc-bugs
mailing list