[Bug fortran/107000] ICE in gfc_real2complex, at fortran/arith.cc:2243

anlauf at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Oct 3 19:36:11 GMT 2022


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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #53651|0                           |1
        is obsolete|                            |

--- Comment #20 from anlauf at gcc dot gnu.org ---
Created attachment 53659
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53659&action=edit
Next try.

(In reply to Mikael Morin from comment #18)
> Well, a new return code seems better (ARITH_INVALID_TYPE ?).
> I think it's better to move the check to the various gfc_arith_times,
> gfc_arith_plus, gfc_arith_concat etc, because only those functions know what
> type is appropriate and what is not.
> Admittedly BT_UNKNOWN is probably never appropriate, and the check could be
> done in reduce_binary_ac, but then it should be in reduce_binary_ca,
> reduce_binary_aa and reduce_unary as well.
> Then what's missing is a goto runtime in eval_intrinsic if evaluation
> returns ARITH_INVALID_TYPE.
> That's the first solution.

Here's a patch that introduces ARITH_INVALID_TYPE and handles errors in
reduce_unary, reduce_binary_ac, reduce_binary_ca, and reduce_binary_aa.


More information about the Gcc-bugs mailing list