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

--- Comment #8 from Christopher Albert <albert at tugraz dot at> ---
Created attachment 64074
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64074&action=edit
[PATCH] fortran: Fix ICE in gfc_conv_array_initializer with invalid index
[PR103367]

Patch attached.

An undefined variable used as an array index in a parameter initializer
expression reaches gfc_conv_array_initializer after parameter substitution
with an unexpected expression type, hitting gcc_unreachable().

The fix guards against unexpected expression types by returning a zero-filled
constructor, since the frontend has already diagnosed the error.

Regtested on x86_64-pc-linux-gnu with full check-gfortran: 0 FAIL / XPASS.
  • [Bug fortran/103367] [13/14/15/... albert at tugraz dot at via Gcc-bugs

Reply via email to