public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/107680] ICE in arith_power, at fortran/arith.cc:989 and :1006 Date: Mon, 14 Nov 2022 21:44:07 +0000 [thread overview] Message-ID: <bug-107680-4-4GNko9rVsf@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-107680-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107680 --- Comment #2 from anlauf at gcc dot gnu.org --- We could prohibit the simplification of ** like in the following: diff --git a/gcc/fortran/arith.cc b/gcc/fortran/arith.cc index fc9224ebc5c..540b8e2b945 100644 --- a/gcc/fortran/arith.cc +++ b/gcc/fortran/arith.cc @@ -845,6 +845,12 @@ arith_power (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) if (!gfc_numeric_ts (&op1->ts) || !gfc_numeric_ts (&op2->ts)) return ARITH_INVALID_TYPE; + /* The result type shall accomodate the result of the simplification. */ + if (op1->ts.type == BT_INTEGER && op2->ts.type != BT_INTEGER) + return ARITH_NOT_REDUCED; + if (op1->ts.type == BT_REAL && op2->ts.type == BT_COMPLEX) + return ARITH_NOT_REDUCED; + rc = ARITH_OK; result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where);
next prev parent reply other threads:[~2022-11-14 21:44 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-14 17:26 [Bug fortran/107680] New: " gscfq@t-online.de 2022-11-14 18:23 ` [Bug fortran/107680] " anlauf at gcc dot gnu.org 2022-11-14 21:44 ` anlauf at gcc dot gnu.org [this message] 2022-11-15 10:18 ` mikael at gcc dot gnu.org 2022-11-15 19:34 ` anlauf at gcc dot gnu.org 2022-11-15 20:45 ` anlauf at gcc dot gnu.org 2022-11-16 20:17 ` cvs-commit at gcc dot gnu.org 2022-11-18 18:29 ` anlauf at gcc dot gnu.org 2022-11-28 22:29 ` pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-107680-4-4GNko9rVsf@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).